diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java deleted file mode 100644 index 006753b82a..0000000000 --- a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.apache.maven.integrationtests; - -/* - * 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.it.Verifier; -import org.apache.maven.it.util.FileUtils; -import org.apache.maven.it.util.ResourceExtractor; - -import java.io.File; -import java.io.IOException; - -/** - * Test to verify that a plugin can be successfully updated to the latest release. - * See MNG-1908. - */ -public class MavenReleaseUpdateITest - extends AbstractMavenIntegrationTestCase -{ - private static final String GROUPID = "org.apache.maven.it"; - - private static final String ARTIFACTID = "maven-it-release-update"; - - private static final String TYPE = "jar"; - - private static final String POM_TYPE = "pom"; - - private static final String OLD_VERSION = "1.0"; - - private static final String NEW_VERSION = "1.1"; - - public void testReleaseUpdated() - throws Exception - { - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0109-releaseUpdate" ); - Verifier verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.deleteArtifact( GROUPID, ARTIFACTID, OLD_VERSION, TYPE ); - verifier.deleteArtifact( GROUPID, ARTIFACTID, OLD_VERSION, POM_TYPE ); - verifier.deleteArtifact( GROUPID, ARTIFACTID, NEW_VERSION, TYPE ); - verifier.deleteArtifact( GROUPID, ARTIFACTID, NEW_VERSION, POM_TYPE ); - - writeMetadata( new File( verifier.localRepo ), "maven-metadata-it.releases.xml", OLD_VERSION, - "20051230031110" ); - - // create a repository (TODO: into verifier) - File repository = new File( testDir, "repository" ); - repository.mkdirs(); - - // create artifact in repository (TODO: into verifier) - writeArtifact( repository, OLD_VERSION ); - writeArtifact( repository, NEW_VERSION ); - - writeMetadata( repository, "maven-metadata.xml", NEW_VERSION, "20061230031110" ); - - verifier.assertArtifactNotPresent( GROUPID, ARTIFACTID, OLD_VERSION, TYPE ); - verifier.assertArtifactNotPresent( GROUPID, ARTIFACTID, NEW_VERSION, TYPE ); - - verifier.executeGoal( "package" ); - - verifier.assertArtifactNotPresent( GROUPID, ARTIFACTID, OLD_VERSION, TYPE ); - verifier.assertArtifactPresent( GROUPID, ARTIFACTID, NEW_VERSION, TYPE ); - - verifier.verifyErrorFreeLog(); - verifier.resetStreams(); - } - - private static void writeMetadata( File repository, String fileName, String version, String timestamp ) - throws IOException - { - File metadata = new File( repository, GROUPID.replace( '.', '/' ) + "/" + ARTIFACTID + "/" + fileName ); - metadata.getParentFile().mkdirs(); - - StringBuffer content = new StringBuffer(); - content.append( "\n" ); - content.append( " " + GROUPID + "\n" ); - content.append( " " + ARTIFACTID + "\n" ); - content.append( " \n" ); - content.append( " " + version + "\n" ); - content.append( " " + version + "\n" ); - content.append( " \n" ); - content.append( " " + OLD_VERSION + "\n" ); - content.append( " " + NEW_VERSION + "\n" ); - content.append( " \n" ); - content.append( " " + timestamp + "\n" ); - content.append( " \n" ); - content.append( "" ); - - FileUtils.fileWrite( metadata.getAbsolutePath(), content.toString() ); - } - - private static void writeArtifact( File repository, String version ) - throws IOException - { -/* - File artifact = new File( repository, GROUPID.replace( '.', '/' ) + "/" + ARTIFACTID + "/" + version + "/" + - ARTIFACTID + "-" + version + "." + TYPE ); - artifact.getParentFile().mkdirs(); - FileUtils.fileWrite( artifact.getAbsolutePath(), version ); - - StringBuffer content = new StringBuffer(); - content.append( "\n" ); - content.append( " 4.0.0\n" ); - content.append( " " + GROUPID + "\n" ); - content.append( " " + ARTIFACTID + "\n" ); - content.append( " " + version + "\n" ); - content.append( " maven-plugin\n" ); - content.append( "" ); - - artifact = new File( artifact.getParentFile(), ARTIFACTID + "-" + version + "." + POM_TYPE ); - FileUtils.fileWrite( artifact.getAbsolutePath(), content.toString() ); -*/ - } -} diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenSnapshotUpdateITest.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenSnapshotUpdateITest.java deleted file mode 100644 index aa42d11f5e..0000000000 --- a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenSnapshotUpdateITest.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.apache.maven.integrationtests; - -/* - * Copyright 2004-2006 The Apache Software Foundation. - * - * Licensed 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.it.Verifier; -import org.apache.maven.it.util.FileUtils; -import org.apache.maven.it.util.ResourceExtractor; - -import java.io.File; - -/** - * Downloads a snapshot dependency that was deployed with uniqueVersion = false, and checks it can be - * updated. See MNG-1908. - */ -public class MavenSnapshotUpdateITest - extends AbstractMavenIntegrationTestCase -{ - - public void testSnapshotUpdated() - throws Exception - { - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0108-snapshotUpdate" ); - Verifier verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.deleteArtifact( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ); - - // create a repository (TODO: into verifier) - File repository = new File( testDir, "repository" ); - - repository.mkdirs(); - - // create artifact in repository (TODO: into verifier) - File artifact = new File( repository, - "org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-core-it-support-1.0-SNAPSHOT.jar" ); - artifact.getParentFile().mkdirs(); - FileUtils.fileWrite( artifact.getAbsolutePath(), "originalArtifact" ); - verifier.assertArtifactNotPresent( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ); - - verifier.executeGoal( "package" ); - - verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ); - verifier.assertArtifactContents( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar", - "originalArtifact" ); - File localRepoFile = - new File( verifier.getArtifactPath( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ) ); - // set in the past to ensure it is downloaded - localRepoFile.setLastModified( System.currentTimeMillis() - 5000 ); - - FileUtils.fileWrite( artifact.getAbsolutePath(), "updatedArtifact" ); - - verifier.executeGoal( "package" ); - - verifier.assertArtifactPresent( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar" ); - verifier.assertArtifactContents( "org.apache.maven", "maven-core-it-support", "1.0-SNAPSHOT", "jar", - "updatedArtifact" ); - - verifier.verifyErrorFreeLog(); - verifier.resetStreams(); - } -}