Search in sources :

Example 36 with Verifier

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

the class XtendCompilerMojoTraceIT method traceDisabled.

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

Example 37 with Verifier

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

the class XtendInstallDebugInfoMojoIT method simpleSmapMultisource.

@Test
public void simpleSmapMultisource() throws Exception {
    Verifier verifier = verifyErrorFreeLog(ROOT + "/smap_multisource");
    String info1 = new ClassFileDebugInfoExtractor().getDebugInfo(verifier.getBasedir() + "/target/classes");
    String xpt1 = "// classes {\n" + "  // test {\n" + "    package test; // JavaB.class\n" + "    class JavaB {\n" + "      void <init>() { // JavaB.java:13\n" + "        void this;\n" + "      }\n" + "      void foo() { // JavaB.java:15\n" + "        void this;\n" + "        void test;\n" + "      }\n" + "    }\n" + "    \n" + "    package test; // XtendA.class\n" + "    class XtendA {\n" + "      void <init>() { // XtendA.java:7\n" + "        void this;\n" + "      }\n" + "      void test2() { // XtendA.java:9\n" + "        // XtendA.java:9 -> XtendA.xtend:6\n" + "        void this;\n" + "        void s;\n" + "      }\n" + "      void newJavaB() { // XtendA.java:13\n" + "        // XtendA.java:13 -> XtendA.xtend:10\n" + "        void this;\n" + "      }\n" + "    }\n" + "    \n" + "    package test; // XtendC.class\n" + "    class XtendC {\n" + "      void <init>() { // XtendC.java:7\n" + "        void this;\n" + "      }\n" + "      void test() { // XtendC.java:9\n" + "        // XtendC.java:9 -> XtendC.xtend:5\n" + "        void this;\n" + "        void s;\n" + "      }\n" + "    }\n" + "  }\n" + "}";
    Assert.assertEquals(xpt1.toString(), info1);
    String info2 = new ClassFileDebugInfoExtractor().getDebugInfo(verifier.getBasedir() + "/target/test-classes");
    String xpt2 = "// test-classes {\n" + "  // foo {\n" + "    package foo; // FooClass.class\n" + "    class FooClass {\n" + "      void <init>() { // FooClass.java:6\n" + "        void this;\n" + "      }\n" + "      void count() { // FooClass.java:8\n" + "        // FooClass.java:8 -> FooClass.xtend:8\n" + "        void this;\n" + "      }\n" + "      void newJavaB() { // FooClass.java:12\n" + "        // FooClass.java:12 -> FooClass.xtend:12\n" + "        void this;\n" + "      }\n" + "    }\n" + "    \n" + "    package foo; // FooTest.class\n" + "    class FooTest {\n" + "      void <init>() { // FooTest.java:8\n" + "        void this;\n" + "      }\n" + "      void assertTrue() { // FooTest.java:11\n" + "        // FooTest.java:11 -> FooTest.xtend:11\n" + "        void this;\n" + "      }\n" + "    }\n" + "  }\n" + "}";
    Assert.assertEquals(xpt2.toString(), info2);
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 38 with Verifier

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

the class XtendInstallDebugInfoMojoIT method simpleXtendAsPrimaryWithSyntheticVars.

@Test
public void simpleXtendAsPrimaryWithSyntheticVars() throws Exception {
    Verifier verifier = verifyErrorFreeLog(ROOT + "/xtend_as_primary_with_synthetic_vars");
    String xtendGenDir = verifier.getBasedir() + "/target/classes/test";
    String debugInfo = new ClassFileDebugInfoExtractor().getDebugInfo(xtendGenDir);
    // please note that here we have source information only for Xtend
    String xpt = "// test {\n" + "  package test; // XtendA$1.class\n" + "  class XtendA$1 {\n" + "    void <init>() { // XtendA.xtend:6\n" + "      void this;\n" + "    }\n" + "    void apply() { // XtendA.xtend:6\n" + "      void this;\n" + "      void it;\n" + "    }\n" + "  }\n" + "  \n" + "  package test; // XtendA.class\n" + "  class XtendA {\n" + "    void <init>() { // XtendA.xtend:5\n" + "      void this;\n" + "      void _function;\n" + "      void myvar;\n" + "    }\n" + "  }\n" + "  \n" + "  package test; // XtendA2.class\n" + "  class XtendA2 {\n" + "    void <init>() { // XtendA.xtend:13\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 39 with Verifier

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

the class XtendInstallDebugInfoMojoIT method simpleXtendAsPrimary.

@Test
public void simpleXtendAsPrimary() throws Exception {
    Verifier verifier = verifyErrorFreeLog(ROOT + "/xtend_as_primary");
    String xtendGenDir = verifier.getBasedir() + "/target/classes/test";
    String debugInfo = new ClassFileDebugInfoExtractor().getDebugInfo(xtendGenDir);
    // please note that here we have source information only for Xtend
    String xpt = "// test {\n" + "  package test; // XtendA$1.class\n" + "  class XtendA$1 {\n" + "    void <init>() { // XtendA.xtend:6\n" + "      void this;\n" + "    }\n" + "    void apply() { // XtendA.xtend:6\n" + "      void this;\n" + "      void it;\n" + "    }\n" + "  }\n" + "  \n" + "  package test; // XtendA.class\n" + "  class XtendA {\n" + "    void <init>() { // XtendA.xtend:5\n" + "      void this;\n" + "      void myvar;\n" + "    }\n" + "  }\n" + "  \n" + "  package test; // XtendA2.class\n" + "  class XtendA2 {\n" + "    void <init>() { // XtendA.xtend:13\n" + "      void this;\n" + "    }\n" + "  }\n" + "}";
    Assert.assertEquals(debugInfo, xpt.toString(), debugInfo);
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

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