use of org.apache.maven.it.Verifier in project maven-plugins by apache.
the class IT_CustomFilterDelimiter method test.
public void test() throws IOException, URISyntaxException, VerificationException {
File dir = TestUtils.getTestDir("custom-filter-delim");
Verifier verifier = new Verifier(dir.getAbsolutePath());
verifier.getCliOptions().add("-X");
verifier.executeGoal("validate");
verifier.verifyErrorFreeLog();
verifier.resetStreams();
File output = new File(dir, "target/maven-shared-archive-resources/DEPENDENCIES");
String content = FileUtils.fileRead(output);
assertTrue(content.contains("Override: custom-filter-delim"));
}
use of org.apache.maven.it.Verifier in project maven-plugins by apache.
the class IT_FilterLocalOverride method test.
public void test() throws IOException, URISyntaxException, VerificationException {
File dir = TestUtils.getTestDir("filter-local-override");
Verifier verifier = new Verifier(dir.getAbsolutePath());
verifier.executeGoal("generate-resources");
verifier.verifyErrorFreeLog();
verifier.resetStreams();
File output = new File(dir, "target/maven-shared-archive-resources/DEPENDENCIES");
String content = FileUtils.fileRead(output);
assertTrue(content.contains("Override: filter-local-override"));
}
use of org.apache.maven.it.Verifier in project maven-plugins by apache.
the class IT_GenerateFromBundleWithTypeAndClassifier method test.
public void test() throws IOException, URISyntaxException, VerificationException {
File dir = TestUtils.getTestDir("generate-from-bundle-with-type-and-classifier");
Verifier verifier = new Verifier(dir.getAbsolutePath());
verifier.executeGoal("generate-resources");
verifier.verifyErrorFreeLog();
verifier.resetStreams();
File output = new File(dir, "target/maven-shared-archive-resources/DEPENDENCIES");
String content = FileUtils.fileRead(output);
assertTrue(content.contains("Built-In:"));
}
use of org.apache.maven.it.Verifier in project maven-plugins by apache.
the class IT_GenerateFromOverride method test.
public void test() throws IOException, URISyntaxException, VerificationException {
File dir = TestUtils.getTestDir("generate-from-override");
Verifier verifier = new Verifier(dir.getAbsolutePath());
verifier.executeGoal("generate-resources");
verifier.verifyErrorFreeLog();
verifier.resetStreams();
File output = new File(dir, "target/maven-shared-archive-resources/DEPENDENCIES");
String content = FileUtils.fileRead(output);
assertTrue(content.contains("Override:"));
}
use of org.apache.maven.it.Verifier in project maven-plugins by apache.
the class IT_GetDependencyProjects method test.
public void test() throws IOException, URISyntaxException, VerificationException {
File dir = TestUtils.getTestDir("get-dependency-projects");
Verifier verifier;
verifier = new Verifier(dir.getAbsolutePath());
verifier.executeGoal("deploy");
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier = new Verifier(new File(dir, "project").getAbsolutePath());
verifier.deleteArtifacts("org.apache.maven.plugin.rresource.it.gdp");
try {
verifier.executeGoal("generate-resources");
} catch (VerificationException e) {
verifier.resetStreams();
// We will get an exception from harness in case
// of execution failure (return code non zero).
// This is the case if we have missing artifacts
// as in this test case.
// This means we can't test the created file which will never
// contain the appropriate data we wan't to check for.
// So the only reliable way is to check the log output
// from maven which will print out message according to
// the missing artifacts.
File output = new File(verifier.getBasedir(), "log.txt");
String content = FileUtils.fileRead(output);
assertTrue(content.contains("mvn install:install-file -DgroupId=org.apache.maven.plugin.rresource.it.gdp -DartifactId=release -Dversion=1.0 -Dpackaging=jar"));
assertTrue(content.contains("mvn install:install-file -DgroupId=org.apache.maven.plugin.rresource.it.gdp -DartifactId=snapshot -Dversion=1.0-SNAPSHOT -Dpackaging=jar"));
}
}
Aggregations