geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r572493 - in /geronimo/sandbox/gshell/trunk: ./ gshell-layout/ gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/ gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/ gshell-layout/src/main/mdo/ gshell-layout/src...
Date Tue, 04 Sep 2007 02:31:48 GMT
Author: jdillon
Date: Mon Sep  3 19:31:47 2007
New Revision: 572493

URL: http://svn.apache.org/viewvc?rev=572493&view=rev
Log:
Couldn't get the modello stuff working as desired, so punt on that for now an just use XStream
so we can get the layout manger bits up and going, revisit modello later.

Added:
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout2.xml
      - copied, changed from r572422, geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml
Modified:
    geronimo/sandbox/gshell/trunk/gshell-layout/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-layout/src/main/mdo/layout.mdo
    geronimo/sandbox/gshell/trunk/gshell-layout/src/test/java/org/apache/geronimo/gshell/layout/model/BasicModelValidationTest.java
    geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml
    geronimo/sandbox/gshell/trunk/pom.xml

Modified: geronimo/sandbox/gshell/trunk/gshell-layout/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/pom.xml?rev=572493&r1=572492&r2=572493&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/pom.xml Mon Sep  3 19:31:47 2007
@@ -34,14 +34,22 @@
     <name>GShell Layout</name>
 
     <description>
-        Provides the GShell comamnd filesystem-like layout.
+        Provides the GShell command filesystem-like layout.
     </description>
 
     <dependencies>
         <dependency>
+            <groupId>com.thoughtworks.xstream</groupId>
+            <artifactId>xstream</artifactId>
+            <version>1.2.2</version>
+        </dependency>
+        
+        <!--
+        <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
         </dependency>
+        -->
         
         <dependency>
             <groupId>junit</groupId>
@@ -50,6 +58,7 @@
         </dependency>
     </dependencies>
 
+    <!--
     <build>
         <plugins>
             <plugin>
@@ -88,5 +97,6 @@
             </plugin>
         </plugins>
     </build>
+    -->
 
 </project>

Added: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java?rev=572493&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
Mon Sep  3 19:31:47 2007
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.gshell.layout.model;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("alias")
+public class Alias
+    extends Node
+{
+    protected String command;
+
+    public Alias(final String name, final String command) {
+        super(name);
+
+        assert command != null;
+
+        this.command = command;
+    }
+
+    public String getCommand() {
+        return command;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Alias.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java?rev=572493&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
Mon Sep  3 19:31:47 2007
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.gshell.layout.model;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("command")
+public class Command
+    extends Node
+{
+    protected String implementation;
+
+    public Command(final String name, final String implementation) {
+        super(name);
+
+        assert implementation != null;
+
+        this.implementation = implementation;
+    }
+
+    public String getImplementation() {
+        return implementation;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Command.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java?rev=572493&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
Mon Sep  3 19:31:47 2007
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.gshell.layout.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("group")
+public class Group
+    extends Node
+{
+    protected List<Node> nodes = new ArrayList<Node>();
+
+    public Group(final String name) {
+        super(name);
+    }
+
+    public List<Node> nodes() {
+        return nodes;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Group.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java?rev=572493&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
Mon Sep  3 19:31:47 2007
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.gshell.layout.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("layout")
+public class Layout
+    extends Group
+{
+    public Layout(final String name) {
+        super(name);
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java?rev=572493&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
Mon Sep  3 19:31:47 2007
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.gshell.layout.model;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class Node
+{
+    protected String name;
+
+    protected Node(final String name) {
+        assert name != null;
+        
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/java/org/apache/geronimo/gshell/layout/model/Node.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gshell/trunk/gshell-layout/src/main/mdo/layout.mdo
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/main/mdo/layout.mdo?rev=572493&r1=572492&r2=572493&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/main/mdo/layout.mdo (original)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/main/mdo/layout.mdo Mon Sep  3 19:31:47
2007
@@ -23,6 +23,7 @@
 <model>
     <id>layout</id>
     <name>Layout</name>
+    
     <description>
         Contains the definition of a command/filesystem-like layout.
     </description>
@@ -33,122 +34,127 @@
             <value>org.apache.geronimo.gshell.layout.model</value>
         </default>
     </defaults>
+
+    <interfaces>
+        <interface>
+            <name>Node</name>
+            <version>1.0.0+</version>
+            <description>TODO</description>
+            <codeSegments>
+                <codeSegment>
+                    <version>1.0.0+</version>
+                    <code><![CDATA[
+                        /**
+                         * Returns the name of the current node.
+                         *
+                         * @return The name of the node; never null.
+                         */
+                        String getName();
+                    ]]></code>
+                </codeSegment>
+            </codeSegments>
+        </interface>
+    </interfaces>
     
     <classes>
-        <!--
-        FIXME: This should be abstract, but Modello generates things like "new Node();" in
teh xpp3 stuff :-(
-        
-        <class java.abstract="true">
-        -->
         <class>
-            <name>Node</name>
+            <name>NodeSupport</name>
+            <interfaces>
+                <interface>Node</interface>
+            </interfaces>
             <version>1.0.0+</version>
-            <description>
-                Support for layout nodes
-            </description>
+            <description>TODO</description>
             <fields>
                 <field>
-                    <name>groups</name>
+                    <name>name</name>
                     <version>1.0.0+</version>
-                    <description>
-                    </description>
-                    <association>
-                        <type>Group</type>
+                    <description>TODO</description>
+                    <type>String</type>
+                    <required>true</required>
+                </field>
+            </fields>
+        </class>
+
+        <class>
+            <name>NodeGroup</name>
+            <superClass>NodeSupport</superClass>
+            <version>1.0.0+</version>
+            <description>TODO</description>
+            <fields>
+                <field>
+                    <name>nodes</name>
+                    <version>1.0.0+</version>
+                    <description>TODO</description>
+                    <association java.use-interface="org.apache.geronimo.gshell.layout.model.Node">
+                        <type>Node</type>
                         <multiplicity>*</multiplicity>
                     </association>
                 </field>
-                
+            </fields>
+        </class>
+
+        <class rootElement="true" xml.tagName="layout">
+            <name>Layout</name>
+            <superClass>NodeSupport</superClass>
+            <version>1.0.0+</version>
+            <description>TODO</description>
+            <fields>
                 <field>
-                    <name>commands</name>
+                    <name>nodes</name>
                     <version>1.0.0+</version>
-                    <description>
-                    </description>
-                    <association>
-                        <type>Command</type>
+                    <description>TODO</description>
+                    <association java.use-interface="Node">
+                        <type>Node</type>
                         <multiplicity>*</multiplicity>
                     </association>
                 </field>
-                
+
                 <field>
-                    <name>aliases</name>
+                    <name>groups</name>
                     <version>1.0.0+</version>
-                    <description>
-                    </description>
-                    <association>
-                        <type>Alias</type>
+                    <description>TODO</description>
+                    <association java.use-interface="Node">
+                        <type>NodeGroup</type>
                         <multiplicity>*</multiplicity>
                     </association>
                 </field>
             </fields>
         </class>
         
-        <class rootElement="true" xml.tagName="layout">
-            <name>Layout</name>
-            <superClass>Node</superClass>
-            <version>1.0.0+</version>
-            <description>
-                The root node of the layout.
-            </description>
-        </class>
-        
-        <class>
-            <name>Group</name>
-            <superClass>Node</superClass>
-            <version>1.0.0+</version>
-            <description>
-                Provides a grouping mechanism for layout nodes.
-            </description>
-        </class>
-        
+        <!--
         <class>
             <name>Command</name>
+            <superClass>Node</superClass>
             <version>1.0.0+</version>
-            <description>
-                Defines a command node (kinda like a file).
-            </description>
+            <description>TODO</description>
             <fields>
                 <field>
-                    <name>name</name>
-                    <version>1.0.0+</version>
-                    <description>
-                    </description>
-                    <type>String</type>
-                </field>
-                
-                <field>
-                    <name>implementation</name>
+                    <name>j</name>
+                    <alias>className</alias>
                     <version>1.0.0+</version>
-                    <description>
-                    </description>
+                    <description>TODO</description>
                     <type>String</type>
+                    <required>true</required>
                 </field>
             </fields>
         </class>
         
         <class>
             <name>Alias</name>
+            <superClass>Node</superClass>
             <version>1.0.0+</version>
-            <description>
-                Define a command alias node (kinda like a symlink).
-            </description>
+            <description>TODO</description>
             <fields>
                 <field>
-                    <name>name</name>
-                    <version>1.0.0+</version>
-                    <description>
-                    </description>
-                    <type>String</type>
-                </field>
-                
-                <field>
                     <name>command</name>
                     <version>1.0.0+</version>
-                    <description>
-                    </description>
+                    <description>TODO</description>
                     <type>String</type>
+                    <required>true</required>
                 </field>
             </fields>
         </class>
+        -->
     </classes>
 </model>
 

Modified: geronimo/sandbox/gshell/trunk/gshell-layout/src/test/java/org/apache/geronimo/gshell/layout/model/BasicModelValidationTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/test/java/org/apache/geronimo/gshell/layout/model/BasicModelValidationTest.java?rev=572493&r1=572492&r2=572493&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/test/java/org/apache/geronimo/gshell/layout/model/BasicModelValidationTest.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/test/java/org/apache/geronimo/gshell/layout/model/BasicModelValidationTest.java
Mon Sep  3 19:31:47 2007
@@ -19,8 +19,10 @@
 
 package org.apache.geronimo.gshell.layout.model;
 
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.annotations.Annotations;
+import com.thoughtworks.xstream.io.xml.DomDriver;
 import junit.framework.TestCase;
-import org.apache.geronimo.gshell.layout.model.io.xpp3.LayoutXpp3Reader;
 
 /**
  * Basic validation of the layout model muck.
@@ -30,14 +32,37 @@
 public class BasicModelValidationTest
     extends TestCase
 {
-    LayoutXpp3Reader reader;
+    private XStream xs;
 
     protected void setUp() throws Exception {
-        reader = new LayoutXpp3Reader();
+        xs = new XStream(new DomDriver());
+        Annotations.configureAliases(xs, Layout.class, Command.class, Alias.class);
     }
 
     public void testReadLayout1() throws Exception {
-        Layout layout = reader.read(getClass().getResourceAsStream("layout1.xml"), true);
+        Layout layout = (Layout) xs.fromXML(getClass().getResourceAsStream("layout1.xml"));
         assertNotNull(layout);
+    }
+
+    public void testReadLayout2() throws Exception {
+        Layout layout = (Layout) xs.fromXML(getClass().getResourceAsStream("layout2.xml"));
+        assertNotNull(layout);
+    }
+    
+    public void testDumpLayout1() throws Exception {
+        Layout layout = new Layout("default");
+
+        layout.nodes().add(new Command("foo", "bar"));
+        layout.nodes().add(new Alias("f", "foo"));
+
+        Group g = new  Group("test");
+        g.nodes().add(new Command("a", "b"));
+        g.nodes().add(new Command("c", "d"));
+
+        layout.nodes().add(g);
+        
+        String xml = xs.toXML(layout);
+
+        System.err.println("XML: " + xml);
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml?rev=572493&r1=572492&r2=572493&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml
Mon Sep  3 19:31:47 2007
@@ -19,5 +19,5 @@
 -->
 
 <layout>
-    
+    <name>default</name>
 </layout>

Copied: geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout2.xml
(from r572422, geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout2.xml?p2=geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout2.xml&p1=geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml&r1=572422&r2=572493&rev=572493&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout1.xml
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-layout/src/test/resources/org/apache/geronimo/gshell/layout/model/layout2.xml
Mon Sep  3 19:31:47 2007
@@ -19,5 +19,33 @@
 -->
 
 <layout>
-    
+    <name>default</name>
+
+    <nodes>
+        <command>
+            <name>help</name>
+            <implementation>org.apache.geronimo.gshell.commands.builtins.HelpCommand</implementation>
+        </command>
+
+        <alias>
+            <name>?</name>
+            <command>help</command>
+        </alias>
+        
+        <group>
+            <name>geronimo</name>
+
+            <nodes>
+                <command>
+                    <name>start-server</name>
+                    <implementation>org.apache.geronimo.server.commands.StartServerCommand</implementation>
+                </command>
+
+                <alias>
+                    <name>start</name>
+                    <command>start-server</command>
+                </alias>
+            </nodes>
+        </group>
+    </nodes>
 </layout>

Modified: geronimo/sandbox/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/pom.xml?rev=572493&r1=572492&r2=572493&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/pom.xml Mon Sep  3 19:31:47 2007
@@ -119,6 +119,12 @@
             </dependency>
             
             <dependency>
+                <groupId>com.thoughtworks.xstream</groupId>
+                <artifactId>xstream</artifactId>
+                <version>1.2.2</version>
+            </dependency>
+            
+            <dependency>
                 <groupId>org.antlr</groupId>
                 <artifactId>antlr-runtime</artifactId>
                 <version>3.0</version>



Mime
View raw message