From 9974e8676d6db1442c543bd4d068664c733e3d83 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 13 Mar 2009 17:40:53 +0000 Subject: [PATCH] o Moved repository declarations to settings git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@753324 13f79535-47bb-0310-9956-ffa450edef68 --- ...seCachedMetadataOfBlacklistedRepoTest.java | 17 ++++-- .../mng-3139/{pom-template.xml => pom.xml} | 15 ------ .../resources/mng-3139/settings-template.xml | 53 +++++++++++++++++++ 3 files changed, 67 insertions(+), 18 deletions(-) rename its/core-it-suite/src/test/resources/mng-3139/{pom-template.xml => pom.xml} (83%) create mode 100644 its/core-it-suite/src/test/resources/mng-3139/settings-template.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java index 4f682c42e2..85993d0260 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest.java @@ -48,21 +48,32 @@ public class MavenITmng3139UseCachedMetadataOfBlacklistedRepoTest { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3139" ); + // phase 1: get the metadata into the local repo + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); verifier.setAutoclean( false ); verifier.deleteArtifacts( "org.apache.maven.its.mng3139" ); - verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); verifier.setLogFileName( "log1.txt" ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings.xml" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); + verifier.resetStreams(); - verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", + // phase 2: trigger blacklisting of repo (by invalid URL) and check previously downloaded metadata is stil used + + verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", Collections.singletonMap( "@baseurl@", "http://localhost:63412" ) ); verifier.setLogFileName( "log2.txt" ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings.xml" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); - verifier.resetStreams(); } diff --git a/its/core-it-suite/src/test/resources/mng-3139/pom-template.xml b/its/core-it-suite/src/test/resources/mng-3139/pom.xml similarity index 83% rename from its/core-it-suite/src/test/resources/mng-3139/pom-template.xml rename to its/core-it-suite/src/test/resources/mng-3139/pom.xml index 992d9c8ef3..7d4126978c 100644 --- a/its/core-it-suite/src/test/resources/mng-3139/pom-template.xml +++ b/its/core-it-suite/src/test/resources/mng-3139/pom.xml @@ -32,21 +32,6 @@ under the License. Test that locally cached metadata of blacklisted repositories is consulted to resolve metaversions. - - - maven-core-it - @baseurl@/repo - - ignore - - always - - - false - - - - org.apache.maven.its.mng3139 diff --git a/its/core-it-suite/src/test/resources/mng-3139/settings-template.xml b/its/core-it-suite/src/test/resources/mng-3139/settings-template.xml new file mode 100644 index 0000000000..d327a854b1 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3139/settings-template.xml @@ -0,0 +1,53 @@ + + + + + + + + + central + @baseurl@/null + central + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/repo + + ignore + + always + + + false + + + + + + + maven-core-it-repo + +