Search in sources :

Example 31 with Verifier

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

the class XtendCompilerMojoIT method haltOnXtendValidationErrors.

@Test
public void haltOnXtendValidationErrors() throws Exception {
    Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/xtenderrors");
    try {
        verifier.executeGoal("verify");
        Assert.fail("expected org.apache.maven.plugin.MojoExecutionException");
    } catch (Exception e) {
        verifier.verifyTextInLog("3: Superclass must be a class");
        verifier.verifyTextInLog("BUILD FAILURE");
    }
}
Also used : Verifier(org.apache.maven.it.Verifier) VerificationException(org.apache.maven.it.VerificationException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) Test(org.junit.Test)

Example 32 with Verifier

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

the class XtendCompilerMojoIT method setUpOnce.

@BeforeClass
public static void setUpOnce() throws IOException, VerificationException {
    MavenVerifierUtil.checkMavenExecutable(ROOT);
    Verifier clientVerifier = MavenVerifierUtil.newVerifier("/it");
    clientVerifier.executeGoal("install");
}
Also used : Verifier(org.apache.maven.it.Verifier) BeforeClass(org.junit.BeforeClass)

Example 33 with Verifier

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

the class XtendCompilerMojoIT method fileSystemAccess.

@Test
public void fileSystemAccess() throws Exception {
    deleteFileIfExist("myusercode/UserCode.css");
    deleteFileIfExist("com/itemis/myusercode/UserCode2.css");
    Verifier annotationVerifier = MavenVerifierUtil.newVerifier(ROOT + "/filesystemaccess");
    annotationVerifier.setDebug(true);
    annotationVerifier.executeGoal("install");
    annotationVerifier.verifyErrorFreeLog();
    Verifier clientVerifier = MavenVerifierUtil.newVerifier(ROOT + "/filesystemaccess-client");
    clientVerifier.setDebug(true);
    clientVerifier.executeGoal("compile");
    clientVerifier.verifyErrorFreeLog();
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 34 with Verifier

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

the class XtendCompilerMojoIT method readSymlinks.

@Test
public void readSymlinks() throws Exception {
    String root = ResourceExtractor.simpleExtractResources(getClass(), ROOT).getAbsolutePath();
    File link = new File(root + "/symlinks/src/main/java");
    File link2 = new File(root + "/symlinks/src/test/java");
    createSymLink(root + "/multisources/src/main/java/", link.getAbsolutePath());
    createSymLink(root + "/multisources/src/test/java/", link2.getAbsolutePath());
    try {
        Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/symlinks");
        verifier.setDebug(true);
        verifier.executeGoal("test");
        verifier.verifyErrorFreeLog();
        String outputdir = verifier.getBasedir();
        verifier.assertFilePresent(outputdir + "/src/main/generated-sources/xtend/test/XtendA.java");
        verifier.assertFilePresent(outputdir + "/src/main/generated-sources/xtend/test/XtendC.java");
        verifier.assertFilePresent(outputdir + "/src/main/generated-sources/xtend/test/.XtendA.java._trace");
        verifier.assertFilePresent(outputdir + "/src/main/generated-sources/xtend/test/.XtendC.java._trace");
        verifier.assertFilePresent(outputdir + "/src/test/generated-sources/xtend/foo/FooClass.java");
        verifier.assertFilePresent(outputdir + "/src/test/generated-sources/xtend/foo/FooTest.java");
        verifier.assertFilePresent(outputdir + "/src/test/generated-sources/xtend/foo/.FooClass.java._trace");
        verifier.assertFilePresent(outputdir + "/src/test/generated-sources/xtend/foo/.FooTest.java._trace");
    } finally {
        link.delete();
        link2.delete();
    }
}
Also used : Verifier(org.apache.maven.it.Verifier) File(java.io.File) Test(org.junit.Test)

Example 35 with Verifier

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

the class XtendCompilerMojoIT method readXtendPrefsUnused.

@Test
public void readXtendPrefsUnused() throws Exception {
    Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/xtend-prefs-unused");
    verifier.setDebug(true);
    verifier.executeGoal("test");
    verifier.verifyErrorFreeLog();
    String pomsOutputDir = "xtend-dir-from-pom";
    String xtendGenDir = verifier.getBasedir() + "/src/main/" + pomsOutputDir;
    verifier.assertFilePresent(xtendGenDir + "/test/XtendA.java");
    verifier.assertFilePresent(xtendGenDir + "/test/XtendC.java");
    String xtendTestGenDir = verifier.getBasedir() + "/src/test/" + pomsOutputDir;
    verifier.assertFilePresent(xtendTestGenDir + "/tests/XtendA.java");
    verifier.assertFilePresent(xtendTestGenDir + "/tests/XtendC.java");
}
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