org.apache.maven.it.VerificationException Java Examples
The following examples show how to use
org.apache.maven.it.VerificationException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StartStopMojoIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testWithMainClass() throws IOException, VerificationException { if (isCoverage()) { System.out.println("Test skipped in coverage"); return; } File testDir = initProject(ROOT_MAIN); assertThat(testDir).isDirectory(); initVerifier(testDir); verifier.displayStreamBuffers(); prepareProject(testDir, verifier); runPackage(verifier); runStart(verifier); String response = getHttpResponse(); assertThat(response).isEqualTo("bonjour"); }
Example #2
Source File: DeployMojoIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testDeployFlexible() throws IOException, VerificationException, CloudSdkNotFoundException, ProcessHandlerException { Verifier verifier = new FlexibleVerifier("testDeployFlexible"); // execute with staging directory not present verifier.executeGoal("package"); verifier.executeGoal("appengine:deploy"); // verify verifier.verifyErrorFreeLog(); verifier.verifyTextInLog("Detected App Engine flexible environment application"); verifier.verifyTextInLog("GCLOUD: Deployed service"); // verify debugger required file generation verifier.assertFilePresent( "target/flexible-project-1.0-SNAPSHOT/WEB-INF/classes/" + "source-context.json"); // cleanup deleteService("flexible-project"); }
Example #3
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testProjectGenerationFromEmptyPomWithDependencies() throws VerificationException, IOException { testDir = initProject("projects/simple-pom-it", "projects/project-generation-from-empty-pom-with-dependencies"); assertThat(testDir).isDirectory(); initVerifier(testDir); setup(verifier, "-DprojectGroupId=org.acme", "-DprojectArtifactId=acme", "-Dverticle=org.acme.MyVerticle.java", "-Ddependencies=vertx-web,jmx,missing"); assertThat(new File(testDir, "pom.xml")).isFile(); assertThat(FileUtils.readFileToString(new File(testDir, "pom.xml"), "UTF-8")) .contains("vertx-core", "vertx-maven-plugin", "<vertx.verticle>org.acme.MyVerticle</vertx.verticle>") .contains("vertx-web", "vertx-dropwizard-metrics").doesNotContain("missing"); assertThat(new File(testDir, "src/main/java")).isDirectory(); assertThat(new File(testDir, "src/main/java/org/acme/MyVerticle.java")).isFile(); }
Example #4
Source File: StopMojoIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testStopStandard() throws IOException, VerificationException, InterruptedException { Verifier verifier = new StandardVerifier("testStopStandard_start"); verifier.setSystemProperty("app.devserver.port", Integer.toString(serverPort)); // start dev app server verifier.executeGoals(Arrays.asList("package", "appengine:start")); // verify dev app server is up verifier.verifyErrorFreeLog(); assertNotNull(UrlUtils.getUrlContentWithRetries(getServerUrl(), 60000, 100)); // stop dev app server verifier.setLogFileName("testStopStandard.txt"); verifier.setAutoclean(false); verifier.executeGoal("appengine:stop"); // verify dev app server is down verifier.verifyErrorFreeLog(); // wait up to 5 seconds for the server to stop assertTrue(UrlUtils.isUrlDownWithRetries(getServerUrl(), 5000, 100)); }
Example #5
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testProjectGenerationFromScratchWithCustomDependencies() throws VerificationException, IOException { testDir = initEmptyProject("projects/project-generation-with-verticle-and-custom-deps"); assertThat(testDir).isDirectory(); initVerifier(testDir); setup(verifier, "-DprojectGroupId=org.acme", "-DprojectArtifactId=acme", "-Dverticle=org.acme.MyVerticle.java", "-Ddependencies=io.vertx:codetrans,commons-io:commons-io:2.5,io" + ".vertx:vertx-template-engines:3.4.1:shaded"); assertThat(new File(testDir, "pom.xml")).isFile(); assertThat(new File(testDir, "src/main/java")).isDirectory(); assertThat(new File(testDir, "src/main/java/org/acme/MyVerticle.java")).isFile(); assertThat(FileUtils.readFileToString(new File(testDir, "pom.xml"), "UTF-8")) .contains("<artifactId>codetrans</artifactId>") .contains("<artifactId>commons-io</artifactId>", "<version>2.5</version>", "<groupId>commons-io</groupId>") .contains("<artifactId>vertx-template-engines</artifactId>", "<version>3.4.1</version>", "<classifier>shaded</classifier>");; }
Example #6
Source File: StartStopMojoIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testWithMainClassInExplodedMode() throws IOException, VerificationException { if (isCoverage()) { System.out.println("Test skipped in coverage"); return; } File testDir = initProject(ROOT_MAIN_EXPLODED); assertThat(testDir).isDirectory(); initVerifier(testDir); prepareProject(testDir, verifier); runPackage(verifier); runStart(verifier); String response = getHttpResponse(); assertThat(response).isEqualTo("hello"); }
Example #7
Source File: DeployAllMojoIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testDeployAllStandard() throws IOException, VerificationException, CloudSdkNotFoundException, ProcessHandlerException { Verifier verifier = new StandardVerifier("testDeployStandard"); // execute with staging directory not present verifier.executeGoals(Arrays.asList("package", "appengine:deployAll")); // verify verifier.verifyErrorFreeLog(); verifier.verifyTextInLog("Detected App Engine standard environment application"); verifier.verifyTextInLog("GCLOUD: Deployed service"); verifier.verifyTextInLog("GCLOUD: Custom routings have been updated."); verifier.verifyTextInLog("GCLOUD: DoS protection has been updated."); verifier.verifyTextInLog("GCLOUD: Indexes are being rebuilt. This may take a moment."); verifier.verifyTextInLog("GCLOUD: Cron jobs have been updated."); verifier.verifyTextInLog("GCLOUD: Task queues have been updated."); // cleanup deleteService("standard-project"); }
Example #8
Source File: StartStopMojoIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testWithCustomLauncherInExplodedMode() throws IOException, VerificationException { if (isCoverage()) { System.out.println("Test skipped in coverage"); return; } File testDir = initProject(ROOT_CUSTOM_EXPLODED); assertThat(testDir).isDirectory(); initVerifier(testDir); prepareProject(testDir, verifier); runPackage(verifier); runStart(verifier); String response = getHttpResponse(); assertThat(response).isEqualTo("hello"); }
Example #9
Source File: StartStopMojoIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testInExplodedMode() throws IOException, VerificationException { if (isCoverage()) { System.out.println("Test skipped in coverage"); return; } File testDir = initProject(ROOT_EXPLODED); assertThat(testDir).isDirectory(); initVerifier(testDir); prepareProject(testDir, verifier); runPackage(verifier); runStart(verifier); String response = getHttpResponse(); assertThat(response).isEqualTo("guten tag"); }
Example #10
Source File: ExtraManifestInfoIT.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
public void testSVNSCM() throws IOException, VerificationException { File testDir = initProject(SVN_PROJECT_ROOT); assertThat(testDir).isDirectory(); initVerifier(testDir); prepareProject(testDir, verifier); assertThat(testDir).isNotNull(); assertThat(testDir.getName()).endsWith("manifest-svn-it"); //Since SVN is a centralized repo the SCM provider will always get the change log from remote only // we dont need to check for any local commits runPackage(verifier); assertManifest(testDir, "svn"); }
Example #11
Source File: RunIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
private void run(Verifier verifier, String ... previous) throws VerificationException { verifier.setLogFileName("build-run.log"); ImmutableList.Builder<String> builder = ImmutableList.builder(); builder.add(previous); builder.add("vertx:run"); verifier.executeGoals(builder.build(), getEnv()); }
Example #12
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
private void initVerifier(File root) throws VerificationException { verifier = new Verifier(root.getAbsolutePath()); verifier.setAutoclean(false); verifier.setDebug(true); verifier.setForkJvm(true); verifier.setMavenDebug(true); installPluginToLocalRepository(verifier.getLocalRepository()); }
Example #13
Source File: StartStopMojoIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@After public void waitForStop() { try { runStop(verifier); } catch (VerificationException | IOException e) { e.printStackTrace(); } verifier.resetStreams(); awaitUntilServerDown(); }
Example #14
Source File: AbstractSingleYamlDeployIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testDeployFlexible() throws IOException, VerificationException { Verifier verifier = new FlexibleVerifier("testDeployFlexible"); // execute with staging directory not present verifier.executeGoals(Arrays.asList("package", "appengine:" + getDeployGoal())); // verify verifier.verifyErrorFreeLog(); verifier.verifyTextInLog("Detected App Engine flexible environment application"); verifier.verifyTextInLog("GCLOUD: " + getExpectedLogMessage()); }
Example #15
Source File: RunIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
private void initVerifier(File root) throws VerificationException { verifier = new RunningVerifier(root.getAbsolutePath()); verifier.setAutoclean(false); verifier.setDebug(true); verifier.setForkJvm(true); verifier.setMavenDebug(true); installPluginToLocalRepository(verifier.getLocalRepository()); }
Example #16
Source File: AbstractMojoIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 5 votes |
@BeforeClass public static void installPlugin() throws VerificationException { // install the plugin under test if (!doneInstallPlugin) { TailingVerifier verifier = new TailingVerifier("installPlugin", "."); verifier.addCliOption("-DskipTests"); verifier.executeGoal("install"); doneInstallPlugin = true; } }
Example #17
Source File: MinikubeVerifier.java From minikube-build-tools-for-java with Apache License 2.0 | 5 votes |
/** Verifies execution of the goal produces the correct fakeminikube output. */ void verify(String goal, String expectedOutput) throws IOException, VerificationException { if (profile != null) { verifier.setCliOptions(Collections.singletonList("-P" + profile)); } verifier.executeGoal("minikube:" + goal); verifier.verifyErrorFreeLog(); String fakeMinikubeOutput = new String( Files.readAllBytes(Paths.get(verifier.getBasedir()).resolve("fakeminikube.log")), StandardCharsets.UTF_8); Assert.assertEquals(expectedOutput, fakeMinikubeOutput); }
Example #18
Source File: RunAsyncMojoIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testRunAsync() throws IOException, VerificationException, InterruptedException { String testName = "testRunAsync"; try { Verifier verifier = createVerifier(testName); verifier.setSystemProperty("app.devserver.startSuccessTimeout", "60"); verifier.executeGoals(Arrays.asList("package", "appengine:start")); String urlContent = UrlUtils.getUrlContentWithRetries(getServerUrl(), 60000, 1000); assertThat(urlContent, containsString("Hello from the App Engine Standard project.")); assertThat(urlContent, containsString("TEST_VAR=testVariableValue")); Path expectedLog = Paths.get( "target", "test-classes", "projects", "standard-project", "target", "dev-appserver-out", "dev_appserver.out"); assertTrue(Files.exists(expectedLog)); String devAppServerOutput = new String(Files.readAllBytes(expectedLog), StandardCharsets.UTF_8); assertTrue(devAppServerOutput.contains(DEV_APP_SERVER_STARTED)); verifier.verifyErrorFreeLog(); verifier.verifyTextInLog(DEV_APP_SERVER_STARTED); } finally { Verifier stopVerifier = createVerifier(testName + "_stop"); stopVerifier.executeGoal("appengine:stop"); // wait up to 5 seconds for the server to stop assertTrue(UrlUtils.isUrlDownWithRetries(getServerUrl(), 5000, 100)); } }
Example #19
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testProjectGenerationFromEmptyPomWithVerticle() throws VerificationException, IOException { testDir = initProject("projects/simple-pom-it", "projects/project-generation-from-empty-pom-with-verticle"); assertThat(testDir).isDirectory(); initVerifier(testDir); setup(verifier, "-DprojectGroupId=org.acme", "-DprojectArtifactId=acme", "-Dverticle=org.acme.MyVerticle.java"); assertThat(new File(testDir, "pom.xml")).isFile(); assertThat(FileUtils.readFileToString(new File(testDir, "pom.xml"), "UTF-8")) .contains("vertx-core", "vertx-maven-plugin", "<vertx.verticle>org.acme.MyVerticle</vertx.verticle>"); assertThat(new File(testDir, "src/main/java")).isDirectory(); assertThat(new File(testDir, "src/main/java/org/acme/MyVerticle.java")).isFile(); }
Example #20
Source File: RedeployIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
private void run(Verifier verifier, String... previous) throws VerificationException { verifier.setLogFileName("build-run.log"); ImmutableList.Builder<String> builder = ImmutableList.builder(); builder.add(previous); builder.add("vertx:run"); verifier.executeGoals(builder.build(), getEnv()); }
Example #21
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testProjectGenerationFromScratch() throws VerificationException { testDir = initEmptyProject("projects/project-generation"); assertThat(testDir).isDirectory(); initVerifier(testDir); setup(verifier, "-DprojectGroupId=org.acme", "-DprojectArtifactId=acme"); assertThat(new File(testDir, "pom.xml")).isFile(); assertThat(new File(testDir, "src/main/java")).isDirectory(); }
Example #22
Source File: ExtraManifestInfoIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testGITSCM() throws IOException, VerificationException, GitAPIException { File testDir = initProject(GIT_PROJECT_ROOT); assertThat(testDir).isDirectory(); initVerifier(testDir); prepareProject(testDir, verifier); File gitFolder = GitUtil.findGitFolder(testDir); assertThat(testDir).isNotNull(); assertThat(testDir.getName()).endsWith("manifest-git-it"); assertThat(gitFolder).isNull(); Git git = prepareGitSCM(testDir, verifier); gitFolder = git.getRepository().getDirectory(); assertThat(gitFolder.getParentFile().getName()).isEqualTo(testDir.getName()); assertThat(git.status().call().getUntracked()).contains("pom.xml", "src/main/java/demo/SimpleVerticle.java"); //Now add and commit the file DirCache index = git.add().addFilepattern(".").call(); assertThat(index.getEntryCount()).isEqualTo(2); git.commit().setMessage("First Import").call(); runPackage(verifier); assertManifest(testDir, "git"); }
Example #23
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testProjectGenerationFromScratchWithVerticle() throws VerificationException { testDir = initEmptyProject("projects/project-generation-with-verticle"); assertThat(testDir).isDirectory(); initVerifier(testDir); setup(verifier, "-DprojectGroupId=org.acme", "-DprojectArtifactId=acme", "-Dverticle=org.acme.MyVerticle.java"); assertThat(new File(testDir, "pom.xml")).isFile(); assertThat(new File(testDir, "src/main/java")).isDirectory(); assertThat(new File(testDir, "src/main/java/org/acme/MyVerticle.java")).isFile(); }
Example #24
Source File: RedeployIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
private void initVerifier(File root) throws VerificationException { verifier = new RunningVerifier(root.getAbsolutePath()); verifier.setAutoclean(false); verifier.setDebug(true); verifier.setForkJvm(true); verifier.setMavenDebug(true); installPluginToLocalRepository(verifier.getLocalRepository()); }
Example #25
Source File: MinikubeVerifier.java From minikube-build-tools-for-java with Apache License 2.0 | 5 votes |
/** Sets up the a verifier on the {@link TestProject}. */ MinikubeVerifier(TestProject testProject) throws VerificationException, IOException, URISyntaxException { // Sets the minikube executable to fakeminikube. testProject.replaceInPom("@@MinikubePath@@", FakeMinikube.getPath().toString()); verifier = new Verifier(testProject.getProjectRoot().toString()); verifier.setAutoclean(false); }
Example #26
Source File: StandardVerifier.java From app-maven-plugin with Apache License 2.0 | 5 votes |
public StandardVerifier(String testName) throws IOException, VerificationException { super( testName, ResourceExtractor.simpleExtractResources( StandardVerifier.class, "/projects/standard-project") .getAbsolutePath()); }
Example #27
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
private void setup(Verifier verifier, String... params) throws VerificationException { verifier.setLogFileName("build-setup.log"); ImmutableList.Builder<String> builder = ImmutableList.builder(); builder.add("io.reactiverse:vertx-maven-plugin:" + VertxMojoTestBase.VERSION + ":setup"); for (String p : params) { builder.add(p); } verifier.executeGoals(builder.build(), getEnv()); }
Example #28
Source File: GenRepoInfoFileMojoIntegrationTest.java From app-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testGenerate() throws IOException, VerificationException { Verifier verifier = new StandardVerifier("testGenRepoInfoFile"); verifier.executeGoal("appengine:genRepoInfoFile"); verifier.assertFilePresent("target/appengine-staging/WEB-INF/classes/source-context.json"); }
Example #29
Source File: MavenPluginMigrationTest.java From thorntail with Apache License 2.0 | 5 votes |
private void migrateProjectFromWildFlySwarmToThorntail() throws IOException, VerificationException { String thorntailVersion = System.getProperty("project.version"); String goal = "io.thorntail:thorntail-maven-plugin:" + thorntailVersion + ":migrate-from-wildfly-swarm"; verifier.setSystemProperty("targetVersion", "2.0.0.Final"); // hardcoded in expected-pom.xml verifier.executeGoal(goal); String log = new String(Files.readAllBytes(logPath), StandardCharsets.UTF_8); assertThat(log).contains("Upgrading to Thorntail 2.0.0.Final"); assertThat(log).contains(slashes("./pom.xml: migrate dependency exclusion on org.wildfly.swarm:cdi-config at dependency org.wildfly.swarm:cdi")); assertThat(log).contains(slashes("./pom.xml: migrate dependency exclusion on org.wildfly.swarm:datasources at dependency org.wildfly.swarm:jpa of pluginManagement org.wildfly.swarm:wildfly-swarm-plugin in profile my-profile")); assertThat(log).contains(slashes("./pom.xml: migrate dependency exclusion on org.wildfly.swarm:spi at dependency org.wildfly.swarm:management-console of plugin org.apache.maven.plugins:maven-failsafe-plugin")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:cdi (target version: 2.0.0.Final)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:jaxrs (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:jpa of pluginManagement org.wildfly.swarm:wildfly-swarm-plugin in profile my-profile (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:jsf in profile my-profile (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:logging of plugin org.wildfly.swarm:wildfly-swarm-plugin in profile my-profile (target version: 2.0.0.Final)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:management of plugin org.apache.maven.plugins:maven-failsafe-plugin (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:management-console of plugin org.apache.maven.plugins:maven-failsafe-plugin (target version: 2.0.0.Final)")); assertThat(log).contains(slashes("./pom.xml: migrate dependency org.wildfly.swarm:undertow (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate dependencyManagement org.wildfly.swarm:bean-validation in profile my-profile (target version: 2.0.0.Final)")); assertThat(log).contains(slashes("./pom.xml: migrate dependencyManagement org.wildfly.swarm:bom (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate plugin org.wildfly.swarm:wildfly-swarm-plugin (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate plugin org.wildfly.swarm:wildfly-swarm-plugin in profile my-profile (target version: null)")); assertThat(log).contains(slashes("./pom.xml: migrate pluginManagement org.wildfly.swarm:wildfly-swarm-plugin in profile my-profile (target version: null)")); assertThat(log).contains("migrate version property version.org.wildfly.swarm to value 2.0.0.Final"); assertThat(log).contains("migrate version property version.wildfly-swarm to value 2.0.0.Final"); assertThat(log).doesNotContain("[ERROR]"); assertThat(log).doesNotContain("[WARNING]"); assertThat(log).contains("BUILD SUCCESS"); }
Example #30
Source File: SetupIT.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testProjectGenerationFromEmptyPomWithVerticle() throws VerificationException, IOException { testDir = initProject("projects/simple-pom-it", "projects/project-generation-from-empty-pom-with-verticle"); assertThat(testDir).isDirectory(); initVerifier(testDir); setup(verifier, "-DprojectGroupId=org.acme", "-DprojectArtifactId=acme", "-Dverticle=org.acme.MyVerticle.java"); assertThat(new File(testDir, "pom.xml")).isFile(); assertThat(FileUtils.readFileToString(new File(testDir, "pom.xml"), "UTF-8")) .contains("vertx-core", "vertx-maven-plugin", "<vertx.verticle>org.acme.MyVerticle</vertx.verticle>"); assertThat(new File(testDir, "src/main/java")).isDirectory(); assertThat(new File(testDir, "src/main/java/org/acme/MyVerticle.java")).isFile(); }