continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r219741 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/configuration/ test/java/org/apache/maven/continuum/configuration/
Date Tue, 19 Jul 2005 18:17:48 GMT
Author: jvanzyl
Date: Tue Jul 19 11:17:46 2005
New Revision: 219741

URL: http://svn.apache.org/viewcvs?rev=219741&view=rev
Log:
o updating the configuration service tests to reflect the model changes for
proflies

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?rev=219741&r1=219740&r2=219741&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
Tue Jul 19 11:17:46 2005
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.profile.ContinuumJdk;
+
 import java.io.File;
 import java.util.Map;
 
@@ -59,7 +61,7 @@
 
     Map getJdks();
 
-    void addJdk( String version, String home );
+    void addJdk( ContinuumJdk jdk );
 
     void setJdks( Map jdks );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=219741&r1=219740&r2=219741&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Tue Jul 19 11:17:46 2005
@@ -6,6 +6,7 @@
 import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
 import org.codehaus.plexus.util.xml.Xpp3DomWriter;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.apache.maven.continuum.profile.ContinuumJdk;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -82,14 +83,14 @@
         return jdks;
     }
 
-    public void addJdk( String jdkVersion, String jdkHome )
+    public void addJdk( ContinuumJdk jdk )
     {
         if ( jdks == null )
         {
             jdks = new TreeMap();
         }
 
-        jdks.put( jdkVersion, jdkHome );
+        jdks.put( jdk.getVersion(), jdk );
     }
 
     public void setJdks( Map jdks )
@@ -136,7 +137,13 @@
 
                 if ( version != null & home != null )
                 {
-                    jdks.put( version, home );
+                    ContinuumJdk jdk = new ContinuumJdk();
+
+                    jdk.setVersion( version );
+
+                    jdk.setHome( home );
+
+                    jdks.put( version, jdk );
                 }
             }
         }
@@ -184,13 +191,13 @@
             {
                 String version = (String) i.next();
 
-                String home = (String) jdks.get( version );
+                ContinuumJdk jdk = (ContinuumJdk) jdks.get( version );
 
                 Xpp3Dom jdkDom = new Xpp3Dom( CONFIGURATION_JDK );
 
                 jdkDom.addChild( createDom( CONFIGURATION_JDK_VERSION, version ) );
 
-                jdkDom.addChild( createDom( CONFIGURATION_JDK_HOME, home ) );
+                jdkDom.addChild( createDom( CONFIGURATION_JDK_HOME, jdk.getHome() ) );
 
                 jdksDom.addChild( jdkDom );
             }

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java?rev=219741&r1=219740&r2=219741&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
Tue Jul 19 11:17:46 2005
@@ -18,6 +18,7 @@
 
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.util.FileUtils;
+import org.apache.maven.continuum.profile.ContinuumJdk;
 
 import java.io.File;
 import java.util.Map;
@@ -52,11 +53,29 @@
 
         assertEquals( "build-output", service.getBuildOutputDirectory().getName() );
 
-        service.addJdk( "1.3", "/jdks/1.3" );
+        ContinuumJdk jdk = new ContinuumJdk();
 
-        service.addJdk( "1.4", "/jdks/1.4" );
+        jdk.setVersion( "1.3" );
 
-        service.addJdk( "1.5", "/jdks/1.5" );
+        jdk.setHome( "/jdks/1.3" );
+
+        service.addJdk( jdk);
+
+        jdk = new ContinuumJdk();
+
+        jdk.setVersion( "1.4" );
+
+        jdk.setHome( "/jdks/1.4" );
+
+        service.addJdk( jdk);
+
+        jdk = new ContinuumJdk();
+
+        jdk.setVersion( "1.5" );
+
+        jdk.setHome( "/jdks/1.5" );
+
+        service.addJdk( jdk);
 
         service.store();
 
@@ -70,14 +89,17 @@
 
         assertNotNull( jdks.get( "1.3" ) );
 
-        assertEquals( "/jdks/1.3", (String) jdks.get( "1.3" ) );
+        jdk = (ContinuumJdk) jdks.get( "1.3" );
+
+        assertEquals( "/jdks/1.3", jdk.getHome() );
+
+        jdk = (ContinuumJdk) jdks.get( "1.4" );
 
-        assertNotNull( jdks.get( "1.4" ) );
+        assertEquals( "/jdks/1.4", jdk.getHome() );
 
-        assertEquals( "/jdks/1.4", (String) jdks.get( "1.4" ) );
+        jdk = (ContinuumJdk) jdks.get( "1.5" );
 
-        assertNotNull( jdks.get( "1.5" ) );
+        assertEquals( "/jdks/1.5", jdk.getHome() );
 
-        assertEquals( "/jdks/1.5", (String) jdks.get( "1.5" ) );
     }
 }



Mime
View raw message