X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fmaven-yang-plugin-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fyang2sources%2Fplugin%2Fit%2FYangToSourcesPluginTestIT.java;h=9532d4efc9f92a4fbabe32e6ab11b79665e81e37;hb=9c8108faabf300747a2a5529dc7a8ef76e79c2bc;hp=280284bcba38d9378a54c225d53a69f7ad02dc5a;hpb=ab524667cd77b544066d913757d1e042e4e2afe7;p=controller.git diff --git a/opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/java/org/opendaylight/controller/yang2sources/plugin/it/YangToSourcesPluginTestIT.java b/opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/java/org/opendaylight/controller/yang2sources/plugin/it/YangToSourcesPluginTestIT.java index 280284bcba..9532d4efc9 100644 --- a/opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/java/org/opendaylight/controller/yang2sources/plugin/it/YangToSourcesPluginTestIT.java +++ b/opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/java/org/opendaylight/controller/yang2sources/plugin/it/YangToSourcesPluginTestIT.java @@ -11,6 +11,7 @@ import static org.junit.Assert.*; import static org.junit.matchers.JUnitMatchers.*; import java.io.File; +import java.net.URL; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; @@ -47,8 +48,12 @@ public class YangToSourcesPluginTestIT { Verifier v = setUp("AdditionalConfig/", false); v.verifyTextInLog("[DEBUG] yang-to-sources: Additional configuration picked up for : org.opendaylight.controller.yang2sources.spi.CodeGeneratorTestImpl: {nm1=abcd=a.b.c.d, nm2=abcd2=a.b.c.d.2}"); v.verifyTextInLog("[DEBUG] yang-to-sources: Additional configuration picked up for : org.opendaylight.controller.yang2sources.spi.CodeGeneratorTestImpl: {c1=config}"); - v.verifyTextInLog("../files marked as resources: META-INF/yang"); - v.verifyTextInLog("target/generated-resources marked as resources for generator: org.opendaylight.controller.yang2sources.spi.CodeGeneratorTestImpl"); + v.verifyTextInLog(File.separator + + "files marked as resources: META-INF" + File.separator + + "yang"); + v.verifyTextInLog("target" + + File.separator + + "generated-resources marked as resources for generator: org.opendaylight.controller.yang2sources.spi.CodeGeneratorTestImpl"); } @Test @@ -104,8 +109,10 @@ public class YangToSourcesPluginTestIT { static Verifier setUp(String project, boolean ignoreF) throws VerificationException { - Verifier verifier = new Verifier(new File("src/test/resources/" - + project).getAbsolutePath()); + final URL path = YangToSourcesPluginTestIT.class.getResource("/" + + project + "pom.xml"); + File parent = new File(path.getPath()); + Verifier verifier = new Verifier(parent.getParent()); if (ignoreF) verifier.addCliOption("-fn"); verifier.setMavenDebug(true); @@ -121,8 +128,8 @@ public class YangToSourcesPluginTestIT { @Test public void testFindResourceOnCp() throws VerificationException { - Verifier v1 = new Verifier( - new File("src/test/resources/GenerateTest1/").getAbsolutePath()); + Verifier v1 = new Verifier(new File(getClass().getResource( + "/GenerateTest1/pom.xml").getPath()).getParent()); v1.executeGoal("clean"); v1.executeGoal("package"); v1.assertFilePresent("target/classes/META-INF/yang/testfile1.yang"); @@ -137,5 +144,4 @@ public class YangToSourcesPluginTestIT { v2.assertFileNotPresent("target/classes/META-INF/yang/testfile2.yang"); v2.assertFileNotPresent("target/classes/META-INF/yang/testfile3.yang"); } - }