maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r990379 - in /maven/surefire/trunk/surefire-integration-tests: ./ src/test/java/org/apache/maven/surefire/its/
Date Sat, 28 Aug 2010 15:06:07 GMT
Author: bentmann
Date: Sat Aug 28 15:06:06 2010
New Revision: 990379

URL: http://svn.apache.org/viewvc?rev=990379&view=rev
Log:
o Fixed ITs to consequently use IT settings
o Extended IT settings to disable any snapshots updates to ensure the staged artifacts are
used

Modified:
    maven/surefire/trunk/surefire-integration-tests/pom.xml
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java

Modified: maven/surefire/trunk/surefire-integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/pom.xml?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/pom.xml (original)
+++ maven/surefire/trunk/surefire-integration-tests/pom.xml Sat Aug 28 15:06:06 2010
@@ -86,6 +86,12 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>2.0.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
Sat Aug 28 15:06:06 2010
@@ -1,11 +1,30 @@
 package org.apache.maven.surefire.its;
 
+/*
+ * 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.
+ */
+
 import junit.framework.TestCase;
 import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.Verifier;
 
 import java.util.ArrayList;
-
+import java.util.List;
 
 /**
  * Base class of all integration test cases. Mainly used to pickup surefire version
@@ -28,8 +47,14 @@ public abstract class AbstractSurefireIn
     protected void executeGoal( Verifier verifier, String goal )
         throws VerificationException
     {
-        ArrayList goals = this.getInitialGoals();
+        List goals = getInitialGoals();
         goals.add( goal );
+        executeGoals( verifier, goals );
+    }
+
+    protected void executeGoals( Verifier verifier, List goals )
+        throws VerificationException
+    {
         if ( !verifier.getCliOptions().contains( "-s" ) )
         {
             String settingsPath = System.getProperty( "maven.settings.file" );
@@ -40,6 +65,7 @@ public abstract class AbstractSurefireIn
             verifier.getCliOptions().add( "-s" );
             verifier.getCliOptions().add( settingsPath );
         }
+
         verifier.executeGoals( goals );
     }
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
Sat Aug 28 15:06:06 2010
@@ -41,7 +41,7 @@ public class AggregateReportIT
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         List goals = this.getInitialGoals();
         goals.add( "surefire-report:report" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         //DGF even though the build will succeed, the log will contain errors (from the failure)
         //verifier.verifyErrorFreeLog();
         verifier.resetStreams();

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
Sat Aug 28 15:06:06 2010
@@ -44,7 +44,7 @@ public class CheckSingleTestIT
         List goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=BasicTest" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
@@ -60,7 +60,7 @@ public class CheckSingleTestIT
         List goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=BasicTest.java" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
@@ -79,7 +79,7 @@ public class CheckSingleTestIT
 
         try
         {
-            verifier.executeGoals( goals );
+            executeGoals( verifier, goals );
             verifier.verifyErrorFreeLog();
             fail( "Build should have failed" );
         }
@@ -106,7 +106,7 @@ public class CheckSingleTestIT
         goals.add( "test" );
         goals.add( "-Dtest=DoesNotExist" );
         goals.add( "-DfailIfNoTests=false" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
 
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
Sat Aug 28 15:06:06 2010
@@ -87,7 +87,7 @@ public class CheckTestFailIfNoTestsForkM
         {
             try
             {
-                verifier.executeGoals( goals );
+                executeGoals( verifier, goals );
                 verifier.resetStreams();
                 verifier.verifyErrorFreeLog();
                 fail( "Build did not fail, but it should have" );
@@ -99,7 +99,7 @@ public class CheckTestFailIfNoTestsForkM
         }
         else
         {
-            verifier.executeGoals( goals );
+            executeGoals( verifier, goals );
             verifier.resetStreams();
             verifier.verifyErrorFreeLog();
             HelperAssertions.assertTestSuiteResults( 0, 0, 0, 0, testDir );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
Sat Aug 28 15:06:06 2010
@@ -46,7 +46,7 @@ public class CheckTestFailIfNoTestsIT
 
         try
         {
-            verifier.executeGoals( goals );
+            executeGoals( verifier, goals );
             verifier.resetStreams();
             verifier.verifyErrorFreeLog();
             fail( "Build didn't fail, but it should" );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
Sat Aug 28 15:06:06 2010
@@ -42,7 +42,7 @@ public class CheckTestNgSuiteXmlIT
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         List goals = getInitialGoals();
         goals.add( "test" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
@@ -57,7 +57,7 @@ public class CheckTestNgSuiteXmlIT
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         List goals = getInitialGoals();
         goals.addAll( Arrays.asList( new String[]{ "test", "-DforkMode=always" } ) );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
Sat Aug 28 15:06:06 2010
@@ -42,7 +42,7 @@ public class CheckTestNgSuiteXmlSingleIT
         List goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=TestNGTestTwo" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
Sat Aug 28 15:06:06 2010
@@ -96,7 +96,7 @@ public class CheckTestNgVersionsIT
         // DGF we have to pass in the version as a command line argument
         // and NOT as a system property; otherwise our setting will be ignored
         arguments.add( "-DtestNgVersion=" + version );
-        verifier.executeGoals( arguments );
+        executeGoals( verifier, arguments );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
Sat Aug 28 15:06:06 2010
@@ -113,7 +113,7 @@ public class ForkModeIT
         List goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DforkMode=" + forkMode );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java
Sat Aug 28 15:06:06 2010
@@ -53,7 +53,7 @@ public class Junit47concurrencyIT
         // DGF we have to pass in the version as a command line argument
         // and NOT as a system property; otherwise our setting will be ignored
         arguments.add( "-DjunitVersion=4.7" );
-        verifier.executeGoals( arguments );
+        executeGoals( verifier, arguments );
 
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java
Sat Aug 28 15:06:06 2010
@@ -100,7 +100,7 @@ public class Junit4VersionsIT
         // DGF we have to pass in the version as a command line argument
         // and NOT as a system property; otherwise our setting will be ignored
         arguments.add( "-DjunitVersion=" + version );
-        verifier.executeGoals( arguments );
+        executeGoals( verifier, arguments );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
Sat Aug 28 15:06:06 2010
@@ -55,7 +55,7 @@ public class PlexusConflictIT
         ArrayList goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dsurefire.useSystemClassLoader=false" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
Sat Aug 28 15:06:06 2010
@@ -1,36 +1,40 @@
 package org.apache.maven.surefire.its;
 
+/*
+ * 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.
+ */
+
 import org.apache.maven.settings.Profile;
 import org.apache.maven.settings.Repository;
 import org.apache.maven.settings.RepositoryPolicy;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Writer;
-import org.codehaus.plexus.util.xml.XmlStreamReader;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.WriterFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Random;
-/*
-* 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.
-*/
 
 /**
  * Helper class to assist in using verifier with a staged local repository.
@@ -64,11 +68,9 @@ public final class StagedLocalRepoHelper
         throws IOException
     {
         Random entropy = new Random();
-        SettingsXpp3Reader reader = new SettingsXpp3Reader();
-        SettingsXpp3Writer writer = new SettingsXpp3Writer();
         try
         {
-            Settings settings = reader.read( new XmlStreamReader( originalSettingsXml ) );
+            Settings settings = new SettingsXpp3Reader().read( ReaderFactory.newXmlReader(
originalSettingsXml ) );
 
             String localRepo = System.getProperty( "maven.repo.local" );
 
@@ -98,6 +100,7 @@ public final class StagedLocalRepoHelper
                 profile.setId( "stagedLocalRepo" + entropy.nextLong() );
             }
             while ( settings.getProfilesAsMap().containsKey( profile.getId() ) );
+
             Repository repository = new Repository();
             repository.setId( profile.getId() + entropy.nextLong() );
             RepositoryPolicy policy = new RepositoryPolicy();
@@ -114,7 +117,15 @@ public final class StagedLocalRepoHelper
             settings.addProfile( profile );
             settings.addActiveProfile( profile.getId() );
             settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() );
-            writer.write( new FileWriter( stagedSettingsXml ), settings );
+
+            for ( Iterator it = settings.getProfiles().iterator(); it.hasNext(); )
+            {
+                profile = (Profile) it.next();
+                disableUpdates( profile.getRepositories() );
+                disableUpdates( profile.getPluginRepositories() );
+            }
+
+            new SettingsXpp3Writer().write( WriterFactory.newXmlWriter( stagedSettingsXml
), settings );
         }
         catch ( XmlPullParserException e )
         {
@@ -123,4 +134,30 @@ public final class StagedLocalRepoHelper
             throw ioe;
         }
     }
+
+    private static void disableUpdates( List repositories )
+    {
+        if ( repositories != null )
+        {
+            for ( Iterator it = repositories.iterator(); it.hasNext(); )
+            {
+                Repository repo = (Repository) it.next();
+                repo.setReleases( disableUpdates( repo.getReleases() ) );
+                repo.setSnapshots( disableUpdates( repo.getSnapshots() ) );
+            }
+        }
+    }
+
+    private static RepositoryPolicy disableUpdates( RepositoryPolicy policy )
+    {
+        if ( policy == null )
+        {
+            policy = new RepositoryPolicy();
+        }
+
+        policy.setUpdatePolicy( "never" );
+        
+        return policy;
+    }
+
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java
Sat Aug 28 15:06:06 2010
@@ -42,7 +42,7 @@ public class SystemPropertiesTestIT
         goals.add( "test" );
         goals.add( "-DsetOnMavenCommandLine=baz" );
         goals.add( "-DsetOnArgLineWorkAround=baz" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
@@ -62,7 +62,7 @@ public class SystemPropertiesTestIT
         goals.add( "-DsetOnMavenCommandLine=baz" );
         // DGF fake the argLine, since we're not forking
         goals.add( "-DsetOnArgLine=bar" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UmlautDirIT.java
Sat Aug 28 15:06:06 2010
@@ -54,7 +54,7 @@ public class UmlautDirIT
         ArrayList goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DuseSystemClassLoader=false" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java?rev=990379&r1=990378&r2=990379&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
Sat Aug 28 15:06:06 2010
@@ -87,7 +87,7 @@ public class WorkingDirectoryIT
         ArrayList goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DforkMode=never" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
@@ -115,7 +115,7 @@ public class WorkingDirectoryIT
         ArrayList goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DforkMode=never" );
-        verifier.executeGoals( goals );
+        executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 



Mime
View raw message