Author: bentmann
Date: Fri Oct 3 12:36:31 2008
New Revision: 701506
URL: http://svn.apache.org/viewvc?rev=701506&view=rev
Log:
o Decoupled it0043 from production plugin
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml
(with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml
(with props)
Removed:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/child1/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/child2/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/pom.xml
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0043Test.java
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0043Test.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0043Test.java?rev=701506&r1=701505&r2=701506&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0043Test.java
(original)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0043Test.java
Fri Oct 3 12:36:31 2008
@@ -23,6 +23,7 @@
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
+import java.util.Properties;
public class MavenIT0043Test
extends AbstractMavenIntegrationTestCase
@@ -36,22 +37,50 @@
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/it0043" );
- File child1 = new File( testDir, "child1" );
+ // Phase 1: Ensure the test plugin is downloaded before the test cuts
off access to central
+ File child1 = new File( testDir, "setup" );
Verifier verifier = new Verifier( child1.getAbsolutePath() );
- verifier.deleteArtifact( "org.apache.maven.plugins",
"maven-help-plugin", "2.0.2", "jar" );
-
- verifier.executeGoal(
"org.apache.maven.plugins:maven-help-plugin:2.0.2:effective-pom" );
+ verifier.executeGoal(
"org.apache.maven.its.plugins:maven-it-plugin-expression::eval" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
- File child2 = new File( testDir, "child2" );
+ // Phase 2: Now run the test
+ File child2 = new File( testDir, "test" );
verifier = new Verifier( child2.getAbsolutePath() );
- verifier.executeGoal(
"org.apache.maven.plugins:maven-help-plugin:2.0.2:effective-pom" );
+ Properties systemProperties = new Properties();
+ systemProperties.put( "expression.expressions",
"project/repositories,project/pluginRepositories" );
+ verifier.setSystemProperties( systemProperties );
+ verifier.executeGoal(
"org.apache.maven.its.plugins:maven-it-plugin-expression::eval" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
+ verifier.assertFilePresent( "target/expression.properties" );
+ Properties props = verifier.loadProperties(
"target/expression.properties" );
+
+ int count = Integer.parseInt( props.getProperty(
"project.repositories", "0" ) );
+ assertTrue( count > 0 );
+ for ( int i = 0; i < count; i++ )
+ {
+ String key = "project.repositories." + i;
+ if ( "central".equals( props.getProperty( key + ".id" ) ) )
+ {
+ assertEquals( "it0043", props.getProperty( key + ".name" ) );
+ assertTrue( props.getProperty( key + ".url" ).endsWith(
"/tmp/maven-core-it0043-repo" ) );
+ }
+ }
+
+ count = Integer.parseInt( props.getProperty(
"project.pluginRepositories", "0" ) );
+ for ( int i = 0; i < count; i++ )
+ {
+ String key = "project.pluginRepositories." + i;
+ if ( "central".equals( props.getProperty( key + ".id" ) ) )
+ {
+ assertEquals( "it0043", props.getProperty( key + ".name" ) );
+ assertTrue( props.getProperty( key + ".url" ).endsWith(
"/tmp/maven-core-it0043-repo" ) );
+ }
+ }
}
-}
+}
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml?rev=701506&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml
Fri Oct 3 12:36:31 2008
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.it0043</groupId>
+ <artifactId>maven-it-it0043</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>Maven Integration Test :: it0043 setup</name>
+ <description>Preparation project with non-overriden URL to central for
plugin download.</description>
+</project>
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/setup/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml?rev=701506&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml
Fri Oct 3 12:36:31 2008
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.it0043</groupId>
+ <artifactId>maven-it-it0043</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>Maven Integration Test :: it0043</name>
+ <description>Test for repository inheritence - ensure using the same id
overrides the defaults</description>
+
+ <repositories>
+ <repository>
+ <id>central</id>
+ <name>it0043</name>
+ <url>file:/tmp/maven-core-it0043-repo</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>central</id>
+ <name>it0043</name>
+ <url>file:/tmp/maven-core-it0043-repo</url>
+ </pluginRepository>
+ </pluginRepositories>
+</project>
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0043/test/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision