enhance it to add a use where a SNAPSHOT has been installed locally and ensure now it's a -SNAPSHOT rather than a timestamped one.

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1210404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-12-05 10:37:48 +00:00
parent 3662a2e3ff
commit 79a5c280fe
4 changed files with 72 additions and 8 deletions

View File

@ -19,21 +19,16 @@ package org.apache.maven.it;
* under the License.
*/
import org.apache.maven.it.util.FileUtils;
import org.apache.maven.it.util.ResourceExtractor;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.DefaultHandler;
import org.mortbay.jetty.handler.HandlerList;
import org.mortbay.jetty.handler.ResourceHandler;
import org.mortbay.resource.FileResource;
import org.mortbay.resource.Resource;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.Properties;
public class MavenIT0146InstallerSnapshotNaming
@ -60,7 +55,6 @@ public class MavenIT0146InstallerSnapshotNaming
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase( new File( testDir, "repo" ).getAbsolutePath() );
// org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/maven-metadata.xml
HandlerList handlers = new HandlerList();
handlers.setHandlers( new Handler[]{ resourceHandler, new DefaultHandler() } );
@ -73,7 +67,6 @@ public class MavenIT0146InstallerSnapshotNaming
}
protected void tearDown()
throws Exception
{
@ -102,7 +95,6 @@ public class MavenIT0146InstallerSnapshotNaming
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
@ -120,4 +112,44 @@ public class MavenIT0146InstallerSnapshotNaming
}
public void testitNonTimestampedNameWithInstalledSNAPSHOT()
throws Exception
{
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.deleteArtifacts( "org.apache.maven.its.it0146" );
verifier.getCliOptions().add( "-f" );
verifier.getCliOptions().add( "project/pom.xml" );
verifier.deleteDirectory( "project/target" );
verifier.setLogFileName( "log2.txt" );
verifier.executeGoal( "install" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier = newVerifier( testDir.getAbsolutePath() );
Properties properties = verifier.newDefaultFilterProperties();
properties.setProperty( "@host@", InetAddress.getLocalHost().getCanonicalHostName() );
properties.setProperty( "@port@", Integer.toString( port ) );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.setLogFileName( "log3.txt" );
verifier.getCliOptions().add( "-X" );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "target/appassembler/repo/dep-0.1-SNAPSHOT.jar" );
}
}

View File

@ -29,6 +29,7 @@ under the License.
<name>Maven Integration Test :: it-0146</name>
<description>
Verify that download remote snapshot are correctly installed locally via Installer with timestamped name.
see issue related in this thread: http://mail-archives.apache.org/mod_mbox/maven-dev/201112.mbox/%3cCAPCjjnHjsQED0tzUztwWtQcSpYVN_k0-0Xq2B7QxTN5arZ-xzA@mail.gmail.com%3e
</description>
<dependencies>

View File

@ -0,0 +1,30 @@
<?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.it0146</groupId>
<artifactId>dep</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
</project>