From 86b16396c26e87959612d355c14f43e97700da84 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 23 Jul 2008 07:08:49 +0000 Subject: [PATCH] get ready to support 2.1-SNAPSHOT, but disable for now git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@679007 13f79535-47bb-0310-9956-ffa450edef68 --- .../MavenITmng3652UserAgentHeader.java | 11 ++++++----- .../java/org/apache/maven/its/mng3652/MyMojo.java | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3652UserAgentHeader.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3652UserAgentHeader.java index c04eca4360..539cc82ff4 100644 --- a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3652UserAgentHeader.java +++ b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3652UserAgentHeader.java @@ -23,8 +23,10 @@ public class MavenITmng3652UserAgentHeader public MavenITmng3652UserAgentHeader() throws InvalidVersionSpecificationException { + // TODO: fix support for this in 2.1-SNAPSHOT // 2.0.10+ - super( "(2.0.9,)" ); + //super( "(2.0.9,)" ); + super( "(2.0.9,2.1-SNAPSHOT)" ); } /** @@ -75,10 +77,9 @@ public class MavenITmng3652UserAgentHeader String os = (String) lines.get( 2 ) + " " + (String) lines.get( 3 ); String artifactVersion = (String) lines.get( 4 ); - assertEquals( "Apache-Maven/" + mavenVersion + " maven-artifact/" + artifactVersion + " (Java " + javaVersion + "; " + os + ")", userAgent ); + assertEquals( "Comparing User-Agent '" + userAgent + "'", "Apache-Maven/" + mavenVersion + " maven-artifact/" + artifactVersion + " (Java " + javaVersion + "; " + os + ")", userAgent ); // test webdav - cliOptions = new ArrayList(); cliOptions.add( "-DtestPort=" + port ); cliOptions.add( "-DtestProtocol=dav:http" ); @@ -90,7 +91,7 @@ public class MavenITmng3652UserAgentHeader userAgent = s.userAgent; assertNotNull( userAgent ); - assertEquals( "Apache-Maven/" + mavenVersion + " maven-artifact/" + artifactVersion + " (Java " + javaVersion + "; " + os + ")", userAgent ); + assertEquals( "Comparing User-Agent '" + userAgent + "'", "Apache-Maven/" + mavenVersion + " maven-artifact/" + artifactVersion + " (Java " + javaVersion + "; " + os + ")", userAgent ); // test settings with no config @@ -106,7 +107,7 @@ public class MavenITmng3652UserAgentHeader userAgent = s.userAgent; assertNotNull( userAgent ); - assertEquals( "Apache-Maven/" + mavenVersion + " maven-artifact/" + artifactVersion + " (Java " + javaVersion + "; " + os + ")", userAgent ); + assertEquals( "Comparing User-Agent '" + userAgent + "'", "Apache-Maven/" + mavenVersion + " maven-artifact/" + artifactVersion + " (Java " + javaVersion + "; " + os + ")", userAgent ); // test settings with config diff --git a/its/core-integration-tests/src/test/resources/mng-3652-user-agent/test-plugin/src/main/java/org/apache/maven/its/mng3652/MyMojo.java b/its/core-integration-tests/src/test/resources/mng-3652-user-agent/test-plugin/src/main/java/org/apache/maven/its/mng3652/MyMojo.java index 9a4b2222e5..1aa011b98b 100644 --- a/its/core-integration-tests/src/test/resources/mng-3652-user-agent/test-plugin/src/main/java/org/apache/maven/its/mng3652/MyMojo.java +++ b/its/core-integration-tests/src/test/resources/mng-3652-user-agent/test-plugin/src/main/java/org/apache/maven/its/mng3652/MyMojo.java @@ -120,6 +120,10 @@ public class MyMojo { Properties properties = new Properties(); resourceAsStream = getClass().getClassLoader().getResourceAsStream( "META-INF/maven/org.apache.maven/maven-artifact/pom.properties" ); + if ( resourceAsStream == null ) + { + resourceAsStream = getClass().getClassLoader().getResourceAsStream( "META-INF/maven/org.apache.maven.artifact/maven-artifact/pom.properties" ); + } properties.load( resourceAsStream ); artifactVersion = properties.getProperty( "version" );