You are viewing a plain text version of this content. The canonical link for it is here.
Posted to graffito-commits@incubator.apache.org by ta...@apache.org on 2005/01/20 22:50:51 UTC

svn commit: r125829 - /incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java

Author: taylor
Date: Thu Jan 20 14:50:50 2005
New Revision: 125829

URL: http://svn.apache.org/viewcvs?view=rev&rev=125829
Log:
basic test for creating FS Servers after merge
Modified:
   incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java

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=125829&p1=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java&r1=125828&p2=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java&r2=125829
==============================================================================
--- 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 14:50:50 2005
@@ -29,6 +29,7 @@
 
 import org.apache.portals.graffito.ContentServerService;
 import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.FileSystemServer;
 import org.apache.portals.graffito.model.GraffitoServer;
 import org.apache.portals.graffito.model.Server;
 
@@ -167,6 +168,64 @@
         serverService.removeServer(server);
 
 
+    }
+
+    /**
+     * Simple unit on File System Server objects : create, add, get, update, remove
+     * 
+     * @throws ContentManagementException - throws when one of the operations fails (insert, remove,...)
+     */
+    public void testFileSystemServer() throws ContentManagementException
+    {
+
+        log.info("  ************************ Testing File System with Content Server service  ****************************");
+        
+        // ----------------------------------------------------------------------------------------
+        // Add Server
+        // --------------------------------------------------------------------------------------                        
+        FileSystemServer server = serverService.createFileSystemServer();
+        server.setAlias("share2"); 
+        server.setDescription("Graffito File System Test 2 Zerver");        
+        server.setScope("/share2");
+        server.setTitle("Graffito FS Test Server");
+        server.setRoot("/home/dtaylor/shares/two/");
+        
+        server.setStoreClassName("org.apache.portals.graffito.store.impl.fs.FileSystemContentStore");
+        
+        log.info("Add FS Store Server");
+        serverService.addServer(server);     
+
+        // ---------------------------------------------------------------------------------------
+        // Get  server
+        // ---------------------------------------------------------------------------------------         
+        log.info("Get FS server");
+        server = (FileSystemServer) serverService.getServer("/share2");
+        assertTrue("Incorrect alias for server 'share2", server.getAlias().equals("share2"));
+        assertTrue("Incorrect root for server 'share2", server.getAlias().equals("/home/dtaylor/shares/two/"));
+
+        // ---------------------------------------------------------------------------------------
+        // Update server
+        // ---------------------------------------------------------------------------------------
+        final String MODIFIED_MESSAGE = "Graffito File System Server Test 2 server modified";
+        log.info("Update FS server");
+        server.setDescription(MODIFIED_MESSAGE);
+        serverService.updateServer(server);        
+
+        
+        // ---------------------------------------------------------------------------------------
+        // Get the modified server
+        // ---------------------------------------------------------------------------------------         
+        log.info("Get the modified FS server");
+        server = (FileSystemServer) serverService.getServer("/share2");
+        assertTrue("Incorrect alias for server '/share2", server.getDescription().equals(MODIFIED_MESSAGE));  
+
+        // ---------------------------------------------------------------------------------------
+        // Remove  server
+        // ---------------------------------------------------------------------------------------         
+        log.info("Remove FS server");
+
+        server = (FileSystemServer) serverService.getServer("/share2");
+        serverService.removeServer(server);
     }
 
     /**