continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r502389 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/project/builder/maven/ test/java/org/apache/maven/continuum/project/builder/maven/ test/resources/projects/continuum/
Date Thu, 01 Feb 2007 22:48:57 GMT
Author: evenisse
Date: Thu Feb  1 14:48:56 2007
New Revision: 502389

URL: http://svn.apache.org/viewvc?view=rev&rev=502389
Log:
Allow to add a pom with a file name that isn't pom.xml

Added:
    maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml
  (with props)
Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?view=diff&rev=502389&r1=502388&r2=502389
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
Thu Feb  1 14:48:56 2007
@@ -236,16 +236,20 @@
 
         int i = prefix.indexOf( '?' );
 
+        int lastSlash;
+
         if ( i != -1 )
         {
             suffix = prefix.substring( i );
 
-            prefix = prefix.substring( 0, i - POM_PART.length() );
+            lastSlash = prefix.lastIndexOf( "/", i );
         }
         else
         {
-            prefix = prefix.substring( 0, prefix.length() - POM_PART.length() );
+            lastSlash = prefix.lastIndexOf( "/" );
         }
+
+        prefix = prefix.substring( 0, lastSlash );
 
         for ( Iterator it = modules.iterator(); it.hasNext(); )
         {

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?view=diff&rev=502389&r1=502388&r2=502389
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Thu Feb  1 14:48:56 2007
@@ -252,6 +252,100 @@
         assertDependency( "Continuum Model", "Continuum Web", projects );
     }
 
+    public void testCreateProjectsWithModuleswithParentPomIsntPomXml()
+        throws Exception
+    {
+        ContinuumProjectBuilder projectBuilder =
+            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID
);
+
+        URL url = getClass().getClassLoader().getResource( "projects/continuum/pom_ci.xml"
);
+
+        // Eat System.out
+        PrintStream ps = System.out;
+
+        ContinuumProjectBuildingResult result;
+
+        try
+        {
+            System.setOut( new PrintStream( new ByteArrayOutputStream() ) );
+
+            result = projectBuilder.buildProjectsFromMetadata( url, null, null );
+        }
+        finally
+        {
+            System.setOut( ps );
+        }
+
+        assertNotNull( result );
+
+        // ----------------------------------------------------------------------
+        // Assert the warnings
+        // ----------------------------------------------------------------------
+
+        assertNotNull( result.getErrors() );
+
+        assertEquals( 1, result.getErrors().size() );
+
+        assertEquals( ContinuumProjectBuildingResult.ERROR_POM_NOT_FOUND, result.getErrors().get(
0 ).toString() );
+
+        // ----------------------------------------------------------------------
+        // Assert the project group built
+        // ----------------------------------------------------------------------
+
+        assertNotNull( result.getProjectGroups() );
+
+        assertEquals( 1, result.getProjectGroups().size() );
+
+        ProjectGroup projectGroup = (ProjectGroup) result.getProjectGroups().iterator().next();
+
+        assertEquals( "projectGroup.groupId", "org.apache.maven.continuum", projectGroup.getGroupId()
);
+
+        assertEquals( "projectGroup.name", "Continuum Parent Project", projectGroup.getName()
);
+
+        assertEquals( "projectGroup.description", "Continuum Project Description", projectGroup.getDescription()
);
+
+        // assertEquals( "projectGroup.url", "http://cvs.continuum.codehaus.org/", projectGroup.getUrl()
);
+
+        // ----------------------------------------------------------------------
+        // Assert the projects built
+        // ----------------------------------------------------------------------
+
+        assertNotNull( result.getProjects() );
+
+        assertEquals( 9, result.getProjects().size() );
+
+        Map projects = new HashMap();
+
+        for ( Iterator it = result.getProjects().iterator(); it.hasNext(); )
+        {
+            Project project = (Project) it.next();
+
+            assertNotNull( project.getName() );
+
+            projects.put( project.getName(), project );
+        }
+
+        assertMavenTwoProject( "Continuum Core", projects );
+        assertMavenTwoProject( "Continuum Model", projects );
+        assertMavenTwoProject( "Continuum Plexus Application", projects );
+        assertScmUrl( "Continuum Web", projects,
+                      "scm:svn:http://svn.apache.org/repos/asf/maven/continuum/tags/continuum-1.0.3/continuum-web"
);
+        //directoryName != artifactId for this project
+        assertScmUrl( "Continuum XMLRPC Interface", projects,
+                      "scm:svn:http://svn.apache.org/repos/asf/maven/continuum/tags/continuum-1.0.3/continuum-xmlrpc"
);
+        assertMavenTwoProject( "Continuum Notifiers", projects );
+        assertMavenTwoProject( "Continuum IRC Notifier", projects );
+        assertMavenTwoProject( "Continuum Jabber Notifier", projects );
+
+        assertEquals( "continuum-parent-notifiers",
+                      ( (Project) projects.get( "Continuum IRC Notifier" ) ).getParent().getArtifactId()
);
+
+        assertEquals( "continuum-parent-notifiers",
+                      ( (Project) projects.get( "Continuum Jabber Notifier" ) ).getParent().getArtifactId()
);
+
+        assertDependency( "Continuum Model", "Continuum Web", projects );
+    }
+
     public void testCreateProjectWithoutModules()
         throws Exception
     {

Added: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml?view=auto&rev=502389
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml
(added)
+++ maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml
Thu Feb  1 14:48:56 2007
@@ -0,0 +1,118 @@
+<!--
+  ~ 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.continuum</groupId>
+  <artifactId>continuum-parent</artifactId>
+  <version>1.0.3</version>
+  <packaging>pom</packaging>
+  <name>Continuum Parent Project</name>
+  <description>Continuum Project Description</description>
+  <url>http://cvs.continuum.codehaus.org/</url>
+  <ciManagement>
+    <system>continuum</system>
+    <url>http://continuum.codehaus.org/continuumweb/servlet/continuum</url>
+    <notifiers>
+      <notifier>
+        <type>mail</type>
+        <address>dev@continuum.codehaus.org</address>
+      </notifier>
+    </notifiers>
+  </ciManagement>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/CONTINUUM</url>
+  </issueManagement>
+  <inceptionYear>2003</inceptionYear>
+  <mailingLists>
+    <mailingList>
+      <name>Continuum Announce List</name>
+      <subscribe>announce-subscribe@continuum.codehaus.org</subscribe>
+      <unsubscribe>announce-unsubscribe@continuum.codehaus.org</unsubscribe>
+      <archive>http://archive.continuum.codehaus.org/</archive>
+    </mailingList>
+    <mailingList>
+      <name>Continuum Despots List</name>
+      <subscribe>despots-subscribe@continuum.codehaus.org</subscribe>
+      <unsubscribe>despots-unsubscribe@continuum.codehaus.org</unsubscribe>
+      <archive>http://archive.continuum.codehaus.org/</archive>
+    </mailingList>
+    <mailingList>
+      <name>Continuum Dev List</name>
+      <subscribe>dev-subscribe@continuum.codehaus.org</subscribe>
+      <unsubscribe>dev-unsubscribe@continuum.codehaus.org</unsubscribe>
+      <archive>http://archive.continuum.codehaus.org/</archive>
+    </mailingList>
+    <mailingList>
+      <name>Continuum User List</name>
+      <subscribe>user-subscribe@continuum.codehaus.org</subscribe>
+      <unsubscribe>user-unsubscribe@continuum.codehaus.org</unsubscribe>
+      <archive>http://archive.continuum.codehaus.org/</archive>
+    </mailingList>
+    <mailingList>
+      <name>Continuum SCM List</name>
+      <subscribe>scm-subscribe@continuum.codehaus.org</subscribe>
+      <unsubscribe>scm-unsubscribe@continuum.codehaus.org</unsubscribe>
+      <archive>http://archive.continuum.codehaus.org/</archive>
+    </mailingList>
+  </mailingLists>
+  <dependencies>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <version>1.0-alpha-2</version>
+    </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.0-alpha-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/continuum/tags/continuum-1.0.3</connection>
+    <url>http://svn.apache.org/viewcvs.cgi/maven/continuum/tags/continuum-1.0.3</url>
+  </scm>
+  <organization>
+    <name>Apache</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+  <distributionManagement>
+    <repository>
+      <id>repo1</id>
+      <name>Maven Repository</name>
+      <url>scp://beaver.codehaus.org/home/projects/maven/repository-staging/to-ibiblio/maven2</url>
+    </repository>
+  </distributionManagement>
+  <modules>
+    <module>continuum-core</module>
+    <module>continuum-model</module>
+    <module>continuum-plexus-application</module>
+    <module>continuum-web</module>
+    <module>continuum-xmlrpc</module>
+    <module>continuum-notifiers</module>
+    <module>I'm-not-here-project</module>
+  </modules>
+</project>

Propchange: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom_ci.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message