Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,65 +103,59 @@ public void handle(

int port = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();

{
// phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.deleteArtifacts("org.apache.maven.its.mng0768");
verifier.setLogFileName("log1.txt");
Properties props = new Properties();
props.put("@port@", Integer.toString(port));
verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", props);
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();
}
// phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.deleteArtifacts("org.apache.maven.its.mng0768");
verifier.setLogFileName("log1.txt");
Properties props = new Properties();
props.put("@port@", Integer.toString(port));
verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", props);
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();

requestedUris.clear();

{
// phase 2: run build in offline mode to check it still passes, without network accesses
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.addCliArgument("-o");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.setLogFileName("log2.txt");
// phase 2: run build in offline mode to check it still passes, without network accesses
verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.addCliArgument("-o");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.setLogFileName("log2.txt");
verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();

assertTrue(requestedUris.toString(), requestedUris.isEmpty());

// phase 3: delete test artifact and run build in offline mode to check it fails now
// NOTE: Adding the settings again to offer Maven the bad choice of using the remote repo
verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.deleteArtifacts("org.apache.maven.its.mng0768");
verifier.addCliArgument("-o");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.setLogFileName("log3.txt");
try {
verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();
}

assertTrue(requestedUris.toString(), requestedUris.isEmpty());

{
// phase 3: delete test artifact and run build in offline mode to check it fails now
// NOTE: Adding the settings again to offer Maven the bad choice of using the remote repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.deleteArtifacts("org.apache.maven.its.mng0768");
verifier.addCliArgument("-o");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.setLogFileName("log3.txt");
try {
verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute();
verifier.verifyErrorFreeLog();
fail("Build did not fail to resolve missing dependency although Maven ought to work offline!");
} catch (VerificationException e) {
// expected, should fail
}
fail("Build did not fail to resolve missing dependency although Maven ought to work offline!");
} catch (VerificationException e) {
// expected, should fail
}

System.out.println("Bound server socket to the port " + port);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,33 @@ public MavenITmng2695OfflinePluginSnapshotsTest() {
public void testitMNG2695() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2695");

{
// phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory("target");
verifier.deleteArtifacts("org.apache.maven.its.mng2695");
verifier.setAutoclean(false);
verifier.setLogFileName("log1.txt");
verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/a.txt");
verifier.verifyFilePresent("target/b.txt");
verifier.verifyErrorFreeLog();
}
// phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory("target");
verifier.deleteArtifacts("org.apache.maven.its.mng2695");
verifier.setAutoclean(false);
verifier.setLogFileName("log1.txt");
verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/a.txt");
verifier.verifyFilePresent("target/b.txt");
verifier.verifyErrorFreeLog();

{
// phase 2: run build in offline mode to check it still passes
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory("target");
verifier.setAutoclean(false);
verifier.setLogFileName("log2.txt");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("--offline");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/a.txt");
verifier.verifyFilePresent("target/b.txt");
verifier.verifyErrorFreeLog();
}
// phase 2: run build in offline mode to check it still passes
verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteDirectory("target");
verifier.setAutoclean(false);
verifier.setLogFileName("log2.txt");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("--offline");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/a.txt");
verifier.verifyFilePresent("target/b.txt");
verifier.verifyErrorFreeLog();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public MavenITmng2739RequiredRepositoryElementsTest() {
}

@Test
public void testitMNG2739_RepositoryId() throws Exception {
public void testitMNG2739RepositoryId() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2739/repo-id");

Verifier verifier;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void testitMNG2739_RepositoryId() throws Exception {
}

@Test
public void testitMNG2739_RepositoryUrl() throws Exception {
public void testitMNG2739RepositoryUrl() throws Exception {
// The testdir is computed from the location of this
// file.
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-2739/repo-url");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,27 @@ public MavenITmng3314OfflineSnapshotsTest() {
public void testitMNG3314() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3314");

{
// phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteArtifacts("org.apache.maven.its.mng3314");
verifier.setLogFileName("log1.txt");
verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();
}
// phase 1: run build in online mode to fill local repo
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.deleteArtifacts("org.apache.maven.its.mng3314");
verifier.setLogFileName("log1.txt");
verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();

{
// phase 2: run build in offline mode to check it still passes
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.setLogFileName("log2.txt");
verifier.addCliArgument("-o");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();
}
// phase 2: run build in offline mode to check it still passes
verifier = newVerifier(testDir.getAbsolutePath());
verifier.setLogFileName("log2.txt");
verifier.addCliArgument("-o");
verifier.addCliArgument("--settings");
verifier.addCliArgument("settings.xml");
verifier.addCliArgument("validate");
verifier.execute();
verifier.verifyFilePresent("target/compile.txt");
verifier.verifyErrorFreeLog();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
class MavenITmng3477DependencyResolutionErrorMessageTest extends AbstractMavenIntegrationTestCase {

public MavenITmng3477DependencyResolutionErrorMessageTest() {
MavenITmng3477DependencyResolutionErrorMessageTest() {
super("[3.9.8,)");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public MavenITmng3535SelfReferentialPropertiesTest() {
}

@Test
public void testitMNG3535_ShouldSucceed() throws Exception {
public void testitMNG3535ShouldSucceed() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3535/success");

Verifier verifier = newVerifier(testDir.getAbsolutePath());
Expand All @@ -51,7 +51,7 @@ public void testitMNG3535_ShouldSucceed() throws Exception {
}

@Test
public void testitMNG3535_ShouldFail() throws Exception {
public void testitMNG3535ShouldFail() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3535/failure");

Verifier verifier = newVerifier(testDir.getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected void tearDown() throws Exception {
* @throws Exception in case of failure
*/
@Test
public void testmng3652_UnConfiguredHttp() throws Exception {
public void testmng3652UnConfiguredHttp() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652");
File pluginDir = new File(testDir, "test-plugin");
File projectDir = new File(testDir, "test-project");
Expand Down Expand Up @@ -134,7 +134,6 @@ public void testmng3652_UnConfiguredHttp() throws Exception {
String mavenVersion = lines.get(0);
String javaVersion = lines.get(1);
String os = lines.get(2) + " " + lines.get(3);
String artifactVersion = lines.get(4);

assertEquals(
"Comparing User-Agent '" + userAgent + "'",
Expand All @@ -143,7 +142,7 @@ public void testmng3652_UnConfiguredHttp() throws Exception {
}

@Test
public void testmng3652_UnConfiguredDAV() throws Exception {
public void testmng3652UnConfiguredDAV() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652");
File pluginDir = new File(testDir, "test-plugin");
File projectDir = new File(testDir, "test-project");
Expand Down Expand Up @@ -176,7 +175,6 @@ public void testmng3652_UnConfiguredDAV() throws Exception {
String mavenVersion = lines.get(0);
String javaVersion = lines.get(1);
String os = lines.get(2) + " " + lines.get(3);
String artifactVersion = lines.get(4);

String userAgent = this.userAgent;
assertNotNull(userAgent);
Expand All @@ -188,7 +186,7 @@ public void testmng3652_UnConfiguredDAV() throws Exception {
}

@Test
public void testmng3652_ConfigurationInSettingsWithoutUserAgent() throws Exception {
public void testmng3652ConfigurationInSettingsWithoutUserAgent() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652");
File pluginDir = new File(testDir, "test-plugin");
File projectDir = new File(testDir, "test-project");
Expand Down Expand Up @@ -223,7 +221,6 @@ public void testmng3652_ConfigurationInSettingsWithoutUserAgent() throws Excepti
String mavenVersion = lines.get(0);
String javaVersion = lines.get(1);
String os = lines.get(2) + " " + lines.get(3);
String artifactVersion = lines.get(4);

String userAgent = this.userAgent;
assertNotNull(userAgent);
Expand All @@ -235,7 +232,7 @@ public void testmng3652_ConfigurationInSettingsWithoutUserAgent() throws Excepti
}

@Test
public void testmng3652_UserAgentConfiguredInSettings() throws Exception {
public void testmng3652UserAgentConfiguredInSettings() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652");
File pluginDir = new File(testDir, "test-plugin");
File projectDir = new File(testDir, "test-project");
Expand Down Expand Up @@ -267,7 +264,7 @@ public void testmng3652_UserAgentConfiguredInSettings() throws Exception {
}

@Test
public void testmng3652_AdditionnalHttpHeaderConfiguredInSettings() throws Exception {
public void testmng3652AdditionnalHttpHeaderConfiguredInSettings() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3652");
File pluginDir = new File(testDir, "test-plugin");
File projectDir = new File(testDir, "test-project");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public MavenITmng3710PollutedClonedPluginsTest() {
}

@Test
public void testitMNG3710_POMInheritance() throws Exception {
public void testitMNG3710POMInheritance() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3710/pom-inheritance");
File pluginDir = new File(testDir, "maven-mng3710-pomInheritance-plugin");
File projectsDir = new File(testDir, "projects");
Expand Down Expand Up @@ -69,7 +69,7 @@ public void testitMNG3710_POMInheritance() throws Exception {
}

@Test
public void testitMNG3710_OriginalModel() throws Exception {
public void testitMNG3710OriginalModel() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3710/original-model");
File pluginsDir = new File(testDir, "plugins");
File projectDir = new File(testDir, "project");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public MavenITmng3746POMPropertyOverrideTest() {
}

@Test
public void testitMNG3746_UsingDefaultSystemProperty() throws Exception {
public void testitMNG3746UsingDefaultSystemProperty() throws Exception {
// The testdir is computed from the location of this
// file.
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3746");
Expand All @@ -61,7 +61,7 @@ public void testitMNG3746_UsingDefaultSystemProperty() throws Exception {
}

@Test
public void testitMNG3746_UsingCLIProperty() throws Exception {
public void testitMNG3746UsingCLIProperty() throws Exception {
// The testdir is computed from the location of this
// file.
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3746");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public MavenITmng3843PomInheritanceTest() {
* @throws Exception in case of failure
*/
@Test
@SuppressWarnings("checkstyle:MethodLength")
public void testitMNG3843() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3843");

Expand Down
Loading
Loading