continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r385481 - in /maven/continuum/branches/continuum-1.0.x/continuum-core/src/test: java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java repository/maven-builder-helper-3.xml
Date Mon, 13 Mar 2006 09:55:45 GMT
Author: evenisse
Date: Mon Mar 13 01:55:43 2006
New Revision: 385481

URL: http://svn.apache.org/viewcvs?rev=385481&view=rev
Log:
[CONTINUUM-455] add a test that validate the fix

Added:
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml
  (with props)
Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=385481&r1=385480&r2=385481&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Mon Mar 13 01:55:43 2006
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -98,6 +99,45 @@
         assertEquals( "mail", notifier.getType() );
 
         assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );
+    }
+
+    public void testGetScmUrlWithParams()
+        throws Exception
+    {
+        ContinuumProjectBuilder projectBuilder =
+            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID
);
+
+        File pom = getTestFile( "src/test/repository/maven-builder-helper-3.xml" );
+
+        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL(), null, null );
+
+        assertNotNull( result.getWarnings() );
+
+        assertEquals( 0, result.getWarnings().size() );
+
+        assertNotNull( result.getProjects() );
+
+        assertEquals( 1, result.getProjects().size() );
+
+        Project project = (Project) result.getProjects().get( 0 );
+
+        assertNotNull( project.getNotifiers() );
+
+        assertEquals( 1, project.getNotifiers().size() );
+
+        ProjectNotifier notifier = (ProjectNotifier) project.getNotifiers().get( 0 );
+
+        assertEquals( "mail", notifier.getType() );
+
+        assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );
+
+        String username = System.getProperty( "user.name" );
+
+        String scmUrl = "scm:cvs:ext:${user.name}@company.org:/home/company/cvs:project";
+
+        scmUrl = StringUtils.replace( scmUrl, "${user.name}", username );
+
+        assertEquals( scmUrl, project.getScmUrl() );
     }
 
     public void testCreateProjectsWithModules()

Added: maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml?rev=385481&view=auto
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml
(added)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml
Mon Mar 13 01:55:43 2006
@@ -0,0 +1,22 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>continuum</groupId>
+  <artifactId>foo</artifactId>
+  <version>1.0</version>
+  <ciManagement>
+    <notifiers>
+      <notifier>
+        <configuration>
+          <address>foo@bar</address>
+        </configuration>
+      </notifier>
+    </notifiers>
+  </ciManagement>
+  <scm>
+    <connection>scm:cvs:ext:${user.name}@company.org:/home/company/cvs:${moduleName}</connection>
+    <developerConnection>scm:cvs:ext:${user.name}@company.org:/home/company/cvs:${moduleName}</developerConnection>
+  </scm>
+  <properties>
+    <moduleName>project</moduleName>
+  </properties>
+</project>
\ No newline at end of file

Propchange: maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/branches/continuum-1.0.x/continuum-core/src/test/repository/maven-builder-helper-3.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message