Search in sources :

Example 16 with Verifier

use of org.apache.maven.it.Verifier in project xtext-xtend by eclipse.

the class XtendCompilerMojoTraceIT method traceEnabled.

@Test
public void traceEnabled() throws Exception {
    Verifier verifier = verifyErrorFreeLog(ROOT + "/trace_enabled");
    String xtendGenDir = verifier.getBasedir() + "/src/main/generated-sources/xtend/";
    verifier.assertFilePresent(xtendGenDir + "test/.XtendA.java._trace");
    verifier.assertFilePresent(xtendGenDir + "test/.XtendA2.java._trace");
    Assert.assertEquals("test/XtendA.xtend", loadTraceSourcePath(xtendGenDir + "test/.XtendA.java._trace"));
    Assert.assertEquals("test/XtendA.xtend", loadTraceSourcePath(xtendGenDir + "test/.XtendA2.java._trace"));
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 17 with Verifier

use of org.apache.maven.it.Verifier in project xtext-xtend by eclipse.

the class XtendCompilerMojoTraceIT method verifyErrorFreeLog.

private Verifier verifyErrorFreeLog(String pathToTestProject, String goal) throws IOException, VerificationException {
    Verifier verifier = newVerifier(pathToTestProject, debug);
    verifier.setMavenDebug(debug);
    verifier.executeGoal(goal);
    verifier.verifyErrorFreeLog();
    verifier.setDebug(true);
    verifier.resetStreams();
    return verifier;
}
Also used : Verifier(org.apache.maven.it.Verifier)

Example 18 with Verifier

use of org.apache.maven.it.Verifier in project xtext-xtend by eclipse.

the class XtendCompilerMojoTraceIT method traceWithTestSrc.

@Test
public void traceWithTestSrc() throws Exception {
    Verifier verifier = verifyErrorFreeLog(ROOT + "/trace_withtestsrc");
    String xtendGenDir = verifier.getBasedir() + "/src/";
    verifier.assertFileNotPresent(xtendGenDir + "main/generated-sources/xtend/test/.FooTest.java._trace");
    verifier.assertFileNotPresent(xtendGenDir + "test/generated-sources/xtend/test/.FooTest.java._trace");
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 19 with Verifier

use of org.apache.maven.it.Verifier in project xtext-xtend by eclipse.

the class XtendInstallDebugInfoMojoIT method simpleSMAP.

@Test
public void simpleSMAP() throws Exception {
    Verifier verifier = verifyErrorFreeLog(ROOT + "/simple_smap");
    String xtendGenDir = verifier.getBasedir() + "/target/classes/test";
    String debugInfo = new ClassFileDebugInfoExtractor().getDebugInfo(xtendGenDir);
    // please note that here we have source information for both Java and Xtend
    String xpt = "// test {\n" + "  package test; // XtendA$1.class\n" + "  class XtendA$1 {\n" + "    void <init>() { // XtendA.java:13\n" + "      // XtendA.java:13 -> XtendA.xtend:6\n" + "      void this;\n" + "    }\n" + "    void apply() { // XtendA.java:15\n" + "      // XtendA.java:15 -> XtendA.xtend:6\n" + "      void this;\n" + "      void it;\n" + "    }\n" + "  }\n" + "  \n" + "  package test; // XtendA.class\n" + "  class XtendA {\n" + "    void <init>() { // XtendA.java:11\n" + "      // XtendA.java:12 -> XtendA.xtend:5\n" + "      // XtendA.java:13:18 -> XtendA.xtend:6\n" + "      void this;\n" + "      void _function;\n" + "    }\n" + "  }\n" + "  \n" + "  package test; // XtendA2.class\n" + "  class XtendA2 {\n" + "    void <init>() { // XtendA2.java:7\n" + "      // XtendA2.java:8 -> XtendA.xtend:12\n" + "      void this;\n" + "    }\n" + "  }\n" + "}";
    Assert.assertEquals(debugInfo, xpt.toString(), debugInfo);
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 20 with Verifier

use of org.apache.maven.it.Verifier in project xtext-xtend by eclipse.

the class XtendInstallDebugInfoMojoIT method verifyErrorFreeLog.

private Verifier verifyErrorFreeLog(String pathToTestProject, String goal) throws IOException, VerificationException {
    Verifier verifier = newVerifier(pathToTestProject);
    // verifier.setForkJvm(false);
    verifier.setDebug(true);
    verifier.executeGoal(goal);
    verifier.verifyErrorFreeLog();
    verifier.resetStreams();
    return verifier;
}
Also used : Verifier(org.apache.maven.it.Verifier)

Aggregations

Verifier (org.apache.maven.it.Verifier)39 Test (org.junit.Test)21 File (java.io.File)20 VerificationException (org.apache.maven.it.VerificationException)5 HashSet (java.util.HashSet)4 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 BeforeClass (org.junit.BeforeClass)1