maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r494678 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/it0110-pluginDependenciesComeFromPluginRepos/ resources/it0111-pluginThatRequiresResourceFromAnExtension/
Date Wed, 10 Jan 2007 01:23:34 GMT
Author: jvanzyl
Date: Tue Jan  9 17:23:33 2007
New Revision: 494678

URL: http://svn.apache.org/viewvc?view=rev&rev=494678
Log:
o the extension test with checkstyle now passes on 2.0.4 and fails with trunk and 2.0.x so
now time to fix

Added:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0108ReleaseUpdateTest.java
  (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0109SnapshotUpdateTest.java
  (with props)
Modified:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0110PluginDependenciesComeFromPluginReposTest.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0110-pluginDependenciesComeFromPluginRepos/pom.xml
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0111-pluginThatRequiresResourceFromAnExtension/pom.xml

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java?view=diff&rev=494678&r1=494677&r2=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
(original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
Tue Jan  9 17:23:33 2007
@@ -117,6 +117,8 @@
         // suite.addTestSuite(MavenIT0106Test.class);
         // suite.addTestSuite(MavenIT0107Test.class);
         suite.addTestSuite( MavenIT0109SnapshotUpdateTest.class );
+        suite.addTestSuite( MavenIT0110PluginDependenciesComeFromPluginReposTest.class );
+        suite.addTestSuite( MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.class
);
         return suite;
     }
 }

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0108ReleaseUpdateTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0108ReleaseUpdateTest.java?view=auto&rev=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0108ReleaseUpdateTest.java
(added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0108ReleaseUpdateTest.java
Tue Jan  9 17:23:33 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 MavenIT0108ReleaseUpdateTest
+    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 );
+
+        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/MavenIT0108ReleaseUpdateTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0108ReleaseUpdateTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0109SnapshotUpdateTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0109SnapshotUpdateTest.java?view=auto&rev=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0109SnapshotUpdateTest.java
(added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0109SnapshotUpdateTest.java
Tue Jan  9 17:23:33 2007
@@ -0,0 +1,73 @@
+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 MavenIT0109SnapshotUpdateTest
+    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();
+    }
+}

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

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0109SnapshotUpdateTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0110PluginDependenciesComeFromPluginReposTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0110PluginDependenciesComeFromPluginReposTest.java?view=diff&rev=494678&r1=494677&r2=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0110PluginDependenciesComeFromPluginReposTest.java
(original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0110PluginDependenciesComeFromPluginReposTest.java
Tue Jan  9 17:23:33 2007
@@ -5,22 +5,16 @@
 
 import java.io.File;
 
-/** #it0104 Commenting out, not fixed until post-2.0.4, due to dependency on new plexus-container-default
version. */
 public class MavenIT0110PluginDependenciesComeFromPluginReposTest
     extends AbstractMavenIntegrationTestCase
 {
-
-    /**
-     * Verify that plugin configurations are resolved correctly, particularly
-     * when they contain ${project.build.directory} in the string value of a
-     * Map.Entry.
-     */
     public void testit0110()
         throws Exception
     {
         File testDir =
             ResourceExtractor.simpleExtractResources( getClass(), "/it0110-pluginDependenciesComeFromPluginRepos"
);
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.deleteArtifact( "org.apache.maven.it", "mail", "1.3.2", "jar" );       

         verifier.executeGoal( "clean" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.java?view=diff&rev=494678&r1=494677&r2=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.java
(original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.java
Tue Jan  9 17:23:33 2007
@@ -1,29 +1,44 @@
 package org.apache.maven.integrationtests;
 
 import java.io.File;
+import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 
-/** #it0104 Commenting out, not fixed until post-2.0.4, due to dependency on new plexus-container-default
version. */
 public class MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest
     extends AbstractMavenIntegrationTestCase
 {
-
-    /**
-     * Verify that plugin configurations are resolved correctly, particularly
-     * when they contain ${project.build.directory} in the string value of a
-     * Map.Entry.
-     */
     public void testit0111()
         throws Exception
     {
         File testDir =
             ResourceExtractor.simpleExtractResources( getClass(), "/it0111-pluginThatRequiresResourceFromAnExtension"
);
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+
+        Verifier verifier;
+
+        // Install the parent POM
+        verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.deleteArtifact( "org.apache.maven.its.it0111", "parent", "1.0", "pom" );
               
+        verifier.deleteArtifact( "org.apache.maven.its.it0111", "checkstyle-test", "1.0",
"jar" );
+        verifier.deleteArtifact( "org.apache.maven.its.it0111", "checkstyle-assembly", "1.0",
"jar" );
+        List cliOptions = new ArrayList();
+        cliOptions.add( "-N" );
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        // Install the extension with the resources required for the test
+        verifier = new Verifier( new File( testDir.getAbsolutePath(), "checkstyle-assembly"
).getAbsolutePath() );
         verifier.executeGoal( "install" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
+        // Run the whole test
+        verifier = new Verifier( new File( testDir.getAbsolutePath(), "checkstyle-test" ).getAbsolutePath()
);
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
     }
 }

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0110-pluginDependenciesComeFromPluginRepos/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0110-pluginDependenciesComeFromPluginRepos/pom.xml?view=diff&rev=494678&r1=494677&r2=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0110-pluginDependenciesComeFromPluginRepos/pom.xml
(original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0110-pluginDependenciesComeFromPluginRepos/pom.xml
Tue Jan  9 17:23:33 2007
@@ -12,21 +12,21 @@
     <issue>MNG-2539</issue>
   </properties>
 
+  <!--
   <repositories>
     <repository>
       <id>javamail-local</id>
       <url>file://${basedir}/repository</url>
     </repository>
   </repositories>
+  -->
 
-  <!--
   <pluginRepositories>
     <pluginRepository>
       <id>javamail-local</id>
       <url>file://${basedir}/repository</url>
     </pluginRepository>
   </pluginRepositories>
-  -->
 
   <build>
     <plugins>

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0111-pluginThatRequiresResourceFromAnExtension/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0111-pluginThatRequiresResourceFromAnExtension/pom.xml?view=diff&rev=494678&r1=494677&r2=494678
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0111-pluginThatRequiresResourceFromAnExtension/pom.xml
(original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0111-pluginThatRequiresResourceFromAnExtension/pom.xml
Tue Jan  9 17:23:33 2007
@@ -5,8 +5,10 @@
   <packaging>pom</packaging>
   <version>1</version>
   <name>Checkstyle</name>
+  <!--
   <modules>
     <module>checkstyle-assembly</module>
     <module>checkstyle-test</module>
   </modules>
+  -->
 </project>



Mime
View raw message