Author: olamy
Date: Mon Dec  5 10:36:32 2011
New Revision: 1210403

URL: http://svn.apache.org/viewvc?rev=1210403&view=rev
Log:
add core it test for regression found in appassembler with download timestamped 
SNAPSHOT
see 
http://mail-archives.apache.org/mod_mbox/maven-dev/201112.mbox/%3ccapcjjnhjsqed0tzuztwwtqcspyvn_k0-0xq2b7qxtn5arz-...@mail.gmail.com%3e

Added:
     
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
   (with props)
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/pom.xml
   (with props)
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/dep-0.1-20110726.105319-1.jar
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/dep-0.1-20110726.105319-1.pom
   (with props)
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/maven-metadata.xml
   (with props)
     
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/settings-template.xml
   (with props)
     
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-artifact/src/main/java/org/apache/maven/plugin/coreit/InstallArtifactsMojo.java
   (with props)

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java?rev=1210403&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0146InstallerSnapshotNaming.java
 Mon Dec  5 10:36:32 2011
@@ -0,0 +1,123 @@
+package org.apache.maven.it;
+
+/*
+ * 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.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
+    extends AbstractMavenIntegrationTestCase
+{
+
+    private Server server;
+
+    private int port;
+
+
+    private final File testDir;
+
+    public MavenIT0146InstallerSnapshotNaming()
+        throws IOException
+    {
+        super( "(2.0.2,)" );
+        testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/it0146" );
+    }
+
+    public void setUp()
+        throws Exception
+    {
+
+        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() } );
+
+        server = new Server( 0 );
+        server.setHandler( handlers );
+        server.start();

Tip: To emulate remote downloads, it's usually faster/simpler to use a file based repo instead of Jetty.

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/maven-metadata.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/maven-metadata.xml?rev=1210403&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/maven-metadata.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0146/repo/org/apache/maven/its/it0146/dep/0.1-SNAPSHOT/maven-metadata.xml
 Mon Dec  5 10:36:32 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+<groupId>org.apache.maven.its.it0146</groupId>
+<artifactId>dep</artifactId>
+<version>0.1-SNAPSHOT</version>
+<versioning>
+<snapshot>
+<timestamp>20110726.105319</timestamp>
+<buildNumber>1</buildNumber>
+</snapshot>
+<lastUpdated>20110726105319</lastUpdated>
+<snapshotVersions>
+<snapshotVersion>
+<extension>jar</extension>
+<value>0.1-20110726.105319-1</value>
+<updated>20110726105319</updated>
+</snapshotVersion>

The IT is declared to work with Maven (2.0.2,) but only recent 2.0.x releases can parse the extended snapshot metadata, so I suggest to just drop the <snapshotVersions> element completely.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to