incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r125815 - in incubator/graffito/trunk/components: . src/java/org/apache/portals/graffito/persistence/impl src/java/org/apache/portals/graffito/util src/test/org/apache/portals/graffito/impl src/test/org/apache/portals/graffito/util
Date Thu, 20 Jan 2005 21:33:58 GMT
Author: clombart
Date: Thu Jan 20 13:33:58 2005
New Revision: 125815

URL: http://svn.apache.org/viewcvs?view=rev&rev=125815
Log:
*Move CmsUtil into the API subproject.
* Bug fix in the getServer method with the Master Store server. This server war never found
by the method getServer

Removed:
   incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/util/CmsUtil.java
Modified:
   incubator/graffito/trunk/components/   (props changed)
   incubator/graffito/trunk/components/project.properties
   incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java
   incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
   incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java

Modified: incubator/graffito/trunk/components/project.properties
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/project.properties?view=diff&rev=125815&p1=incubator/graffito/trunk/components/project.properties&r1=125814&p2=incubator/graffito/trunk/components/project.properties&r2=125815
==============================================================================
--- incubator/graffito/trunk/components/project.properties	(original)
+++ incubator/graffito/trunk/components/project.properties	Thu Jan 20 13:33:58 2005
@@ -25,6 +25,7 @@
 #-----------------------------------------------------------------------------------------------------
 # DOC : SITE & PDF DOC
 #-----------------------------------------------------------------------------------------------------
+maven.docs.dest=${basedir}/../../site/components
 
 # Display the date on the Maven web site
 maven.xdoc.date = left

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java?view=diff&rev=125815&p1=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java&r1=125814&p2=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java&r2=125815
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/persistence/impl/ContentPersistenceServiceImpl.java
Thu Jan 20 13:33:58 2005
@@ -444,6 +444,11 @@
      */
     public Server getServer(String scope) throws ContentPersistenceException, CmsPermissionException
     {        
+        if (scope.equals(graffitoMasterServer.getScope()))
+        {
+            return graffitoMasterServer;
+        }
+        
         // All server references are stored into the Graffito Master Store
         ContentStore store = store = getGraffitoMasterStore();
         Filter filter = store.newFilter();

Deleted: /incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/util/CmsUtil.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/util/CmsUtil.java?view=auto&rev=125814
==============================================================================

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java?view=diff&rev=125815&p1=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java&r1=125814&p2=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java&r2=125815
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
Thu Jan 20 13:33:58 2005
@@ -30,6 +30,7 @@
 import org.apache.portals.graffito.ContentServerService;
 import org.apache.portals.graffito.exception.ContentManagementException;
 import org.apache.portals.graffito.model.GraffitoServer;
+import org.apache.portals.graffito.model.Server;
 
 
 
@@ -167,6 +168,27 @@
 
 
     }
+
+    /**
+     * Simple unit on Master Graffito Server objects
+     * 
+     * @throws ContentManagementException - throws when one of the operations fails (insert,
remove,...)
+     */
+    public void testMasterGraffitoServer() throws ContentManagementException
+    {
+
+        log.info("  ************************ Testing Master Content Server ********************************");
+        
+        // ---------------------------------------------------------------------------------------
+        // Get  server
+        // ---------------------------------------------------------------------------------------
        
+        log.info("Get server");
+        Server server = (GraffitoServer) serverService.getServer("/graffitotest"); // graffitotest
is the scope assigned to the Master Store Server
+        assertNotNull("Graffito Master Server is null", server);
+        assertTrue("Incorrect Master Server store", server.getScope().equals("/graffitotest"));
+
+    }
+    
     
     protected String[] getConfigurations()
     {        

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java?view=diff&rev=125815&p1=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java&r1=125814&p2=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java&r2=125815
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/util/TestUriUtil.java
Thu Jan 20 13:33:58 2005
@@ -24,8 +24,6 @@
 import org.apache.portals.graffito.util.CmsUtil;
 import org.apache.portals.graffito.exception.CmsInvalidObjectException;
 
-
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -52,22 +50,21 @@
      * @see junit.framework.TestCase#setUp()
      */
     protected void setUp() throws Exception
-    {        
-    	super.setUp();
-    	
+    {
+        super.setUp();
+
     }
-    
-   
+
     /**
      * @see junit.framework.TestCase#tearDown()
      */
     public void tearDown() throws Exception
-    {        
+    {
         super.tearDown();
-        
+
     }
 
-     public static Test suite()
+    public static Test suite()
     {
         // All methods starting with "test" will be executed in the test suite.
         return new TestSuite(TestUriUtil.class);
@@ -122,9 +119,8 @@
         try
         {
             String parentUri = CmsUtil.getParentUri("/folder1/folder2/test.doc");
-            assertTrue(
-                "ParentUri for '/folder1/folder2/test.doc' should be /folder1/folder2",
-                parentUri.equals("/folder1/folder2"));
+            assertTrue("ParentUri for '/folder1/folder2/test.doc' should be /folder1/folder2",
parentUri
+                    .equals("/folder1/folder2"));
         }
         catch (CmsInvalidObjectException e)
         {
@@ -132,13 +128,31 @@
         }
     }
 
+    public void testServerScope()
+    {
+        try
+        {
+            String scope = CmsUtil.getServerScope("/graffitoserver/test/test.xml");
+            assertTrue("Incorrect scope for /graffitoserver/test/test.xml", scope.equals("/graffitoserver"));
+            
+            scope = CmsUtil.getServerScope("/graffitoserver");
+            assertTrue("Incorrect scope for /graffitoserver", scope.equals("/graffitoserver"));
+            
+        }
+        catch (CmsInvalidObjectException e)
+        {
+            fail("/graffitoserver/test/test.xml should be a correct uri");
+        }
+
+    }
+
     public void testPath()
     {
-          Folder folder = new FolderImpl();
-          folder.setUri("/test1/test2/test3");
-          String path[] = folder.getPath();
-          assertTrue("Incorrect path", path[0].equals("test1"));
-          assertTrue("Incorrect path", path[1].equals("test2"));
-          assertTrue("Incorrect path", path[2].equals("test3"));
+        Folder folder = new FolderImpl();
+        folder.setUri("/test1/test2/test3");
+        String path[] = folder.getPath();
+        assertTrue("Incorrect path", path[0].equals("test1"));
+        assertTrue("Incorrect path", path[1].equals("test2"));
+        assertTrue("Incorrect path", path[2].equals("test3"));
     }
-}
+}
\ No newline at end of file

Mime
View raw message