jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r579997 - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test: java/org/apache/jackrabbit/ocm/manager/inheritance/ java/org/apache/jackrabbit/ocm/testmodel/inheritance/impl/ test-config/ test-config/nodetypes/
Date Thu, 27 Sep 2007 12:52:56 GMT
Author: fmeschbe
Date: Thu Sep 27 05:52:55 2007
New Revision: 579997

URL: http://svn.apache.org/viewvc?rev=579997&view=rev
Log:
JCR-1145 ObjectConverterImpl.getObject(Session, Class, String) may not resolve mapping correctly
for incompletely described mappings

Added:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/inheritance/impl/DocumentExtImpl.java
Modified:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-inheritance.xml
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/nodetypes/custom_nodetypes.xml

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java?rev=579997&r1=579996&r2=579997&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/inheritance/ObjectContentManagerInheritanceConcreteClassTest.java
Thu Sep 27 05:52:55 2007
@@ -25,6 +25,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.ocm.RepositoryLifecycleTestSetup;
 import org.apache.jackrabbit.ocm.TestBase;
+import org.apache.jackrabbit.ocm.exception.JcrMappingException;
 import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
 import org.apache.jackrabbit.ocm.query.Filter;
 import org.apache.jackrabbit.ocm.query.Query;
@@ -32,9 +33,12 @@
 import org.apache.jackrabbit.ocm.testmodel.Atomic;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.CmsObjectImpl;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.ContentImpl;
+import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.DocumentExtImpl;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.DocumentImpl;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.DocumentStream;
 import org.apache.jackrabbit.ocm.testmodel.inheritance.impl.FolderImpl;
+import org.apache.jackrabbit.ocm.testmodel.interfaces.CmsObject;
+import org.apache.jackrabbit.ocm.testmodel.interfaces.Folder;
 
 /**
  * Test inheritance with node type per concrete class (without  discreminator field)
@@ -63,7 +67,7 @@
 
 		cleanUpRepisotory();
 		super.tearDown();
-		
+
 	}
 
 
@@ -73,42 +77,42 @@
 			ObjectContentManager ocm = this.getObjectContentManager();
 
 			//---------------------------------------------------------------------------------------------------------
-			// Insert a  Document 
-			//---------------------------------------------------------------------------------------------------------
		
+			// Insert a  Document
+			//---------------------------------------------------------------------------------------------------------
             DocumentImpl document = new DocumentImpl();
             document.setPath("/document1");
             document.setName("document name");
-            document.setContentType("plain/text"); 
+            document.setContentType("plain/text");
             DocumentStream documentStream = new DocumentStream();
             documentStream.setEncoding("utf-8");
             documentStream.setContent("Test Content".getBytes());
             document.setDocumentStream(documentStream);
-            
+
             ocm.insert(document);
 			ocm.save();
-			
-			
+
+
 			//---------------------------------------------------------------------------------------------------------
 			// Retrieve a document object
-			//---------------------------------------------------------------------------------------------------------
					
+			//---------------------------------------------------------------------------------------------------------
 
 			document = (DocumentImpl) ocm.getObject( "/document1");
 			assertEquals("Document path is invalid", document.getPath(), "/document1");
 			assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
 			assertNotNull("document stream is null", document.getDocumentStream());
 			assertTrue("Invalid document stream ", document.getDocumentStream().getEncoding().equals("utf-8"));
-			
-			
+
+
 			//---------------------------------------------------------------------------------------------------------
 			// Update  a descendant object
-			//---------------------------------------------------------------------------------------------------------
					
+			//---------------------------------------------------------------------------------------------------------
 			document.setName("anotherName");
 			ocm.update(document);
 			ocm.save();
 
 			//---------------------------------------------------------------------------------------------------------
 			// Retrieve the updated descendant object
-			//---------------------------------------------------------------------------------------------------------
					
+			//---------------------------------------------------------------------------------------------------------
 			document = (DocumentImpl) ocm.getObject( "/document1");
 			assertEquals("document name is incorrect", document.getName(), "anotherName");
 			assertEquals("Document path is invalid", document.getPath(), "/document1");
@@ -119,8 +123,8 @@
 			CmsObjectImpl cmsObject = (CmsObjectImpl) ocm.getObject( "/document1");
 			assertEquals("cmsObject name is incorrect", cmsObject.getName(), "anotherName");
 			assertEquals("cmsObject path is invalid", cmsObject.getPath(), "/document1");
-           			
-	
+
+
 		} catch (Exception e) {
 			e.printStackTrace();
 			fail();
@@ -128,68 +132,68 @@
 
 	}
 
-	
+
 	public void testRetrieveCollection() {
 		ObjectContentManager ocm = this.getObjectContentManager();
 
 		//---------------------------------------------------------------------------------------------------------
 		// Insert cmsobjects
-		//---------------------------------------------------------------------------------------------------------
		
+		//---------------------------------------------------------------------------------------------------------
         DocumentImpl document = new DocumentImpl();
         document.setPath("/document1");
         document.setName("document name 1");
-        document.setContentType("plain/text"); 
+        document.setContentType("plain/text");
         DocumentStream documentStream = new DocumentStream();
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content".getBytes());
-        document.setDocumentStream(documentStream);        
+        document.setDocumentStream(documentStream);
         ocm.insert(document);
-        
+
         document = new DocumentImpl();
-        document.setPath("/document2");        
+        document.setPath("/document2");
         document.setName("document name 2");
-        document.setContentType("plain/text"); 
+        document.setContentType("plain/text");
         documentStream = new DocumentStream();
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content".getBytes());
-        document.setDocumentStream(documentStream);       
+        document.setDocumentStream(documentStream);
         ocm.insert(document);
 
         document = new DocumentImpl();
-        document.setPath("/document3");        
+        document.setPath("/document3");
         document.setName("document 3");
-        document.setContentType("plain/text"); 
+        document.setContentType("plain/text");
         documentStream = new DocumentStream();
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content 3".getBytes());
-        document.setDocumentStream(documentStream);       
+        document.setDocumentStream(documentStream);
         ocm.insert(document);
-        
+
         FolderImpl folder = new FolderImpl();
         folder.setPath("/folder1");
         folder.setName("folder1");
         ocm.insert(folder);
- 
 
-        document = new DocumentImpl();        
+
+        document = new DocumentImpl();
         document.setName("document4");
-        document.setContentType("plain/text"); 
+        document.setContentType("plain/text");
         documentStream = new DocumentStream();
         documentStream.setEncoding("utf-8");
         documentStream.setContent("Test Content 4".getBytes());
-        document.setDocumentStream(documentStream);       
+        document.setDocumentStream(documentStream);
 
         FolderImpl subFolder = new FolderImpl();
         subFolder.setName("subfolder");
-        
+
         folder = new FolderImpl();
         folder.setPath("/folder2");
-        folder.setName("folder2");        
+        folder.setName("folder2");
         folder.addChild(document);
         folder.addChild(subFolder);
-        ocm.insert(folder);               		
-        
-        
+        ocm.insert(folder);
+
+
 		Atomic a = new Atomic();
 		a.setPath("/atomic");
 		a.setBooleanPrimitive(true);
@@ -197,9 +201,9 @@
 
 		ocm.save();
 
-		//---------------------------------------------------------------------------------------------------------

+		//---------------------------------------------------------------------------------------------------------
 		// Retrieve Folders found on the root level
-		//---------------------------------------------------------------------------------------------------------
		
+		//---------------------------------------------------------------------------------------------------------
 		QueryManager queryManager = ocm.getQueryManager();
 		Filter filter = queryManager.createFilter(FolderImpl.class);
 		Query query = queryManager.createQuery(filter);
@@ -207,15 +211,15 @@
 		Collection result = ocm.getObjects(query);
 		assertEquals("Invalid number of folders found", result.size(), 2);
 		assertTrue("Invalid item in the collection", this.contains(result, "/folder1",FolderImpl.class));
-		assertTrue("Invalid item in the collection", this.contains(result, "/folder2", FolderImpl.class));
	
-		
-	
-		//---------------------------------------------------------------------------------------------------------

-		// Retrieve Documents 
-		//---------------------------------------------------------------------------------------------------------
		
+		assertTrue("Invalid item in the collection", this.contains(result, "/folder2", FolderImpl.class));
+
+
+		//---------------------------------------------------------------------------------------------------------
+		// Retrieve Documents
+		//---------------------------------------------------------------------------------------------------------
 		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(DocumentImpl.class);
-		
+
 		filter.addLike("name", "document name%");
 		query = queryManager.createQuery(filter);
 
@@ -224,27 +228,27 @@
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));
 
-		
-		//---------------------------------------------------------------------------------------------------------

-		// Retrieve folder2 
-		//---------------------------------------------------------------------------------------------------------

+
+		//---------------------------------------------------------------------------------------------------------
+		// Retrieve folder2
+		//---------------------------------------------------------------------------------------------------------
 		FolderImpl folder2 = (FolderImpl) ocm.getObject( "/folder2");
 		assertNotNull("folder 2 is null", folder2);
 		assertEquals("Invalid number of cms object  found in folder2 children", folder2.getChildren().size()
,2);
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/document4",
DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/subfolder",
FolderImpl.class));
-		
-		
+
+
 		CmsObjectImpl cmsObject = (CmsObjectImpl) ocm.getObject( "/folder2");
 		assertNotNull("folder 2 is null", cmsObject);
 		assertTrue("Invalid instance for folder 2",  cmsObject instanceof FolderImpl);
 		assertEquals("Invalid number of documents  found in folder2 children",  folder2.getChildren().size(),2);
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/document4",
DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(folder2.getChildren(), "/folder2/subfolder",
FolderImpl.class));
-		
-		//---------------------------------------------------------------------------------------------------------

-		// Retrieve Contents (ancestor of Documents) 
-		//---------------------------------------------------------------------------------------------------------
		
+
+		//---------------------------------------------------------------------------------------------------------
+		// Retrieve Contents (ancestor of Documents)
+		//---------------------------------------------------------------------------------------------------------
 		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(ContentImpl.class);
 		filter.addLike("name", "document name%");
@@ -254,11 +258,11 @@
 		assertEquals("Invalid number of documents  found", result.size(),2);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));
-		
-				
-		//---------------------------------------------------------------------------------------------------------

+
+
+		//---------------------------------------------------------------------------------------------------------
 		// Retrieve all cmsobjects found on the root level
-		//---------------------------------------------------------------------------------------------------------
				
+		//---------------------------------------------------------------------------------------------------------
 		queryManager = ocm.getQueryManager();
 		filter = queryManager.createFilter(CmsObjectImpl.class);
 		filter.setScope("/");
@@ -267,68 +271,68 @@
 		result = ocm.getObjects(query);
 		assertEquals("Invalid ancestor object found", result.size(),5);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
-		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));

-		assertTrue("Invalid item in the collection", this.contains(result, "/document3", DocumentImpl.class));
	
-		assertTrue("Invalid item in the collection", this.contains(result, "/folder1",FolderImpl.class));

+		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));
+		assertTrue("Invalid item in the collection", this.contains(result, "/document3", DocumentImpl.class));
+		assertTrue("Invalid item in the collection", this.contains(result, "/folder1",FolderImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/folder2",FolderImpl.class));
 
-		
-		//---------------------------------------------------------------------------------------------------------

+
+		//---------------------------------------------------------------------------------------------------------
 		// Retrieve all cmsobjects found anywhere
-		//---------------------------------------------------------------------------------------------------------
				
+		//---------------------------------------------------------------------------------------------------------
 		queryManager = ocm.getQueryManager();
-		filter = queryManager.createFilter(CmsObjectImpl.class);		
+		filter = queryManager.createFilter(CmsObjectImpl.class);
 		query = queryManager.createQuery(filter);
 
 		result = ocm.getObjects(query);
 		assertEquals("Invalid ancestor object found", result.size(),7);
 		assertTrue("Invalid item in the collection", this.contains(result, "/document1", DocumentImpl.class));
-		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));

+		assertTrue("Invalid item in the collection", this.contains(result, "/document2", DocumentImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/document3", DocumentImpl.class));
-		assertTrue("Invalid item in the collection", this.contains(result, "/folder2/document4",
DocumentImpl.class));		
-		assertTrue("Invalid item in the collection", this.contains(result, "/folder1",FolderImpl.class));

+		assertTrue("Invalid item in the collection", this.contains(result, "/folder2/document4",
DocumentImpl.class));
+		assertTrue("Invalid item in the collection", this.contains(result, "/folder1",FolderImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/folder2",FolderImpl.class));
 		assertTrue("Invalid item in the collection", this.contains(result, "/folder2/subfolder",FolderImpl.class));
-		
+
 	}
-	  
+
 	public void testBeanCollection() {
 		ObjectContentManager ocm = this.getObjectContentManager();
 
 		//---------------------------------------------------------------------------------------------------------
 		// Insert cmsobjects
 		//---------------------------------------------------------------------------------------------------------
-		 FolderImpl folder = new FolderImpl();		
+		 FolderImpl folder = new FolderImpl();
 	     folder.setPath("/mainfolder");
-	     folder.setName("Main folder");        
-	    
+	     folder.setName("Main folder");
+
 	     for (int i=1; i<=100;i++)
 	     {
-	         DocumentImpl document = new DocumentImpl();	        
+	         DocumentImpl document = new DocumentImpl();
 	         document.setName("document" + i);
-	         document.setContentType("plain/text"); 
+	         document.setContentType("plain/text");
 	         DocumentStream documentStream = new DocumentStream();
 	         documentStream.setEncoding("utf-8");
 	         documentStream.setContent("Test Content".getBytes());
 	         document.setDocumentStream(documentStream);
 	         folder.addChild(document);
-	         
+
 	         FolderImpl subFolder = new FolderImpl();
 	         subFolder.setName("folder" + i);
 	         subFolder.addChild(document);
 	         folder.addChild(subFolder);
-	         	    	 
+
 	     }
-	     log.debug("Save the folder and its 200 children");   
+	     log.debug("Save the folder and its 200 children");
 	     ocm.insert(folder);
 	     ocm.save();
 	     log.debug("End - Save the folder and its 200 children");
 
-		//---------------------------------------------------------------------------------------------------------

+		//---------------------------------------------------------------------------------------------------------
 		// Retrieve Folder
-		//---------------------------------------------------------------------------------------------------------
		
+		//---------------------------------------------------------------------------------------------------------
 		folder  = (FolderImpl) ocm.getObject("/mainfolder");
-		assertNotNull("Folder is null",folder);		
+		assertNotNull("Folder is null",folder);
 		Collection children = folder.getChildren();
 		assertEquals("Invalid number of children", children.size(), 200);
 	     for (int i=1; i<=100;i++)
@@ -336,7 +340,108 @@
 		     assertTrue("Invalid item in the collection : " +"/mainfolder/document" + i , this.contains(children,
"/mainfolder/document" + i,DocumentImpl.class));
 		    assertTrue("Invalid item in the collection : " + "/mainfolder/folder" + i, this.contains(children,
"/mainfolder/folder" + i, FolderImpl.class));
 	     }
-		
-	
-	}	
+
+
+	}
+
+
+	public void testRetrieveExtension() {
+
+	    try {
+	        ObjectContentManager ocm = this.getObjectContentManager();
+
+	        //---------------------------------------------------------------------------------------------------------
+	        // Insert a  Document
+	        //---------------------------------------------------------------------------------------------------------
+	        DocumentImpl document = new DocumentImpl();
+	        document.setPath("/document1");
+	        document.setName("document name");
+	        document.setContentType("plain/text");
+	        DocumentStream documentStream = new DocumentStream();
+	        documentStream.setEncoding("utf-8");
+	        documentStream.setContent("Test Content".getBytes());
+	        document.setDocumentStream(documentStream);
+
+	        ocm.insert(document);
+	        ocm.save();
+
+
+	        //---------------------------------------------------------------------------------------------------------
+	        // Retrieve a document object
+	        //---------------------------------------------------------------------------------------------------------
+
+	        CmsObject cmsObject = (CmsObject) ocm.getObject( CmsObject.class, "/document1" );
+	        assertNotNull("Document not loaded", cmsObject);
+	        assertTrue("Document of wrong type " + cmsObject.getClass().getName(), cmsObject
instanceof DocumentImpl);
+
+	        document = (DocumentImpl) cmsObject;
+	        assertEquals("Document path is invalid", document.getPath(), "/document1");
+	        assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
+	        assertNotNull("document stream is null", document.getDocumentStream());
+	        assertTrue("Invalid document stream ", document.getDocumentStream().getEncoding().equals("utf-8"));
+
+
+	        //---------------------------------------------------------------------------------------------------------
+	        // Retrieve a document object
+	        //---------------------------------------------------------------------------------------------------------
+
+	        try {
+	            Class clazz = Folder.class;
+	            cmsObject = (CmsObject) ocm.getObject( clazz, "/document1" );
+	            fail("Unexpected Mapping for DocumentImpl node to " + clazz);
+	        } catch (JcrMappingException jme) {
+	            // this is expected as class should not be acceptable
+	        }
+
+	    } catch (Exception e) {
+	        e.printStackTrace();
+	        fail();
+	    }
+
+	}
+
+
+    public void testRetrieveExtensionMissingExtends() {
+
+        try {
+            ObjectContentManager ocm = this.getObjectContentManager();
+
+            //---------------------------------------------------------------------------------------------------------
+            // Insert a  Document
+            //---------------------------------------------------------------------------------------------------------
+            DocumentExtImpl document = new DocumentExtImpl();
+            document.setPath("/document1");
+            document.setExtInfo("ext info");
+            document.setName("document name");
+            document.setContentType("plain/text");
+            DocumentStream documentStream = new DocumentStream();
+            documentStream.setEncoding("utf-8");
+            documentStream.setContent("Test Content".getBytes());
+            document.setDocumentStream(documentStream);
+
+            ocm.insert(document);
+            ocm.save();
+
+
+            //---------------------------------------------------------------------------------------------------------
+            // Retrieve a document object
+            //---------------------------------------------------------------------------------------------------------
+
+            CmsObject cmsObject = (CmsObject) ocm.getObject( CmsObject.class, "/document1"
);
+            assertNotNull("Document not loaded", cmsObject);
+            assertTrue("Document of wrong type " + cmsObject.getClass().getName(), cmsObject
instanceof DocumentExtImpl);
+
+            document = (DocumentExtImpl) cmsObject;
+            assertEquals("Document path is invalid", document.getPath(), "/document1");
+            assertEquals("Ext Info is invalid", document.getExtInfo(), "ext info");
+            assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
+            assertNotNull("document stream is null", document.getDocumentStream());
+            assertTrue("Invalid document stream ", document.getDocumentStream().getEncoding().equals("utf-8"));
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+
+    }
 }

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/inheritance/impl/DocumentExtImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/inheritance/impl/DocumentExtImpl.java?rev=579997&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/inheritance/impl/DocumentExtImpl.java
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/inheritance/impl/DocumentExtImpl.java
Thu Sep 27 05:52:55 2007
@@ -0,0 +1,32 @@
+/*
+ * $Url: $
+ * $Id: $
+ *
+ * Copyright 1997-2005 Day Management AG
+ * Barfuesserplatz 6, 4001 Basel, Switzerland
+ * All Rights Reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Day Management AG, ("Confidential Information"). You shall not
+ * disclose such Confidential Information and shall use it only in
+ * accordance with the terms of the license agreement you entered into
+ * with Day.
+ */
+package org.apache.jackrabbit.ocm.testmodel.inheritance.impl;
+
+/**
+ * Simple extension to the DocumentImpl class
+ */
+public class DocumentExtImpl extends DocumentImpl {
+
+    private String extInfo;
+
+    public String getExtInfo() {
+        return extInfo;
+    }
+
+    public void setExtInfo(String extInfo) {
+        this.extInfo = extInfo;
+    }
+
+}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-inheritance.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-inheritance.xml?rev=579997&r1=579996&r2=579997&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-inheritance.xml
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/jcrmapping-inheritance.xml
Thu Sep 27 05:52:55 2007
@@ -93,6 +93,21 @@
 		<field-descriptor fieldName="content" jcrName="ocm:binarycontent" />
 	</class-descriptor>     
 	
+    <class-descriptor className="org.apache.jackrabbit.ocm.testmodel.inheritance.impl.DocumentExtImpl"
jcrType="ocm:documentextimpl" discriminator="false" >
+        <field-descriptor fieldName="extInfo" jcrName="ocm:extinfo" />  
+
+        <!-- copy of CmsObjectImpl && DocumentImpl -->
+        <field-descriptor fieldName="path" path="true" />
+        <field-descriptor fieldName="name" jcrName="ocm:name"  id="true" />
+        <field-descriptor fieldName="contentType" jcrName="ocm:contenttype" />  
+        <field-descriptor fieldName="size" jcrName="ocm:size" />    
+
+        <bean-descriptor fieldName="documentStream" jcrName="ocm:documentstream" proxy="true"
 />       
+        <bean-descriptor  fieldName="parentFolder"                       
+                          converter="org.apache.jackrabbit.ocm.manager.beanconverter.impl.ParentBeanConverterImpl"
/>
+            
+    </class-descriptor >    
+
 </jackrabbit-ocm>
  
  

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/nodetypes/custom_nodetypes.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/nodetypes/custom_nodetypes.xml?rev=579997&r1=579996&r2=579997&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/nodetypes/custom_nodetypes.xml
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/test-config/nodetypes/custom_nodetypes.xml
Thu Sep 27 05:52:55 2007
@@ -135,6 +135,13 @@
     </childNodeDefinition>        
   </nodeType>
   
+   <nodeType name="ocm:documentextimpl" isMixin="false" hasOrderableChildNodes="false"
primaryItemName="">
+    <supertypes>
+      <supertype>ocm:documentimpl</supertype>
+    </supertypes>    
+    <propertyDefinition name="ocm:extinfo" requiredType="String" autoCreated="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false" />
+  </nodeType>
+  
   <nodeType name="ocm:folderimpl" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
     <supertypes>
       <supertype>ocm:cmsobjectimpl</supertype>       



Mime
View raw message