jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r544606 - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test: java/org/apache/jackrabbit/ocm/persistence/basic/ java/org/apache/jackrabbit/ocm/persistence/collectionconverter/ java/org/apache/jackrabbit/ocm/testmodel/c...
Date Tue, 05 Jun 2007 19:36:06 GMT
Author: clombart
Date: Tue Jun  5 12:36:05 2007
New Revision: 544606

URL: http://svn.apache.org/viewvc?view=rev&rev=544606
Log:
1/ Review unit tests. Missing unit tests in AllTest classes.  
2/ Add a new unit test for a custom ArrayList. 
   See the unit test ArrayListTest and the Main class in the pck testmodel.
   the mapping descriptor is in the file jcr-mapping.xml

Added:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/ArrayListTest.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/
      - copied from r543988, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/hashmap/
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/ArrayListElement.java
Removed:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/hashmap/
Modified:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/basic/AllTests.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/AllTests.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/HashMapTest.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/HashMapElement.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-testdigester.xml
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping.xml

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/basic/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/basic/AllTests.java?view=diff&rev=544606&r1=544605&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/basic/AllTests.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/basic/AllTests.java
Tue Jun  5 12:36:05 2007
@@ -36,9 +36,11 @@
     public static Test buildSuite() {
         TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.persistence.basic");
         //$JUnit-BEGIN$
+        suite.addTestSuite(PersistenceManagerAvoidRecursiveLoopTest.class);
+        suite.addTestSuite(PersistenceManagerCopyMoveTest.class);
         suite.addTestSuite(PersistenceManagerRemoveTest.class);
         suite.addTestSuite(PersistenceManagerSameNameSiblingTest.class);
-        suite.addTestSuite(PersistenceManagerTest.class);
+        suite.addTestSuite(PersistenceManagerTest.class);        
         //$JUnit-END$
 
         return suite;

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/AllTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/AllTests.java?view=diff&rev=544606&r1=544605&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/AllTests.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/AllTests.java
Tue Jun  5 12:36:05 2007
@@ -36,8 +36,9 @@
     public static Test buildSuite() {
         TestSuite suite= new TestSuite("Test for org.apache.jackrabbit.ocm.persistence.collectionconverter");
         //$JUnit-BEGIN$
-        suite.addTestSuite(DefaultCollectionConverterImplTest.class);
-        suite.addTestSuite(HashMapTest.class);
+        suite.addTestSuite(ArrayListTest.class);
+        suite.addTestSuite(DefaultCollectionConverterImplTest.class);        
+        suite.addTestSuite(HashMapTest.class);        
         suite.addTestSuite(MultiValueCollectionConverterImplTest.class);
         suite.addTestSuite(NTCollectionConverterImplTest.class);
         suite.addTestSuite(ResidualPropertiesCollectionConverterImplTest.class);

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/ArrayListTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/ArrayListTest.java?view=auto&rev=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/ArrayListTest.java
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/ArrayListTest.java
Tue Jun  5 12:36:05 2007
@@ -0,0 +1,154 @@
+/*
+ * 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.jackrabbit.ocm.persistence.collectionconverter;
+
+import java.util.ArrayList;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.ocm.RepositoryLifecycleTestSetup;
+import org.apache.jackrabbit.ocm.TestBase;
+import org.apache.jackrabbit.ocm.persistence.PersistenceManager;
+import org.apache.jackrabbit.ocm.testmodel.collection.ArrayListElement;
+import org.apache.jackrabbit.ocm.testmodel.collection.Element;
+import org.apache.jackrabbit.ocm.testmodel.collection.Main;
+
+/**
+ * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
+ */
+public class ArrayListTest extends TestBase
+{
+    private final static Log log = LogFactory.getLog(ArrayListTest.class);
+
+    /**
+     * <p>Defines the test case name for junit.</p>
+     * @param testName The test case name.
+     */
+    public ArrayListTest(String testName)  throws Exception
+    {
+        super(testName);
+    }
+
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new RepositoryLifecycleTestSetup(new TestSuite(ArrayListTest.class));
+    }
+
+    
+    /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    public void tearDown() throws Exception
+    {
+        if (getPersistenceManager().objectExists("/test"))
+        {
+            getPersistenceManager().remove("/test");
+            getPersistenceManager().save();
+        }        
+    	
+        super.tearDown();
+    }    
+    
+    public void testArrayList()
+    {
+        try
+        {
+        	PersistenceManager persistenceManager = getPersistenceManager();
+        	
+
+            // --------------------------------------------------------------------------------
+            // Create and store an object graph in the repository
+            // --------------------------------------------------------------------------------
+
+            Main main = new Main();
+            main.setPath("/test");
+            main.setText("Main text");
+            
+            ArrayListElement arrayListElement = new ArrayListElement();
+            Element e1 = new Element();
+            e1.setId("e1");
+            e1.setText("Element 1");
+            arrayListElement.add(e1);
+            
+            Element e2 = new Element();
+            e2.setId("e2");
+            e2.setText("Element 2");
+            arrayListElement.add(e2);
+            
+            main.setList(arrayListElement);
+            
+            persistenceManager.insert(main);
+            persistenceManager.save();
+            
+            // --------------------------------------------------------------------------------
+            // Get the object
+            // --------------------------------------------------------------------------------
          
+            main = (Main) persistenceManager.getObject( "/test");
+            ArrayList arrayList = main.getList();
+            assertNotNull("main.getList is null", arrayList ); 
+            Element[] elements = (Element[]) arrayList.toArray(new Element[arrayList.size()]);
+            assertTrue("Incorrect para element", elements[0].getText().equals("Element 1"));
+            
+            // --------------------------------------------------------------------------------
+            // Update the object
+            // --------------------------------------------------------------------------------
+            arrayListElement = new ArrayListElement();
+            e1 = new Element();
+            e1.setId("e1");
+            e1.setText("Element 1");
+            arrayListElement.add(e1);
+            
+            e2 = new Element();
+            e2.setId("e3");
+            e2.setText("Element 3");
+            arrayListElement.add(e2);
+            
+            Element e3 = new Element();
+            e3.setId("e4");
+            e3.setText("Element 4");
+            arrayListElement.add(e3);
+            
+            main.setList(arrayListElement);            
+            
+            persistenceManager.update(main);
+            persistenceManager.save();
+
+            // --------------------------------------------------------------------------------
+            // Get the object
+            // --------------------------------------------------------------------------------
          
+            main = (Main) persistenceManager.getObject( "/test");
+            arrayList = main.getList();
+            assertNotNull("main.getList() is null", arrayList ); 
+            elements = (Element[]) arrayList.toArray(new Element[arrayList.size()]);
+            assertTrue("Incorrect element", elements[2].getText().equals("Element 4"));
+            
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            fail("Exception occurs during the unit test : " + e);
+        }
+        
+    }
+
+
+   
+}
\ No newline at end of file

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/HashMapTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/HashMapTest.java?view=diff&rev=544606&r1=544605&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/HashMapTest.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/collectionconverter/HashMapTest.java
Tue Jun  5 12:36:05 2007
@@ -24,9 +24,9 @@
 import org.apache.jackrabbit.ocm.RepositoryLifecycleTestSetup;
 import org.apache.jackrabbit.ocm.TestBase;
 import org.apache.jackrabbit.ocm.persistence.PersistenceManager;
-import org.apache.jackrabbit.ocm.testmodel.hashmap.Element;
-import org.apache.jackrabbit.ocm.testmodel.hashmap.HashMapElement;
-import org.apache.jackrabbit.ocm.testmodel.hashmap.Main;
+import org.apache.jackrabbit.ocm.testmodel.collection.Element;
+import org.apache.jackrabbit.ocm.testmodel.collection.HashMapElement;
+import org.apache.jackrabbit.ocm.testmodel.collection.Main;
 
 /**
  * Test NTCollectionConverterImpl
@@ -93,7 +93,7 @@
             e2.setText("Element 2");
             hashMapElement.addObject(e2);
             
-            main.setElements(hashMapElement);
+            main.setHashMap(hashMapElement);
             
             persistenceManager.insert(main);
             persistenceManager.save();
@@ -102,9 +102,9 @@
             // Get the object
             // --------------------------------------------------------------------------------
          
             main = (Main) persistenceManager.getObject( "/test");
-            assertNotNull("main.getElements() is null", main.getElements());
+            assertNotNull("main.getHashMap() is null", main.getHashMap());
             assertTrue("Incorrect text", main.getText().equals("Main text"));           
-            assertTrue("Incorrect para element", ((Element) main.getElements().get("e1")).getText().equals("Element
1"));
+            assertTrue("Incorrect para element", ((Element) main.getHashMap().get("e1")).getText().equals("Element
1"));
             
             // --------------------------------------------------------------------------------
             // Update the object
@@ -124,7 +124,7 @@
             e3.setId("e4");
             e3.setText("Element 4");
             hashMapElement.addObject(e3);
-            main.setElements(hashMapElement);
+            main.setHashMap(hashMapElement);
             
             persistenceManager.update(main);
             persistenceManager.save();
@@ -132,9 +132,9 @@
             // --------------------------------------------------------------------------------
             // Get the object
             // --------------------------------------------------------------------------------
          
-            assertNotNull("main.getElements() is null", main.getElements());
+            assertNotNull("main.getElements() is null", main.getHashMap());
             assertTrue("Incorrect text", main.getText().equals("Main text"));           
-            assertTrue("Incorrect para element", ((Element) main.getElements().get("e4")).getText().equals("Element
4"));
+            assertTrue("Incorrect para element", ((Element) main.getHashMap().get("e4")).getText().equals("Element
4"));
             
         }
         catch (Exception e)

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/ArrayListElement.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/ArrayListElement.java?view=auto&rev=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/ArrayListElement.java
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/ArrayListElement.java
Tue Jun  5 12:36:05 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.jackrabbit.ocm.testmodel.collection;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.apache.jackrabbit.ocm.persistence.collectionconverter.ManageableCollection;
+
+/** 
+ *
+ * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
+ * 
+ */
+public class ArrayListElement extends ArrayList implements ManageableCollection
+{
+
+    /**
+     * @see org.apache.jackrabbit.ocm.persistence.collectionconverter.ManageableCollection#addObject(java.lang.Object)
+     */
+    public void addObject(Object object)
+    {
+        if (object instanceof Element)
+        {
+            this.add(object);
+        }
+    }
+
+    /**
+     * @see org.apache.jackrabbit.ocm.persistence.collectionconverter.ManageableCollection#getIterator()
+     */
+    public Iterator getIterator()
+    {
+       return  this.iterator();
+    }
+    
+	public int getSize()
+	{
+		
+		return this.size();
+	}
+    
+
+}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java?view=diff&rev=544606&r1=543988&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
Tue Jun  5 12:36:05 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.ocm.testmodel.hashmap;
+package org.apache.jackrabbit.ocm.testmodel.collection;
 
 
 /**

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/HashMapElement.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/HashMapElement.java?view=diff&rev=544606&r1=543988&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/HashMapElement.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/HashMapElement.java
Tue Jun  5 12:36:05 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.ocm.testmodel.hashmap;
+package org.apache.jackrabbit.ocm.testmodel.collection;
 
 import java.util.HashMap;
 import java.util.Iterator;

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java?view=diff&rev=544606&r1=543988&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
Tue Jun  5 12:36:05 2007
@@ -14,9 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.ocm.testmodel.hashmap;
+package org.apache.jackrabbit.ocm.testmodel.collection;
 
-import java.util.HashMap;
 
 /**
  *
@@ -27,9 +26,8 @@
 {
 	private String path;
     private String text;
-    private HashMapElement elements;
-    
-    
+    private HashMapElement hashMap;
+    private ArrayListElement list;
     
     public String getPath() {
 		return path;
@@ -40,18 +38,28 @@
 	/**
      * @return Returns the elements.
      */
-    public HashMapElement getElements()
+    public HashMapElement getHashMap()
     {
-        return elements;
+        return hashMap;
     }
     /**
      * @param elements The elements to set.
      */
-    public void setElements(HashMapElement elements)
+    public void setHashMap(HashMapElement hashMap)
     {
-        this.elements = elements;
+        this.hashMap = hashMap;
     }
-    /**
+    
+    public ArrayListElement getList() 
+    {
+		return list;
+	}
+	
+    public void setList(ArrayListElement list) 
+    {
+		this.list = list;
+	}
+	/**
      * @return Returns the text.
      */
     public String getText()

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-testdigester.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-testdigester.xml?view=diff&rev=544606&r1=544605&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-testdigester.xml
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-testdigester.xml
Tue Jun  5 12:36:05 2007
@@ -73,19 +73,24 @@
 
 
 	<class-descriptor
-		className="org.apache.jackrabbit.ocm.testmodel.hashmap.Main"
+		className="org.apache.jackrabbit.ocm.testmodel.collection.Main"
 		jcrNodeType="nt:unstructured">
 		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="text" jcrName="text" />
-		<collection-descriptor fieldName="elements" proxy="false"
-			elementClassName="org.apache.jackrabbit.ocm.testmodel.hashmap.Element"
+		<collection-descriptor fieldName="hashMap" proxy="false"
+			elementClassName="org.apache.jackrabbit.ocm.testmodel.collection.Element"
 			collectionConverter="org.apache.jackrabbit.ocm.persistence.collectionconverter.impl.NTCollectionConverterImpl"
-			collectionClassName="org.apache.jackrabbit.ocm.testmodel.hashmap.HashMapElement" />
+			collectionClassName="org.apache.jackrabbit.ocm.testmodel.collection.HashMapElement" />
+
+		<collection-descriptor fieldName="list" proxy="false"
+			elementClassName="org.apache.jackrabbit.ocm.testmodel.collection.Element"
+			collectionConverter="org.apache.jackrabbit.ocm.persistence.collectionconverter.impl.NTCollectionConverterImpl"
+			collectionClassName="org.apache.jackrabbit.ocm.testmodel.collection.ArrayListElement"
/>
 
 	</class-descriptor>
 
 	<class-descriptor
-		className="org.apache.jackrabbit.ocm.testmodel.hashmap.Element"
+		className="org.apache.jackrabbit.ocm.testmodel.collection.Element"
 		jcrNodeType="ocm:element" discriminator="false">
 		<field-descriptor fieldName="id" jcrName="ocm:id" />
 		<field-descriptor fieldName="text" jcrName="ocm:text" />

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping.xml?view=diff&rev=544606&r1=544605&r2=544606
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping.xml
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping.xml
Tue Jun  5 12:36:05 2007
@@ -82,17 +82,22 @@
 	</class-descriptor>
 
 
-	<class-descriptor className="org.apache.jackrabbit.ocm.testmodel.hashmap.Main" jcrNodeType="nt:unstructured"
 >
+	<class-descriptor
+		className="org.apache.jackrabbit.ocm.testmodel.collection.Main"
+		jcrNodeType="nt:unstructured">
 		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="text" jcrName="text" />
-		<collection-descriptor fieldName="elements"  proxy="false" 
-		                       elementClassName="org.apache.jackrabbit.ocm.testmodel.hashmap.Element"

-		                       collectionConverter="org.apache.jackrabbit.ocm.persistence.collectionconverter.impl.NTCollectionConverterImpl"

-		                       collectionClassName="org.apache.jackrabbit.ocm.testmodel.hashmap.HashMapElement"
/>
-		                       
+		<collection-descriptor fieldName="hashMap" jcrName="hashMap" proxy="false"
+			elementClassName="org.apache.jackrabbit.ocm.testmodel.collection.Element"
+			collectionClassName="org.apache.jackrabbit.ocm.testmodel.collection.HashMapElement" />
+
+		<collection-descriptor fieldName="list" jcrName="list" proxy="false"
+			elementClassName="org.apache.jackrabbit.ocm.testmodel.collection.Element"
+			collectionClassName="org.apache.jackrabbit.ocm.testmodel.collection.ArrayListElement"
/>
+
 	</class-descriptor>
 
-	<class-descriptor className="org.apache.jackrabbit.ocm.testmodel.hashmap.Element" jcrNodeType="ocm:element"
discriminator="false" >
+	<class-descriptor className="org.apache.jackrabbit.ocm.testmodel.collection.Element"
jcrNodeType="ocm:element" discriminator="false" >
 		<field-descriptor fieldName="id" jcrName="ocm:id"  />
 		<field-descriptor fieldName="text" jcrName="ocm:text" />
 	</class-descriptor>



Mime
View raw message