You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2007/01/03 14:28:24 UTC

svn commit: r492138 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/releaseUpdate/ resources/releaseUpdate/repository/ resources/releaseUpdate/repository/org/ resources/relea...

Author: brett
Date: Wed Jan  3 05:28:23 2007
New Revision: 492138

URL: http://svn.apache.org/viewvc?view=rev&rev=492138
Log:
[MNG-1908] test for regression due to previous fix for MNG-1908

Added:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.0/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.1/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar   (with props)

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java?view=auto&rev=492138
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java Wed Jan  3 05:28:23 2007
@@ -0,0 +1,135 @@
+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;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Test to verify that a release can be updated.
+ */
+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(), "/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 );
+
+        Map m = new HashMap();
+/*
+        m.put( "MAVEN_OPTS",
+               "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" );
+*/
+        verifier.executeGoal( "package", m );
+
+        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( "<?xml version=\"1.0\"?><metadata>\n" );
+        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
+        content.append( "  <artifactId>" + ARTIFACTID + "</artifactId>\n" );
+        content.append( "  <versioning>\n" );
+        content.append( "    <latest>" + version + "</latest>\n" );
+        content.append( "    <release>" + version + "</release>\n" );
+        content.append( "    <versions>\n" );
+        content.append( "      <version>" + OLD_VERSION + "</version>\n" );
+        content.append( "      <version>" + NEW_VERSION + "</version>\n" );
+        content.append( "    </versions>\n" );
+        content.append( "    <lastUpdated>" + timestamp + "</lastUpdated>\n" );
+        content.append( "  </versioning>\n" );
+        content.append( "</metadata>" );
+
+        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( "<?xml version=\"1.0\"?><project>\n" );
+        content.append( "  <modelVersion>4.0.0</modelVersion>\n" );
+        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
+        content.append( "  <artifactId>" + ARTIFACTID + "</artifactId>\n" );
+        content.append( "  <version>" + version + "</version>\n" );
+        content.append( "  <packaging>maven-plugin</packaging>\n" );
+        content.append( "</project>" );
+
+        artifact = new File( artifact.getParentFile(), ARTIFACTID + "-" + version + "." + POM_TYPE );
+        FileUtils.fileWrite( artifact.getAbsolutePath(), content.toString() );
+*/
+    }
+}

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenReleaseUpdateITest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/pom.xml?view=auto&rev=492138
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/pom.xml Wed Jan  3 05:28:23 2007
@@ -0,0 +1,44 @@
+<!--
+  ~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <name>Maven Integration Test :: releaseUpdate</name>
+  <groupId>org.apache.maven.its.releaseUpdate</groupId>
+  <artifactId>maven-it-release-update</artifactId>
+  <version>1.0</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.it</groupId>
+        <artifactId>maven-it-release-update</artifactId>
+      </plugin>
+    </plugins>
+  </build>
+  <pluginRepositories>
+    <pluginRepository>
+      <id>it.releases</id>
+      <url>file:///${basedir}/repository</url>
+      <releases>
+        <updatePolicy>always</updatePolicy>
+      </releases>
+    </pluginRepository>
+  </pluginRepositories>
+</project>

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar?view=auto&rev=492138
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar?view=auto&rev=492138
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/releaseUpdate/repository/org/apache/maven/it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Re: svn commit: r492138 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/releaseUpdate/ resources/releaseUpdate/repository/ resources/releaseUpdate/repository/org/ resources/relea...

Posted by Brett Porter <br...@apache.org>.
oh, sorry - misread. Yes, I'll update the POM too - thx.

On 04/01/2007, at 12:57 AM, Brett Porter wrote:

> Yep, the description is right (though I narrowed it down to only  
> plugins, so I'll add that to the description).
>
> - Brett
>
> On 04/01/2007, at 12:38 AM, Jason van Zyl wrote:
>
>> Cool, but could you please keep the description in the POM for the  
>> test updated with the description of what the test actually does.  
>> That's where we tried to transfer what descriptions there were for  
>> the tests we converted.
>>
>> Thanks,
>>
>> Jason.
>>
>>
>> On 3 Jan 07, at 8:28 AM 3 Jan 07, brett@apache.org wrote:
>>
>>> Author: brett
>>> Date: Wed Jan  3 05:28:23 2007
>>> New Revision: 492138
>>>
>>> URL: http://svn.apache.org/viewvc?view=rev&rev=492138
>>> Log:
>>> [MNG-1908] test for regression due to previous fix for MNG-1908
>>>
>>> Added:
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/java/org/apache/maven/integrationtests/ 
>>> MavenReleaseUpdateITest.java   (with props)
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/pom.xml   (with props)
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>>> maven-it-release-update/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>>> maven-it-release-update/1.0/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>>> maven-it-release-update/1.0/maven-it-release-update-1.0.jar    
>>> (with props)
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>>> maven-it-release-update/1.1/
>>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>>> maven-it-release-update/1.1/maven-it-release-update-1.1.jar    
>>> (with props)
>>>
>>> Added: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/java/org/apache/maven/integrationtests/ 
>>> MavenReleaseUpdateITest.java
>>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>>> trunk/core-integration-tests/src/test/java/org/apache/maven/ 
>>> integrationtests/MavenReleaseUpdateITest.java?view=auto&rev=492138
>>> ==================================================================== 
>>> ==========
>>> --- maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/java/org/apache/maven/integrationtests/ 
>>> MavenReleaseUpdateITest.java (added)
>>> +++ maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/java/org/apache/maven/integrationtests/ 
>>> MavenReleaseUpdateITest.java Wed Jan  3 05:28:23 2007
>>> @@ -0,0 +1,135 @@
>>> +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;
>>> +import java.util.HashMap;
>>> +import java.util.Map;
>>> +
>>> +/**
>>> + * Test to verify that a release can be updated.
>>> + */
>>> +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(), "/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 );
>>> +
>>> +        Map m = new HashMap();
>>> +/*
>>> +        m.put( "MAVEN_OPTS",
>>> +               "-Xdebug -Xnoagent -Djava.compiler=NONE - 
>>> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" );
>>> +*/
>>> +        verifier.executeGoal( "package", m );
>>> +
>>> +        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( "<?xml version=\"1.0\"?><metadata>\n" );
>>> +        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
>>> +        content.append( "  <artifactId>" + ARTIFACTID + "</ 
>>> artifactId>\n" );
>>> +        content.append( "  <versioning>\n" );
>>> +        content.append( "    <latest>" + version + "</latest>\n" );
>>> +        content.append( "    <release>" + version + "</release> 
>>> \n" );
>>> +        content.append( "    <versions>\n" );
>>> +        content.append( "      <version>" + OLD_VERSION + "</ 
>>> version>\n" );
>>> +        content.append( "      <version>" + NEW_VERSION + "</ 
>>> version>\n" );
>>> +        content.append( "    </versions>\n" );
>>> +        content.append( "    <lastUpdated>" + timestamp + "</ 
>>> lastUpdated>\n" );
>>> +        content.append( "  </versioning>\n" );
>>> +        content.append( "</metadata>" );
>>> +
>>> +        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( "<?xml version=\"1.0\"?><project>\n" );
>>> +        content.append( "  <modelVersion>4.0.0</modelVersion>\n" );
>>> +        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
>>> +        content.append( "  <artifactId>" + ARTIFACTID + "</ 
>>> artifactId>\n" );
>>> +        content.append( "  <version>" + version + "</version>\n" );
>>> +        content.append( "  <packaging>maven-plugin</packaging> 
>>> \n" );
>>> +        content.append( "</project>" );
>>> +
>>> +        artifact = new File( artifact.getParentFile(),  
>>> ARTIFACTID + "-" + version + "." + POM_TYPE );
>>> +        FileUtils.fileWrite( artifact.getAbsolutePath(),  
>>> content.toString() );
>>> +*/
>>> +    }
>>> +}
>>>
>>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/java/org/apache/maven/integrationtests/ 
>>> MavenReleaseUpdateITest.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Added: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/resources/releaseUpdate/pom.xml
>>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>>> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
>>> pom.xml?view=auto&rev=492138
>>> ==================================================================== 
>>> ==========
>>> --- maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/pom.xml (added)
>>> +++ maven/core-integration-testing/trunk/core-integration-tests/ 
>>> src/test/resources/releaseUpdate/pom.xml Wed Jan  3 05:28:23 2007
>>> @@ -0,0 +1,44 @@
>>> +<!--
>>> +  ~ 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 xmlns="http://maven.apache.org/POM/4.0.0"  
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  
>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>> +  <modelVersion>4.0.0</modelVersion>
>>> +  <name>Maven Integration Test :: releaseUpdate</name>
>>> +  <groupId>org.apache.maven.its.releaseUpdate</groupId>
>>> +  <artifactId>maven-it-release-update</artifactId>
>>> +  <version>1.0</version>
>>> +  <build>
>>> +    <plugins>
>>> +      <plugin>
>>> +        <groupId>org.apache.maven.it</groupId>
>>> +        <artifactId>maven-it-release-update</artifactId>
>>> +      </plugin>
>>> +    </plugins>
>>> +  </build>
>>> +  <pluginRepositories>
>>> +    <pluginRepository>
>>> +      <id>it.releases</id>
>>> +      <url>file:///${basedir}/repository</url>
>>> +      <releases>
>>> +        <updatePolicy>always</updatePolicy>
>>> +      </releases>
>>> +    </pluginRepository>
>>> +  </pluginRepositories>
>>> +</project>
>>>
>>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/resources/releaseUpdate/pom.xml
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Added: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/resources/releaseUpdate/repository/org/apache/ 
>>> maven/it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar
>>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>>> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
>>> repository/org/apache/maven/it/maven-it-release-update/1.0/maven- 
>>> it-release-update-1.0.jar?view=auto&rev=492138
>>> ==================================================================== 
>>> ==========
>>> Binary file - no diff available.
>>>
>>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/resources/releaseUpdate/repository/org/apache/ 
>>> maven/it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:mime-type = application/octet-stream
>>>
>>> Added: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/resources/releaseUpdate/repository/org/apache/ 
>>> maven/it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar
>>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>>> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
>>> repository/org/apache/maven/it/maven-it-release-update/1.1/maven- 
>>> it-release-update-1.1.jar?view=auto&rev=492138
>>> ==================================================================== 
>>> ==========
>>> Binary file - no diff available.
>>>
>>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>>> tests/src/test/resources/releaseUpdate/repository/org/apache/ 
>>> maven/it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:mime-type = application/octet-stream
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r492138 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/releaseUpdate/ resources/releaseUpdate/repository/ resources/releaseUpdate/repository/org/ resources/relea...

Posted by Brett Porter <br...@apache.org>.
Yep, the description is right (though I narrowed it down to only  
plugins, so I'll add that to the description).

- Brett

On 04/01/2007, at 12:38 AM, Jason van Zyl wrote:

> Cool, but could you please keep the description in the POM for the  
> test updated with the description of what the test actually does.  
> That's where we tried to transfer what descriptions there were for  
> the tests we converted.
>
> Thanks,
>
> Jason.
>
>
> On 3 Jan 07, at 8:28 AM 3 Jan 07, brett@apache.org wrote:
>
>> Author: brett
>> Date: Wed Jan  3 05:28:23 2007
>> New Revision: 492138
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=492138
>> Log:
>> [MNG-1908] test for regression due to previous fix for MNG-1908
>>
>> Added:
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/java/org/apache/maven/integrationtests/ 
>> MavenReleaseUpdateITest.java   (with props)
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/pom.xml   (with props)
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/1.0/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/1.0/maven-it-release-update-1.0.jar    
>> (with props)
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/1.1/
>>     maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/1.1/maven-it-release-update-1.1.jar    
>> (with props)
>>
>> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/java/org/apache/maven/integrationtests/ 
>> MavenReleaseUpdateITest.java
>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>> trunk/core-integration-tests/src/test/java/org/apache/maven/ 
>> integrationtests/MavenReleaseUpdateITest.java?view=auto&rev=492138
>> ===================================================================== 
>> =========
>> --- maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/java/org/apache/maven/integrationtests/ 
>> MavenReleaseUpdateITest.java (added)
>> +++ maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/java/org/apache/maven/integrationtests/ 
>> MavenReleaseUpdateITest.java Wed Jan  3 05:28:23 2007
>> @@ -0,0 +1,135 @@
>> +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;
>> +import java.util.HashMap;
>> +import java.util.Map;
>> +
>> +/**
>> + * Test to verify that a release can be updated.
>> + */
>> +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(), "/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 );
>> +
>> +        Map m = new HashMap();
>> +/*
>> +        m.put( "MAVEN_OPTS",
>> +               "-Xdebug -Xnoagent -Djava.compiler=NONE - 
>> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" );
>> +*/
>> +        verifier.executeGoal( "package", m );
>> +
>> +        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( "<?xml version=\"1.0\"?><metadata>\n" );
>> +        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
>> +        content.append( "  <artifactId>" + ARTIFACTID + "</ 
>> artifactId>\n" );
>> +        content.append( "  <versioning>\n" );
>> +        content.append( "    <latest>" + version + "</latest>\n" );
>> +        content.append( "    <release>" + version + "</release> 
>> \n" );
>> +        content.append( "    <versions>\n" );
>> +        content.append( "      <version>" + OLD_VERSION + "</ 
>> version>\n" );
>> +        content.append( "      <version>" + NEW_VERSION + "</ 
>> version>\n" );
>> +        content.append( "    </versions>\n" );
>> +        content.append( "    <lastUpdated>" + timestamp + "</ 
>> lastUpdated>\n" );
>> +        content.append( "  </versioning>\n" );
>> +        content.append( "</metadata>" );
>> +
>> +        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( "<?xml version=\"1.0\"?><project>\n" );
>> +        content.append( "  <modelVersion>4.0.0</modelVersion>\n" );
>> +        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
>> +        content.append( "  <artifactId>" + ARTIFACTID + "</ 
>> artifactId>\n" );
>> +        content.append( "  <version>" + version + "</version>\n" );
>> +        content.append( "  <packaging>maven-plugin</packaging>\n" );
>> +        content.append( "</project>" );
>> +
>> +        artifact = new File( artifact.getParentFile(), ARTIFACTID  
>> + "-" + version + "." + POM_TYPE );
>> +        FileUtils.fileWrite( artifact.getAbsolutePath(),  
>> content.toString() );
>> +*/
>> +    }
>> +}
>>
>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>> tests/src/test/java/org/apache/maven/integrationtests/ 
>> MavenReleaseUpdateITest.java
>> --------------------------------------------------------------------- 
>> ---------
>>     svn:eol-style = native
>>
>> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/pom.xml
>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
>> pom.xml?view=auto&rev=492138
>> ===================================================================== 
>> =========
>> --- maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/pom.xml (added)
>> +++ maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/pom.xml Wed Jan  3 05:28:23 2007
>> @@ -0,0 +1,44 @@
>> +<!--
>> +  ~ 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 xmlns="http://maven.apache.org/POM/4.0.0"  
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  
>> http://maven.apache.org/maven-v4_0_0.xsd">
>> +  <modelVersion>4.0.0</modelVersion>
>> +  <name>Maven Integration Test :: releaseUpdate</name>
>> +  <groupId>org.apache.maven.its.releaseUpdate</groupId>
>> +  <artifactId>maven-it-release-update</artifactId>
>> +  <version>1.0</version>
>> +  <build>
>> +    <plugins>
>> +      <plugin>
>> +        <groupId>org.apache.maven.it</groupId>
>> +        <artifactId>maven-it-release-update</artifactId>
>> +      </plugin>
>> +    </plugins>
>> +  </build>
>> +  <pluginRepositories>
>> +    <pluginRepository>
>> +      <id>it.releases</id>
>> +      <url>file:///${basedir}/repository</url>
>> +      <releases>
>> +        <updatePolicy>always</updatePolicy>
>> +      </releases>
>> +    </pluginRepository>
>> +  </pluginRepositories>
>> +</project>
>>
>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>> tests/src/test/resources/releaseUpdate/pom.xml
>> --------------------------------------------------------------------- 
>> ---------
>>     svn:eol-style = native
>>
>> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/1.0/maven-it-release-update-1.0.jar
>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
>> repository/org/apache/maven/it/maven-it-release-update/1.0/maven- 
>> it-release-update-1.0.jar?view=auto&rev=492138
>> ===================================================================== 
>> =========
>> Binary file - no diff available.
>>
>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>> tests/src/test/resources/releaseUpdate/repository/org/apache/maven/ 
>> it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar
>> --------------------------------------------------------------------- 
>> ---------
>>     svn:mime-type = application/octet-stream
>>
>> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
>> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
>> maven-it-release-update/1.1/maven-it-release-update-1.1.jar
>> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
>> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
>> repository/org/apache/maven/it/maven-it-release-update/1.1/maven- 
>> it-release-update-1.1.jar?view=auto&rev=492138
>> ===================================================================== 
>> =========
>> Binary file - no diff available.
>>
>> Propchange: maven/core-integration-testing/trunk/core-integration- 
>> tests/src/test/resources/releaseUpdate/repository/org/apache/maven/ 
>> it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar
>> --------------------------------------------------------------------- 
>> ---------
>>     svn:mime-type = application/octet-stream
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r492138 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/releaseUpdate/ resources/releaseUpdate/repository/ resources/releaseUpdate/repository/org/ resources/relea...

Posted by Jason van Zyl <ja...@maven.org>.
Cool, but could you please keep the description in the POM for the  
test updated with the description of what the test actually does.  
That's where we tried to transfer what descriptions there were for  
the tests we converted.

Thanks,

Jason.


On 3 Jan 07, at 8:28 AM 3 Jan 07, brett@apache.org wrote:

> Author: brett
> Date: Wed Jan  3 05:28:23 2007
> New Revision: 492138
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=492138
> Log:
> [MNG-1908] test for regression due to previous fix for MNG-1908
>
> Added:
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/java/org/apache/maven/integrationtests/ 
> MavenReleaseUpdateITest.java   (with props)
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/pom.xml   (with props)
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/it/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/it/maven- 
> it-release-update/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/it/maven- 
> it-release-update/1.0/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/it/maven- 
> it-release-update/1.0/maven-it-release-update-1.0.jar   (with props)
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/it/maven- 
> it-release-update/1.1/
>     maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/repository/org/apache/maven/it/maven- 
> it-release-update/1.1/maven-it-release-update-1.1.jar   (with props)
>
> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
> src/test/java/org/apache/maven/integrationtests/ 
> MavenReleaseUpdateITest.java
> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
> trunk/core-integration-tests/src/test/java/org/apache/maven/ 
> integrationtests/MavenReleaseUpdateITest.java?view=auto&rev=492138
> ====================================================================== 
> ========
> --- maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/java/org/apache/maven/integrationtests/ 
> MavenReleaseUpdateITest.java (added)
> +++ maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/java/org/apache/maven/integrationtests/ 
> MavenReleaseUpdateITest.java Wed Jan  3 05:28:23 2007
> @@ -0,0 +1,135 @@
> +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;
> +import java.util.HashMap;
> +import java.util.Map;
> +
> +/**
> + * Test to verify that a release can be updated.
> + */
> +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(), "/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 );
> +
> +        Map m = new HashMap();
> +/*
> +        m.put( "MAVEN_OPTS",
> +               "-Xdebug -Xnoagent -Djava.compiler=NONE - 
> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" );
> +*/
> +        verifier.executeGoal( "package", m );
> +
> +        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( "<?xml version=\"1.0\"?><metadata>\n" );
> +        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
> +        content.append( "  <artifactId>" + ARTIFACTID + "</ 
> artifactId>\n" );
> +        content.append( "  <versioning>\n" );
> +        content.append( "    <latest>" + version + "</latest>\n" );
> +        content.append( "    <release>" + version + "</release>\n" );
> +        content.append( "    <versions>\n" );
> +        content.append( "      <version>" + OLD_VERSION + "</ 
> version>\n" );
> +        content.append( "      <version>" + NEW_VERSION + "</ 
> version>\n" );
> +        content.append( "    </versions>\n" );
> +        content.append( "    <lastUpdated>" + timestamp + "</ 
> lastUpdated>\n" );
> +        content.append( "  </versioning>\n" );
> +        content.append( "</metadata>" );
> +
> +        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( "<?xml version=\"1.0\"?><project>\n" );
> +        content.append( "  <modelVersion>4.0.0</modelVersion>\n" );
> +        content.append( "  <groupId>" + GROUPID + "</groupId>\n" );
> +        content.append( "  <artifactId>" + ARTIFACTID + "</ 
> artifactId>\n" );
> +        content.append( "  <version>" + version + "</version>\n" );
> +        content.append( "  <packaging>maven-plugin</packaging>\n" );
> +        content.append( "</project>" );
> +
> +        artifact = new File( artifact.getParentFile(), ARTIFACTID  
> + "-" + version + "." + POM_TYPE );
> +        FileUtils.fileWrite( artifact.getAbsolutePath(),  
> content.toString() );
> +*/
> +    }
> +}
>
> Propchange: maven/core-integration-testing/trunk/core-integration- 
> tests/src/test/java/org/apache/maven/integrationtests/ 
> MavenReleaseUpdateITest.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
> src/test/resources/releaseUpdate/pom.xml
> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
> pom.xml?view=auto&rev=492138
> ====================================================================== 
> ========
> --- maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/pom.xml (added)
> +++ maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/resources/releaseUpdate/pom.xml Wed Jan  3 05:28:23 2007
> @@ -0,0 +1,44 @@
> +<!--
> +  ~ 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 xmlns="http://maven.apache.org/POM/4.0.0"  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  
> http://maven.apache.org/maven-v4_0_0.xsd">
> +  <modelVersion>4.0.0</modelVersion>
> +  <name>Maven Integration Test :: releaseUpdate</name>
> +  <groupId>org.apache.maven.its.releaseUpdate</groupId>
> +  <artifactId>maven-it-release-update</artifactId>
> +  <version>1.0</version>
> +  <build>
> +    <plugins>
> +      <plugin>
> +        <groupId>org.apache.maven.it</groupId>
> +        <artifactId>maven-it-release-update</artifactId>
> +      </plugin>
> +    </plugins>
> +  </build>
> +  <pluginRepositories>
> +    <pluginRepository>
> +      <id>it.releases</id>
> +      <url>file:///${basedir}/repository</url>
> +      <releases>
> +        <updatePolicy>always</updatePolicy>
> +      </releases>
> +    </pluginRepository>
> +  </pluginRepositories>
> +</project>
>
> Propchange: maven/core-integration-testing/trunk/core-integration- 
> tests/src/test/resources/releaseUpdate/pom.xml
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
> maven-it-release-update/1.0/maven-it-release-update-1.0.jar
> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
> repository/org/apache/maven/it/maven-it-release-update/1.0/maven-it- 
> release-update-1.0.jar?view=auto&rev=492138
> ====================================================================== 
> ========
> Binary file - no diff available.
>
> Propchange: maven/core-integration-testing/trunk/core-integration- 
> tests/src/test/resources/releaseUpdate/repository/org/apache/maven/ 
> it/maven-it-release-update/1.0/maven-it-release-update-1.0.jar
> ---------------------------------------------------------------------- 
> --------
>     svn:mime-type = application/octet-stream
>
> Added: maven/core-integration-testing/trunk/core-integration-tests/ 
> src/test/resources/releaseUpdate/repository/org/apache/maven/it/ 
> maven-it-release-update/1.1/maven-it-release-update-1.1.jar
> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/ 
> trunk/core-integration-tests/src/test/resources/releaseUpdate/ 
> repository/org/apache/maven/it/maven-it-release-update/1.1/maven-it- 
> release-update-1.1.jar?view=auto&rev=492138
> ====================================================================== 
> ========
> Binary file - no diff available.
>
> Propchange: maven/core-integration-testing/trunk/core-integration- 
> tests/src/test/resources/releaseUpdate/repository/org/apache/maven/ 
> it/maven-it-release-update/1.1/maven-it-release-update-1.1.jar
> ---------------------------------------------------------------------- 
> --------
>     svn:mime-type = application/octet-stream
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org