incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r413758 - in /incubator/graffito/trunk/jcr/jcr-mapping/src: java/org/apache/portals/graffito/jcr/mapper/impl/ java/org/apache/portals/graffito/jcr/persistence/impl/ java/org/apache/portals/graffito/jcr/repository/ test/org/apache/portals/gr...
Date Mon, 12 Jun 2006 22:18:07 GMT
Author: clombart
Date: Mon Jun 12 15:18:06 2006
New Revision: 413758

URL: http://svn.apache.org/viewvc?rev=413758&view=rev
Log:
Now, the buildMapper is called in each constructor. 
This will be easier for the Spring support

Modified:
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
Mon Jun 12 15:18:06 2006
@@ -62,6 +62,7 @@
      */
     public DigesterMapperImpl(String xmlFile) {
         this.mappingFiles = new String[] { xmlFile };
+        this.buildMapper();
     }
 
     /**
@@ -72,6 +73,7 @@
      */
     public DigesterMapperImpl(String[] files) {
         this.mappingFiles = files;
+        this.buildMapper();
     }
 
     /**
@@ -81,6 +83,7 @@
      */
     public DigesterMapperImpl(InputStream stream) {
         this.mappingStreams = new InputStream[] { stream };
+        this.buildMapper();
     }
 
     /**
@@ -91,6 +94,7 @@
      */
     public DigesterMapperImpl(InputStream[] streams) {
         this.mappingStreams = streams;
+        this.buildMapper();
     }
 
     /**
@@ -100,6 +104,7 @@
      */
     public void setMappingFile(String file) {
         setMappingFiles(new String[] { file });
+        this.buildMapper();
     }
 
     /**
@@ -122,7 +127,7 @@
         this.descriptorReader = reader;
     }
 
-    public Mapper buildMapper() {
+    private Mapper buildMapper() {
         if (this.descriptorReader == null) {
             this.descriptorReader = new DigesterDescriptorReader();
         }

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java
Mon Jun 12 15:18:06 2006
@@ -117,7 +117,7 @@
     public PersistenceManagerImpl(Session session,String[] xmlMappingFiles ) 
     {
         this.session = session;
-		this.mapper = new DigesterMapperImpl(xmlMappingFiles).buildMapper();
+		this.mapper = new DigesterMapperImpl(xmlMappingFiles);
 		DefaultAtomicTypeConverterProvider converterProvider = new DefaultAtomicTypeConverterProvider();
         Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
 		this.queryManager = new QueryManagerImpl(mapper, atomicTypeConverters);

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java
Mon Jun 12 15:18:06 2006
@@ -44,11 +44,11 @@
     
     /** Graffito namespace prefix constant.
      */
-    private static final String GRAFFITO_NAMESPACE_PREFIX   = "graffito";
+    public static final String GRAFFITO_NAMESPACE_PREFIX   = "graffito";
 
     /** Graffito namespace constant.
      */
-    private static final String GRAFFITO_NAMESPACE          = "http://incubator.apache.org/graffito";
   
+    public static final String GRAFFITO_NAMESPACE          = "http://incubator.apache.org/graffito";
   
     /** Item path separator */
     public static final String PATH_SEPARATOR = "/";
     

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/TestBase.java
Mon Jun 12 15:18:06 2006
@@ -198,7 +198,7 @@
 		session = RepositoryUtil.login(repository, "superuser", "superuser");
 
 		
-		mapper = new DigesterMapperImpl(files).buildMapper();
+		mapper = new DigesterMapperImpl(files);
         converterProvider = new DefaultAtomicTypeConverterProvider();
         Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
 		queryManager = new QueryManagerImpl(mapper, atomicTypeConverters);

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java
Mon Jun 12 15:18:06 2006
@@ -69,8 +69,8 @@
 		try {
 
 			Mapper mapper = new DigesterMapperImpl(
-					"./src/test-config/jcrmapping-testmappings.xml")
-					.buildMapper();
+					"./src/test-config/jcrmapping-testmappings.xml");
+					
 			assertNotNull("Mapper is null", mapper);
 
 			ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(A.class);
@@ -106,7 +106,7 @@
 	public void testDiscriminatorSetting() {
 		try {
 
-			Mapper mapper = new DigesterMapperImpl("./src/test-config/jcrmapping-testmappings.xml").buildMapper();
+			Mapper mapper = new DigesterMapperImpl("./src/test-config/jcrmapping-testmappings.xml");
 			assertNotNull("Mapper is null", mapper);
 
 			ClassDescriptor classDescriptor = mapper.getClassDescriptorByNodeType("graffito:C");
@@ -126,7 +126,7 @@
 	public void testMapperOptionalProperties() {
 		try {
 			Mapper mapper = new DigesterMapperImpl(
-					"./src/test-config/jcrmapping.xml").buildMapper();
+					"./src/test-config/jcrmapping.xml");
 			assertNotNull("Mapper is null", mapper);
 
 			ClassDescriptor classDescriptor = mapper
@@ -199,7 +199,7 @@
 					"./src/test-config/jcrmapping-beandescriptor.xml",
 					"./src/test-config/jcrmapping-inheritance.xml" };			
 			
-			Mapper mapper = new DigesterMapperImpl(files).buildMapper();
+			Mapper mapper = new DigesterMapperImpl(files);
 
 			assertNotNull("Mapper is null", mapper);
 
@@ -296,7 +296,7 @@
 					"./src/test-config/jcrmapping-inheritance.xml" };
 			//      		String[] files = {  "./src/test-config/jcrmapping-inheritance.xml"};
 
-			Mapper mapper = new DigesterMapperImpl(files).buildMapper();
+			Mapper mapper = new DigesterMapperImpl(files);
 
 			assertNotNull("Mapper is null", mapper);
 
@@ -357,7 +357,7 @@
 	public void testInterfaceWithDiscriminator() {
 		try {
 			String[] files = {"./src/test-config/jcrmapping-inheritance.xml"};
-			Mapper mapper = new DigesterMapperImpl(files).buildMapper();
+			Mapper mapper = new DigesterMapperImpl(files);
 
 			assertNotNull("Mapper is null", mapper);
 			ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(Interface.class);
@@ -397,7 +397,7 @@
 	{
 		try {
 			String[] files = {"./src/test-config/jcrmapping-inheritance.xml"};
-			Mapper mapper = new DigesterMapperImpl(files).buildMapper();
+			Mapper mapper = new DigesterMapperImpl(files);
 
 			assertNotNull("Mapper is null", mapper);
 			ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(CmsObject.class);
@@ -449,8 +449,7 @@
 		try {
 			String[] files = { "./src/test-config/jcrmapping-proxy.xml" };
 
-			Mapper mapper = new DigesterMapperImpl(files).buildMapper();
-
+			Mapper mapper = new DigesterMapperImpl(files);
 			assertNotNull("Mapper is null", mapper);
 
 			ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(Main.class);

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/auto/PersistenceManagerAutoTest.java
Mon Jun 12 15:18:06 2006
@@ -159,7 +159,7 @@
 		session = RepositoryUtil.login(repository, "superuser", "superuser");
 
 		
-		mapper = new DigesterMapperImpl(files).buildMapper();
+		mapper = new DigesterMapperImpl(files);
         converterProvider = new DefaultAtomicTypeConverterProvider();
         Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
 		queryManager = new QueryManagerImpl(mapper, atomicTypeConverters);

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java?rev=413758&r1=413757&r2=413758&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/basic/PersistenceManagerSameNameSiblingTest.java
Mon Jun 12 15:18:06 2006
@@ -224,7 +224,7 @@
 		session = RepositoryUtil.login(repository, "superuser", "superuser");
 
 		
-		mapper = new DigesterMapperImpl(files).buildMapper();
+		mapper = new DigesterMapperImpl(files);
         converterProvider = new DefaultAtomicTypeConverterProvider();
         Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
 		queryManager = new QueryManagerImpl(mapper, atomicTypeConverters);



Mime
View raw message