geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r637732 - in /geronimo/gshell/trunk/gshell-model/src: main/java/org/apache/geronimo/gshell/model/plugin/ test/java/org/apache/geronimo/gshell/model/plugin/ test/resources/org/apache/geronimo/gshell/model/plugin/
Date Mon, 17 Mar 2008 06:05:47 GMT
Author: jdillon
Date: Sun Mar 16 23:05:44 2008
New Revision: 637732

URL: http://svn.apache.org/viewvc?rev=637732&view=rev
Log:
Add some meat to the plugin descriptor model

Added:
    geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/plugin/PluginMarshallerTest.java
      - copied, changed from r637731, geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
    geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/plugin/plugin1.xml
      - copied, changed from r637731, geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml
Modified:
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java?rev=637732&r1=637731&r2=637732&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
Sun Mar 16 23:05:44 2008
@@ -26,6 +26,7 @@
 
 import java.util.List;
 import java.util.ArrayList;
+import java.util.Properties;
 
 /**
  * Plugin model root element.
@@ -36,13 +37,13 @@
 public class Plugin
     extends ModelRoot
 {
-    // ID
+    private String id;
 
-    // Name
+    private String name;
 
-    // Description
+    private String description;
 
-    // Properties
+    private Properties properties;
     
     private List<Dependency> dependencies = new ArrayList<Dependency>();
 
@@ -51,4 +52,64 @@
     // Commands
     
     // Layout
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(final String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(final String description) {
+        this.description = description;
+    }
+
+    public Properties getProperties() {
+        return properties;
+    }
+
+    public void setProperties(final Properties properties) {
+        this.properties = properties;
+    }
+
+    public List<Dependency> dependencies() {
+        return dependencies;
+    }
+
+    public void add(final Dependency dependency) {
+        assert dependency != null;
+
+        if (dependencies == null) {
+            dependencies = new ArrayList<Dependency>();
+        }
+
+        dependencies.add(dependency);
+    }
+
+    public List<DependencyGroup> dependencyGroups() {
+        return dependencyGroups;
+    }
+
+    public void add(final DependencyGroup group) {
+        assert group != null;
+
+        if (dependencyGroups == null) {
+            dependencyGroups = new ArrayList<DependencyGroup>();
+        }
+
+        dependencyGroups.add(group);
+    }
 }

Copied: geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/plugin/PluginMarshallerTest.java
(from r637731, geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/plugin/PluginMarshallerTest.java?p2=geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/plugin/PluginMarshallerTest.java&p1=geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java&r1=637731&r2=637732&rev=637732&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/plugin/PluginMarshallerTest.java
Sun Mar 16 23:05:44 2008
@@ -17,12 +17,14 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.model.application;
+package org.apache.geronimo.gshell.model.plugin;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.gshell.model.common.Dependency;
 import org.apache.geronimo.gshell.model.common.DependencyGroup;
 import org.apache.geronimo.gshell.model.common.SourceRepository;
+import org.apache.geronimo.gshell.model.application.ApplicationMarshaller;
+import org.apache.geronimo.gshell.model.application.Application;
 
 import java.net.URL;
 import java.net.URI;
@@ -30,30 +32,26 @@
 import java.util.Properties;
 
 /**
- * Test for the {@link ApplicationMarshaller} class.
+ * Test for the {@link PluginMarshaller} class.
  *
  * @version $Rev$ $Date$
  */
-public class ApplicationMarshallerTest
+public class PluginMarshallerTest
     extends TestCase
 {
-    private ApplicationMarshaller marshaller = new ApplicationMarshaller();
-    
+    private PluginMarshaller marshaller = new PluginMarshaller();
+
     public void testMarshal1() throws Exception {
-        Application root = new Application();
+        Plugin root = new Plugin();
 
-        root.setId("app.test");
-        root.setName("App Test");
-        root.setDescription("A test app descriptor.");
+        root.setId("plugin.test");
+        root.setName("Plugin Test");
+        root.setDescription("A test plugin descriptor.");
 
         Properties props = new Properties();
         props.setProperty("a", "b");
         root.setProperties(props);
 
-        SourceRepository sr1 = new SourceRepository();
-        sr1.setLocation("foo:bar");
-        root.add(sr1);
-
         Dependency d1 = new Dependency();
         d1.setGroupId("a");
         d1.setArtifactId("b");
@@ -64,7 +62,7 @@
         g1.setGroupId("d");
         g1.setVersion("e");
         root.add(g1);
-        
+
         Dependency d2 = new Dependency();
         d2.setArtifactId("f");
         g1.add(d2);
@@ -81,17 +79,17 @@
     }
 
     public void testUnmarshal1_FromStream() throws Exception {
-        InputStream input = getClass().getResourceAsStream("application1.xml");
+        InputStream input = getClass().getResourceAsStream("plugin1.xml");
 
-        Application root = marshaller.unmarshal(input);
+        Plugin root = marshaller.unmarshal(input);
 
         System.out.println(root);
     }
 
     public void testUnmarshal1_FromURL() throws Exception {
-        URL url = getClass().getResource("application1.xml");
+        URL url = getClass().getResource("plugin1.xml");
 
-        Application root = marshaller.unmarshal(url);
+        Plugin root = marshaller.unmarshal(url);
 
         System.out.println(root);
     }

Copied: geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/plugin/plugin1.xml
(from r637731, geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/plugin/plugin1.xml?p2=geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/plugin/plugin1.xml&p1=geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml&r1=637731&r2=637732&rev=637732&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml
(original)
+++ geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/plugin/plugin1.xml
Sun Mar 16 23:05:44 2008
@@ -20,21 +20,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<application>
-    <id>app.test</id>
-    <name>App Test</name>
-    <description>A test app descriptor.</description>
+<plugin>
+    <id>plugin.test</id>
+    <name>Plugin Test</name>
+    <description>A test plugin descriptor.</description>
 
     <properties>
         <property name="a" value="b"/>
     </properties>
 
-    <sourceRepositories>
-        <sourceRepository>
-            <location>foo:bar</location>
-        </sourceRepository>
-    </sourceRepositories>
-
     <dependencies>
         <dependency>
             <groupId>a</groupId>
@@ -47,15 +41,13 @@
         <dependencyGroup>
             <groupId>d</groupId>
             <version>e</version>
-
             <dependency>
                 <artifactId>f</artifactId>
             </dependency>
-
             <dependency>
                 <artifactId>g</artifactId>
                 <classifier>h</classifier>
             </dependency>
         </dependencyGroup>
     </dependencyGroups>
-</application>
\ No newline at end of file
+</plugin>
\ No newline at end of file



Mime
View raw message