Search in sources :

Example 11 with Verifier

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

the class XtendCompilerMojoIT method encoding.

@Test
public void encoding() throws Exception {
    Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/encoding");
    String xtendDir = verifier.getBasedir() + "/src/main/java";
    assertFileContainsUTF16(verifier, xtendDir + "/test/XtendA.xtend", "M�hlheim-K�rlicher B�rger");
    verifier.setDebug(true);
    verifier.executeGoal("test");
    verifier.verifyErrorFreeLog();
    String gen = verifier.getBasedir() + "/src/main/generated-sources/xtend/test/XtendA.java";
    assertFileContainsUTF16(verifier, gen, "M�hlheim-K�rlicher B�rger");
    assertFileContainsUTF16(verifier, gen, "_builder.append(\"m�chte meine \");");
    assertFileContainsUTF16(verifier, gen, "_builder.append(\"t�r �len\");");
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 12 with Verifier

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

the class XtendCompilerMojoIT method suppressWarningsAnnotation.

@Test
public void suppressWarningsAnnotation() throws Exception {
    Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/suppress_warnings_annotation");
    System.out.println(verifier.getLogFileName());
    verifier.setDebug(true);
    verifier.executeGoal("test");
    verifier.verifyErrorFreeLog();
    String outputdir = verifier.getBasedir() + "/";
    assertFileDoesNotContain(verifier, outputdir + "src/main/generated-sources/xtend/test/XtendA.java", "@SuppressWarnings");
    assertFileDoesNotContain(verifier, outputdir + "src/test/generated-sources/xtend/test/XtendB.java", "@SuppressWarnings");
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 13 with Verifier

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

the class XtendCompilerMojoIT method continueOnXtendWarnings.

@Test
public void continueOnXtendWarnings() throws Exception {
    Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/xtendwarnings");
    verifier.executeGoal("verify");
    verifier.verifyTextInLog("3: The import 'java.util.Collections' is never used.");
    verifier.verifyTextInLog("[INFO] BUILD SUCCESS");
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 14 with Verifier

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

the class XtendCompilerMojoIT method readXtendPrefs.

@Test
public void readXtendPrefs() throws Exception {
    Verifier verifier = MavenVerifierUtil.newVerifier(ROOT + "/xtend-prefs");
    verifier.setDebug(true);
    verifier.executeGoal("test");
    verifier.verifyErrorFreeLog();
    String xtendOutputDirFromPrefs = "generated-sources/xtend-from-pref";
    String xtendGenDir = verifier.getBasedir() + "/src/main/" + xtendOutputDirFromPrefs;
    verifier.assertFilePresent(xtendGenDir + "/test/XtendA.java");
    verifier.assertFilePresent(xtendGenDir + "/test/XtendC.java");
    String xtendTestGenDir = verifier.getBasedir() + "/src/test/" + xtendOutputDirFromPrefs;
    verifier.assertFilePresent(xtendTestGenDir + "/tests/XtendA.java");
    verifier.assertFilePresent(xtendTestGenDir + "/tests/XtendC.java");
}
Also used : Verifier(org.apache.maven.it.Verifier) Test(org.junit.Test)

Example 15 with Verifier

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

the class XtendCompilerMojoIT method verifyErrorFreeLog.

private void verifyErrorFreeLog(String pathToTestProject, String goal) throws IOException, VerificationException {
    Verifier verifier = MavenVerifierUtil.newVerifier(pathToTestProject);
    verifier.executeGoal(goal);
    verifier.verifyErrorFreeLog();
    verifier.resetStreams();
}
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