From commits-return-76366-archive-asf-public=cust-asf.ponee.io@maven.apache.org Wed Oct 3 12:37:57 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id EEAE2180677 for ; Wed, 3 Oct 2018 12:37:55 +0200 (CEST) Received: (qmail 49889 invoked by uid 500); 3 Oct 2018 10:37:55 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 49876 invoked by uid 99); 3 Oct 2018 10:37:55 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2018 10:37:55 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 4825085058; Wed, 3 Oct 2018 10:37:54 +0000 (UTC) Date: Wed, 03 Oct 2018 10:37:55 +0000 To: "commits@maven.apache.org" Subject: [maven-surefire] 01/01: [SUREFIRE-1578] Remove obsolete module surefire-setup-integration-tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: tibordigana@apache.org In-Reply-To: <153856307418.14072.1194785574293487814@gitbox.apache.org> References: <153856307418.14072.1194785574293487814@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: maven-surefire X-Git-Refname: refs/heads/SUREFIRE-1578 X-Git-Reftype: branch X-Git-Rev: 8902b57b0e262c0b93e8f126ae530ed9d9e564fb X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20181003103754.4825085058@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. tibordigana pushed a commit to branch SUREFIRE-1578 in repository https://gitbox.apache.org/repos/asf/maven-surefire.git commit 8902b57b0e262c0b93e8f126ae530ed9d9e564fb Author: Tibor17 AuthorDate: Wed Oct 3 12:37:46 2018 +0200 [SUREFIRE-1578] Remove obsolete module surefire-setup-integration-tests --- pom.xml | 1 - surefire-its/pom.xml | 34 ++- .../maven/surefire/its/AbstractFailFastIT.java | 9 +- .../apache/maven/surefire/its/ConsoleOutputIT.java | 10 +- .../maven/surefire/its/fixture/MavenLauncher.java | 79 ++---- .../surefire/its/fixture/SurefireLauncher.java | 11 +- .../Surefire1396CustomProviderClassPathIT.java | 3 - .../its/jiras/Surefire141PluggableProvidersIT.java | 6 - .../its/jiras/Surefire740TruncatedCommaIT.java | 7 +- ...Surefire946KillMainProcessInReusableForkIT.java | 5 - surefire-its/src/test/resources/settings.xml | 42 +--- .../src/test}/resources/toolchains.xml | 0 surefire-setup-integration-tests/pom.xml | 279 --------------------- .../surefire/its/SetUpForIntegrationTest.java | 44 ---- .../maven/surefire/its/StagedLocalRepoHelper.java | 160 ------------ 15 files changed, 65 insertions(+), 625 deletions(-) diff --git a/pom.xml b/pom.xml index 2834a88..280289f 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,6 @@ maven-surefire-plugin maven-failsafe-plugin maven-surefire-report-plugin - surefire-setup-integration-tests surefire-its diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml index 5ee30c9..391543e 100644 --- a/surefire-its/pom.xml +++ b/surefire-its/pom.xml @@ -46,6 +46,7 @@ org.apache.maven.shared maven-verifier + test org.apache.maven @@ -61,22 +62,45 @@ org.apache.maven maven-artifact + test org.apache.maven.shared maven-shared-utils + test commons-io commons-io + test org.apache.commons commons-lang3 + test + + + src/test/resources + ${project.build.outputDirectory} + + settings.xml + toolchains.xml + + + + src/test/resources + true + ${project.build.directory}/private + + settings.xml + toolchains.xml + + + maven-surefire-plugin @@ -111,15 +135,9 @@ ${project.version} ${maven.home} - ${project.basedir}/../surefire-setup-integration-tests/target/private/it-settings.xml - - ${project.basedir}/../surefire-setup-integration-tests/target/private/toolchains.xml - - ${project.basedir}/../surefire-setup-integration-tests/target/it-repo + ${project.build.directory}/private/settings.xml + ${project.build.directory}/private/toolchains.xml ${project.build.directory} - ${settings.localRepository} - false - ${project.build.testOutputDirectory} forked ${jdk.home} ${jacoco-it.agent} diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java index 9a49d1a..14b19c7 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java @@ -64,7 +64,7 @@ public abstract class AbstractFailFastIT protected abstract String withProvider(); - protected final OutputValidator prepare( String description, String profile, Map properties ) + private OutputValidator prepare( String description, String profile, Map properties ) { MavenLauncher launcher = unpack( "/fail-fast-" + withProvider(), "_" + description ) .maven(); @@ -82,12 +82,7 @@ public abstract class AbstractFailFastIT return launcher.sysProp( properties ).executeTest(); } - protected final OutputValidator prepare( String description, Map properties ) - { - return prepare( description, null, properties ); - } - - protected static Map props( int forkCount, int skipAfterFailureCount, boolean reuseForks ) + static Map props( int forkCount, int skipAfterFailureCount, boolean reuseForks ) { Map props = new HashMap( 3 ); props.put( "surefire.skipAfterFailureCount", "" + skipAfterFailureCount ); diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ConsoleOutputIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ConsoleOutputIT.java index e01d798..734d773 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ConsoleOutputIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ConsoleOutputIT.java @@ -97,10 +97,10 @@ public class ConsoleOutputIT @Test public void largerSoutThanMemory() - throws Exception { - unpack( "consoleoutput-noisy" ).setMavenOpts( "-Xmx64m" ).sysProp( "thousand", "32000" ).executeTest(); + unpack( "consoleoutput-noisy" ) + .setMavenOpts( "-Xmx64m" ) + .sysProp( "thousand", "32000" ) + .executeTest(); } - - -} \ No newline at end of file +} diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java index bd12dda..1cbfb6b 100755 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java @@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.fixture; * under the License. */ -import org.apache.commons.lang.text.StrSubstitutor; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; @@ -42,7 +41,7 @@ import static java.util.Collections.unmodifiableList; * * @author Kristian Rosenvold */ -public class MavenLauncher +public final class MavenLauncher { private final List cliOptions = new ArrayList(); @@ -66,7 +65,7 @@ public class MavenLauncher private boolean expectFailure; - public MavenLauncher( Class testClass, String resourceName, String suffix, String[] cli ) + MavenLauncher( Class testClass, String resourceName, String suffix, String[] cli ) { this.testCaseBeingRun = testClass; this.resourceName = resourceName; @@ -76,7 +75,7 @@ public class MavenLauncher resetCliOptions(); } - public MavenLauncher( Class testClass, String resourceName, String suffix ) + MavenLauncher( Class testClass, String resourceName, String suffix ) { this( testClass, resourceName, suffix, null ); } @@ -104,18 +103,16 @@ public class MavenLauncher unpackedAt = dest; } - public void resetGoals() + private void resetGoals() { goals.clear(); } - void addCliOption( String cliOption ) + private void addCliOption( String cliOption ) { cliOptions.add( cliOption ); } - - private StackTraceElement findTopElemenent( StackTraceElement[] stackTrace, Class testClassToLookFor ) { StackTraceElement bestmatch = null; @@ -129,7 +126,7 @@ public class MavenLauncher return bestmatch; } - StackTraceElement[] getStackTraceElements() + private static StackTraceElement[] getStackTraceElements() { try { @@ -153,7 +150,6 @@ public class MavenLauncher } public MavenLauncher getSubProjectLauncher( String subProject ) - throws VerificationException { MavenLauncher mavenLauncher = new MavenLauncher( testCaseBeingRun, resourceName + File.separator + subProject, suffix, cli ); @@ -168,7 +164,6 @@ public class MavenLauncher return new OutputValidator( new Verifier( subFile.getAbsolutePath() ) ); } - public MavenLauncher addEnvVar( String key, String value ) { envvars.put( key, value ); @@ -279,16 +274,14 @@ public class MavenLauncher throw new RuntimeException( "Expecting build failure, got none!" ); } return verify; - } public MavenLauncher withFailure() { - this.expectFailure = true; + expectFailure = true; return this; } - public OutputValidator execute( String goal ) { addGoal( goal ); @@ -297,48 +290,22 @@ public class MavenLauncher public OutputValidator executeCurrentGoals() { - - String userLocalRepo = System.getProperty( "user.localRepository" ); - String testBuildDirectory = System.getProperty( "testBuildDirectory" ); - boolean useInterpolatedSettings = Boolean.getBoolean( "useInterpolatedSettings" ); - try { - if ( useInterpolatedSettings ) - { - File interpolatedSettings = new File( testBuildDirectory, "interpolated-settings" ); - - if ( !interpolatedSettings.exists() ) - { - // hack "a la" invoker plugin to download dependencies from local repo - // and not download from central - - Map values = new HashMap( 1 ); - values.put( "localRepositoryUrl", toUrl( userLocalRepo ) ); - StrSubstitutor strSubstitutor = new StrSubstitutor( values ); - - String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) ); - - String filtered = strSubstitutor.replace( fileContent ); - - FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered ); - - } - - addCliOption( "-s " + interpolatedSettings.getCanonicalPath() ); - } + File generatedSettings = new File( System.getProperty( "maven.settings.file" ) ).getCanonicalFile(); + String generatedSettingsPath = generatedSettings.getAbsolutePath(); + addCliOption( "-s " + generatedSettingsPath ); getVerifier().setCliOptions( cliOptions ); - getVerifier().executeGoals( goals, envvars ); return getValidator(); } catch ( IOException e ) { - throw new SurefireVerifierException( e.getMessage(), e ); + throw new SurefireVerifierException( e.getLocalizedMessage(), e ); } catch ( VerificationException e ) { - throw new SurefireVerifierException( e.getMessage(), e ); + throw new SurefireVerifierException( e.getLocalizedMessage(), e ); } finally { @@ -346,20 +313,6 @@ public class MavenLauncher } } - private static String toUrl( String filename ) - { - /* - * NOTE: Maven fails to properly handle percent-encoded "file:" URLs (WAGON-111) so don't use File.toURI() here - * as-is but use the decoded path component in the URL. - */ - String url = "file://" + new File( filename ).toURI().getPath(); - if ( url.endsWith( "/" ) ) - { - url = url.substring( 0, url.length() - 1 ); - } - return url; - } - public MavenLauncher activateProfile( String profile ) { return addGoal( "-P" + profile ); @@ -417,7 +370,7 @@ public class MavenLauncher { if ( validator == null ) { - this.validator = new OutputValidator( getVerifier() ); + validator = new OutputValidator( getVerifier() ); } return validator; } @@ -436,6 +389,9 @@ public class MavenLauncher cli == null ? new Verifier( ensureUnpacked().getAbsolutePath(), null, false ) : new Verifier( ensureUnpacked().getAbsolutePath(), null, false, cli ); + + verifier.getVerifierProperties() + .setProperty( "use.mavenRepoLocal", "false" ); } catch ( VerificationException e ) { @@ -469,10 +425,9 @@ public class MavenLauncher { throw new RuntimeException( e ); } - } - File getUnpackDir() + private File getUnpackDir() { String tempDirPath = System.getProperty( "maven.test.tmpdir", System.getProperty( "java.io.tmpdir" ) ); return new File( tempDirPath, diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java index 5ec5e09..0e40622 100755 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java @@ -115,7 +115,6 @@ public final class SurefireLauncher } public SurefireLauncher getSubProjectLauncher( String subProject ) - throws VerificationException { return new SurefireLauncher( mavenLauncher.getSubProjectLauncher( subProject ) ); } @@ -194,12 +193,10 @@ public final class SurefireLauncher } public OutputValidator executeInstall() - throws VerificationException { return mavenLauncher.execute( "install" ); } - public FailsafeOutputValidator executeVerify() { OutputValidator verify = execute( "verify" ); @@ -321,12 +318,6 @@ public final class SurefireLauncher return this; } - - protected String getSurefireVersion() - { - return surefireVersion; - } - public SurefireLauncher disablePerCoreThreadCount() { mavenLauncher.sysProp( "perCoreThreadCount", false ); @@ -477,7 +468,7 @@ public final class SurefireLauncher private String getReportPluginGoal( String goal ) { - return "org.apache.maven.plugins:maven-surefire-report-plugin:" + getSurefireVersion() + ":" + goal; + return "org.apache.maven.plugins:maven-surefire-report-plugin:" + surefireVersion + ":" + goal; } public SurefireLauncher setTestToRun( String basicTest ) diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java index 4a27688..60b372f 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java @@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.jiras; * under the License. */ -import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.BeforeClass; import org.junit.Test; @@ -32,14 +31,12 @@ public class Surefire1396CustomProviderClassPathIT { @BeforeClass public static void installProvider() - throws VerificationException { unpack( Surefire1396CustomProviderClassPathIT.class, "surefire-1396-pluggableproviders-classpath-provider", "prov" ).executeInstall(); } @Test public void pluggableProviderClasspathCorrect() - throws Exception { unpack( "surefire-1396-pluggableproviders-classpath" ) .setForkJvm() diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java index 0856482..0d4faf5 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java @@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.jiras; * under the License. */ -import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireVerifierException; @@ -41,7 +40,6 @@ public class Surefire141PluggableProvidersIT { @BeforeClass public static void installProvider() - throws VerificationException { unpack( Surefire141PluggableProvidersIT.class, "surefire-141-pluggableproviders-provider", "prov" ) .executeInstall(); @@ -49,7 +47,6 @@ public class Surefire141PluggableProvidersIT @Test public void pluggableProviderPresent() - throws Exception { unpack( "surefire-141-pluggableproviders" ) .setForkJvm() @@ -64,7 +61,6 @@ public class Surefire141PluggableProvidersIT @Test public void invokeRuntimeException() - throws Exception { final String errorText = "Let's fail with a runtimeException"; @@ -87,7 +83,6 @@ public class Surefire141PluggableProvidersIT @Test public void invokeReporterException() - throws Exception { final String errorText = "Let's fail with a reporterexception"; @@ -110,7 +105,6 @@ public class Surefire141PluggableProvidersIT @Test public void constructorRuntimeException() - throws Exception { final String errorText = "Let's fail with a runtimeException"; diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java index e05cee7..70484ca 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java @@ -37,8 +37,11 @@ public class Surefire740TruncatedCommaIT @Test public void testRussianLocaleReport() { - OutputValidator validator = unpack( "/surefire-740-comma-truncated" ).setMavenOpts( - "-Duser.language=ru -Duser.country=RU" ).failNever().addSurefireReportGoal().executeCurrentGoals(); + OutputValidator validator = unpack( "/surefire-740-comma-truncated" ) + .setMavenOpts( "-Duser.language=ru -Duser.country=RU" ) + .failNever() + .addSurefireReportGoal() + .executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting file", siteFile.exists() ); diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java index ea663ab..a5740c0 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java @@ -26,34 +26,29 @@ import org.junit.Test; public class Surefire946KillMainProcessInReusableForkIT extends SurefireJUnit4IntegrationTestCase { - // there are 10 test classes that each would wait 2 seconds. private static final int TEST_SLEEP_TIME = 2000; @BeforeClass public static void installSelfdestructPlugin() - throws Exception { unpack( Surefire946KillMainProcessInReusableForkIT.class, "surefire-946-self-destruct-plugin", "plugin" ).executeInstall(); } @Test( timeout = 30000 ) public void testHalt() - throws Exception { doTest( "halt" ); } @Test( timeout = 30000 ) public void testExit() - throws Exception { doTest( "exit" ); } @Test( timeout = 30000 ) public void testInterrupt() - throws Exception { doTest( "interrupt" ); } diff --git a/surefire-its/src/test/resources/settings.xml b/surefire-its/src/test/resources/settings.xml index 991a3e3..ae32218 100644 --- a/surefire-its/src/test/resources/settings.xml +++ b/surefire-its/src/test/resources/settings.xml @@ -17,37 +17,13 @@ ~ specific language governing permissions and limitations ~ under the License. --> - - - - it-repo - - true - - - - local.central - ${localRepositoryUrl} - - true - - - true - - - - - - local.central - ${localRepositoryUrl} - - true - - - true - - - - - + + file://${maven.repo.local} + false + + org.apache.maven.plugins + org.codehaus.mojo + diff --git a/surefire-setup-integration-tests/src/main/resources/toolchains.xml b/surefire-its/src/test/resources/toolchains.xml similarity index 100% rename from surefire-setup-integration-tests/src/main/resources/toolchains.xml rename to surefire-its/src/test/resources/toolchains.xml diff --git a/surefire-setup-integration-tests/pom.xml b/surefire-setup-integration-tests/pom.xml deleted file mode 100644 index 573c537..0000000 --- a/surefire-setup-integration-tests/pom.xml +++ /dev/null @@ -1,279 +0,0 @@ - - - - - 4.0.0 - - - org.apache.maven.surefire - surefire - 2.22.1-SNAPSHOT - - - surefire-setup-integration-tests - - Maven Surefire Integration Test Setup - Creates internal M2 local repository in target/it-repo/. The project is not deployed. - - - UTF-8 - false - 5.7 - 2 - 2.8 - - - - - maven-failsafe-plugin - org.apache.maven.plugins - ${project.version} - maven-plugin - - - maven-surefire-report-plugin - org.apache.maven.plugins - ${project.version} - maven-plugin - - - maven-surefire-plugin - org.apache.maven.plugins - ${project.version} - maven-plugin - - - org.apache.maven.surefire - surefire-testng - ${project.version} - - - - org.testng - testng - - - - - org.apache.maven.surefire - surefire-junit3 - ${project.version} - - - org.apache.maven.surefire - surefire-junit4 - ${project.version} - - - org.apache.maven.surefire - surefire-junit47 - ${project.version} - - - org.apache.maven - maven-settings - ${mavenVersion} - test - - - net.sourceforge.htmlunit - htmlunit - 2.8 - test - - - commons-io - commons-io - 2.0.1 - - - - - - - src/main/resources - ${project.build.outputDirectory} - - toolchains.xml - - - - src/main/resources - true - ${project.build.directory}/private - - toolchains.xml - - - - - - maven-help-plugin - - - settings.xml - generate-test-resources - - effective-settings - - - ${project.build.directory}/private/settings.xml - ${it.settings.showPasswords} - - - - - - maven-invoker-plugin - - ${project.build.directory}/it-repo - - org.apache.maven.surefire:surefire-testng-utils:${project.version} - org.testng:testng:4.7:jar:jdk15 - org.testng:testng:5.0.2:jar:jdk15 - org.testng:testng:5.1:jar:jdk15 - org.testng:testng:5.5:jar:jdk15 - org.testng:testng:5.6:jar:jdk15 - org.testng:testng:5.7:jar:jdk14 - org.testng:testng:5.7:jar:jdk15 - org.testng:testng:5.8:jar:jdk15 - org.testng:testng:5.9:jar:jdk15 - org.testng:testng:5.10:jar:jdk15 - org.testng:testng:5.12.1 - org.testng:testng:5.13 - org.testng:testng:5.13.1 - org.testng:testng:5.14 - org.testng:testng:5.14.1 - org.testng:testng:5.14.2 - org.testng:testng:5.14.9 - org.testng:testng:6.0 - org.testng:testng:6.5.1 - com.google.inject:guice:3.0:jar:no_aop - log4j:log4j:1.2.16 - org.apache.maven.plugins:maven-clean-plugin:2.4.1 - org.apache.maven.plugins:maven-compiler-plugin:2.3.2 - org.apache.maven.plugins:maven-compiler-plugin:2.5.1 - org.apache.maven.plugins:maven-install-plugin:2.3.1 - org.apache.maven.plugins:maven-compiler-plugin:2.0.2 - org.apache.maven.plugins:maven-resources-plugin:2.5 - org.apache.maven.plugins:maven-jar-plugin:2.3.2 - org.apache.commons:commons-email:1.2 - org.codehaus.mojo:build-helper-maven-plugin:1.2 - org.apache.maven.reporting:maven-reporting-api:2.2.1 - commons-collections:commons-collections:3.2 - commons-logging:commons-logging:1.0.4 - xml-apis:xml-apis:1.0.b2 - org.apache.httpcomponents:httpclient:4.0.2 - junit:junit:4.4 - junit:junit:4.5 - junit:junit:4.7 - junit:junit:4.8.1 - junit:junit:4.8.2 - junit:junit:4.11 - junit:junit:4.12 - junit:junit-dep:4.8 - junit:junit-dep:4.7 - junit:junit-dep:4.4 - org.apache.maven.plugins:maven-surefire-plugin:2.10 - org.apache.maven.surefire:surefire-junit3:2.10 - org.codehaus.plexus:plexus-utils:1.0.4 - org.codehaus.plexus:plexus-utils:1.4.1 - org.codehaus.plexus:plexus-utils:1.5.1 - org.codehaus.plexus:plexus-utils:1.5.8 - org.codehaus.plexus:plexus-utils:1.5.15 - org.mockito:mockito-core:1.8.5 - org.powermock:powermock-mockito-release-full:1.6.4:jar:full - org.codehaus.plexus:plexus-interpolation:1.12 - org.hamcrest:hamcrest-core:1.3 - org.hamcrest:hamcrest-library:1.3 - org.easytesting:fest-assert:1.4 - - - - - - install - - - - - - maven-surefire-plugin - - - - - - ${project.version} - ${testng.version} - ${maven.home} - ${project.build.directory}/private/settings.xml - ${project.build.directory}/it-repo - - - - - org.apache.maven.surefire - surefire-shadefire - 2.12.4 - - - - - maven-enforcer-plugin - - - require-maven-2.1.0 - - enforce - - - - - - [2.1.0,) - - - - - - - - maven-jar-plugin - - true - - - - maven-install-plugin - - true - - - - maven-deploy-plugin - - true - - - - - - diff --git a/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/SetUpForIntegrationTest.java b/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/SetUpForIntegrationTest.java deleted file mode 100644 index 6a9f585..0000000 --- a/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/SetUpForIntegrationTest.java +++ /dev/null @@ -1,44 +0,0 @@ -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 java.io.File; -import java.io.IOException; - -import junit.framework.TestCase; - -/** - * Created by IntelliJ IDEA. - * - * @author Stephen Connolly - * @since 05-Jan-2010 08:17:17 - */ -public class SetUpForIntegrationTest - extends TestCase -{ - public void testSmokes() - throws IOException - { - // if the properties are missing we'll fail the test with an NPE and stop the build. - File originalSettings = new File( System.getProperty( "maven.settings.file" ) ); - File newRepo = new File( System.getProperty( "maven.staged.local.repo" ) ); - File newSettings = new File( originalSettings.getParentFile(), "it-" + originalSettings.getName() ); - StagedLocalRepoHelper.createStagedSettingsXml( originalSettings, newRepo, newSettings ); - } -} diff --git a/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java b/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java deleted file mode 100644 index 202d665..0000000 --- a/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java +++ /dev/null @@ -1,160 +0,0 @@ -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 java.io.File; -import java.io.IOException; -import java.util.List; -import java.util.Random; -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.apache.maven.shared.utils.ReaderFactory; -import org.apache.maven.shared.utils.WriterFactory; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -/** - * Helper class to assist in using verifier with a staged local repository. - * - * @author Stephen Connolly - * @since 05-Jan-2010 07:36:22 - */ -public final class StagedLocalRepoHelper -{ - private StagedLocalRepoHelper() - { - throw new IllegalAccessError( "Helper class" ); - } - - private static String toUrl( String filename ) - { - /* - * NOTE: Maven fails to properly handle percent-encoded "file:" URLs (WAGON-111) so don't use File.toURI() here - * as-is but use the decoded path component in the URL. - */ - String url = "file://" + new File( filename ).toURI().getPath(); - if ( url.endsWith( "/" ) ) - { - url = url.substring( 0, url.length() - 1 ); - } - return url; - } - - - public static void createStagedSettingsXml( File originalSettingsXml, File stagedLocalRepo, File stagedSettingsXml ) - throws IOException - { - Random entropy = new Random(); - try - { - System.out.println( Settings.class.getClassLoader() - .getResource( "org/apache/maven/settings/Server.class" ) ); - Settings settings = new SettingsXpp3Reader().read( ReaderFactory.newXmlReader( originalSettingsXml ) ); - - String localRepo = System.getProperty( "maven.repo.local" ); - - if ( localRepo == null ) - { - localRepo = settings.getLocalRepository(); - } - - if ( localRepo == null ) - { - localRepo = System.getProperty( "user.home" ) + "/.m2/repository"; - } - - File repoDir = new File( localRepo ); - - if ( !repoDir.exists() ) - { - repoDir.mkdirs(); - } - - // normalize path - localRepo = repoDir.getAbsolutePath(); - - Profile profile = new Profile(); - do - { - 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(); - policy.setEnabled( true ); - policy.setChecksumPolicy( "ignore" ); - policy.setUpdatePolicy( "never" ); - repository.setReleases( policy ); - repository.setSnapshots( policy ); - repository.setLayout( "default" ); - repository.setName( "Original Local Repository" ); - repository.setUrl( toUrl( localRepo ) ); - profile.addPluginRepository( repository ); - profile.addRepository( repository ); - settings.addProfile( profile ); - settings.addActiveProfile( profile.getId() ); - settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() ); - - for ( Object o : settings.getProfiles() ) - { - profile = (Profile) o; - disableUpdates( profile.getRepositories() ); - disableUpdates( profile.getPluginRepositories() ); - } - - new SettingsXpp3Writer().write( WriterFactory.newXmlWriter( stagedSettingsXml ), settings ); - } - catch ( XmlPullParserException e ) - { - IOException ioe = new IOException( e.getMessage() ); - ioe.initCause( e ); - throw ioe; - } - } - - private static void disableUpdates( List repositories ) - { - if ( repositories != null ) - { - for (Repository repo : repositories) { - 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; - } - -}