incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r225707 - in /incubator/graffito/trunk/components/src/test/org/apache/portals/graffito: persistence/impl/ security/impl/
Date Thu, 28 Jul 2005 05:45:51 GMT
Author: clombart
Date: Wed Jul 27 22:45:45 2005
New Revision: 225707

URL: http://svn.apache.org/viewcvs?rev=225707&view=rev
Log:
Review object model (see GRFT-25)

Modified:
    incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/persistence/impl/TestPersistenceService.java
    incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllFilesTestRdbmsPolicy.java
    incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllPermissionTestRdbmsPolicy.java
    incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestPermissions.java
    incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestRdbmsPolicy.java

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/persistence/impl/TestPersistenceService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/persistence/impl/TestPersistenceService.java?rev=225707&r1=225706&r2=225707&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/persistence/impl/TestPersistenceService.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/persistence/impl/TestPersistenceService.java
Wed Jul 27 22:45:45 2005
@@ -26,12 +26,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.portals.graffito.model.impl.FolderImpl;
-import org.apache.portals.graffito.persistence.impl.PersistenceSupportedTestCase;
-import org.apache.portals.graffito.model.CmsObject;
-import org.apache.portals.graffito.model.Document;
-import org.apache.portals.graffito.model.Folder;
-import org.apache.portals.graffito.search.Filter;
+import org.apache.portals.graffito.model.core.CmsObject;
+import org.apache.portals.graffito.model.core.Folder;
+import org.apache.portals.graffito.model.core.impl.FolderImpl;
+import org.apache.portals.graffito.model.dm.Document;
+import org.apache.portals.graffito.services.search.Filter;
 
 
 /**
@@ -97,9 +96,7 @@
         FolderImpl folder = new FolderImpl();
         folder.setCreationDate(new Timestamp(System.currentTimeMillis()));
         folder.setLastModified(new Timestamp(System.currentTimeMillis()));
-        folder.setDescription("FolderImpl 1");
         folder.setName("folder1");
-        folder.setTitle("FolderImpl 1 Title");
         folder.setUri("/graffitotest/folder1"); 
 
 
@@ -114,14 +111,14 @@
         
         folder = (FolderImpl) persistenceService.getCmsObject("/graffitotest/folder1");
         assertNotNull("/graffitotest/folder1 is null", folder);
-        assertTrue("Invalid title for /graffitotest/folder1", folder.getTitle().equals("FolderImpl
1 Title"));
+        assertTrue("Invalid name for /graffitotest/folder1", folder.getName().equals("folder1"));
 
         // ----------------------------------------------------------------------------------------
         // Update an object
         // --------------------------------------------------------------------------------------
         
         log.info("Update object");
-        folder.setTitle("FolderImpl 1 Title modified");
+        folder.setProperty("test", "test value");
         persistenceService.update(folder);
 
         // ----------------------------------------------------------------------------------------
@@ -131,7 +128,7 @@
         log.info("Get modified object");
         folder = (FolderImpl) persistenceService.getCmsObject("/graffitotest/folder1");
         assertNotNull("/graffitotest/folder1 is null", folder);
-        assertTrue("Invalid title for /graffitotest/folder1", folder.getTitle().equals("FolderImpl
1 Title modified"));
+        assertTrue("Invalid property for /graffitotest/folder1", folder.getProperty("test").equals("test
value"));
 
         // ----------------------------------------------------------------------------------------
         // Remove folder
@@ -151,10 +148,8 @@
         // --------------------------------------------------------------------------------------
         FolderImpl folder = new FolderImpl();
         folder.setCreationDate(new Timestamp(System.currentTimeMillis()));
-        folder.setLastModified(new Timestamp(System.currentTimeMillis()));
-        folder.setDescription("FolderImpl 1");
+        folder.setLastModified(new Timestamp(System.currentTimeMillis()));        
         folder.setName("folder1");
-        folder.setTitle("FolderImpl 1 Title");
         folder.setUri("/graffitotest/folder1"); 
 
         log.info("Add object 1");
@@ -163,9 +158,7 @@
         folder = new FolderImpl();
         folder.setCreationDate(new Timestamp(System.currentTimeMillis()));
         folder.setLastModified(new Timestamp(System.currentTimeMillis()));
-        folder.setDescription("FolderImpl 2");
         folder.setName("folder2");
-        folder.setTitle("FolderImpl 2 Title");
         folder.setUri("/graffitotest/folder2"); 
 
         log.info("Add object 2");
@@ -205,13 +198,11 @@
        FolderImpl folder = new FolderImpl();
        folder.setCreationDate(new Timestamp(System.currentTimeMillis()));
        folder.setLastModified(new Timestamp(System.currentTimeMillis()));
-       folder.setDescription("FolderImpl 1");
-       folder.setName("folder1");
-       folder.setTitle("FolderImpl 1 Title");
+       folder.setName("folder1");       
        folder.setUri("/graffitotest/folder1"); 
 
        persistenceService.insert(folder);
-       System.out.println("/graffitotest/folder1 id : " + ((FolderImpl) folder).getObjectId());
+       System.out.println("/graffitotest/folder1 id : " + folder.getObjectId());
        
        // ----------------------------------------------------------------------------------------
        // Test get children
@@ -220,11 +211,6 @@
        assertTrue("Invalid number of children for /graffitotest. should be = 1", children.size()
== 1);      
        
        children = persistenceService.getChildren("/graffitotest/folder1");
-       for(Iterator iterator = children.iterator(); iterator.hasNext();)
-       {
-           CmsObject child = (CmsObject) iterator.next();
-           System.out.println("Child found in /graffitotest/folder1 : " + child.getUri());
-       }
        assertTrue("Invalid number of children for /graffitotest/folder1 . should be = 0 /
size is "  + children.size(), children.size() == 0);
        
        // ----------------------------------------------------------------------------------------
@@ -233,10 +219,8 @@
        FolderImpl subFolder = new FolderImpl();
        subFolder.setParentFolder(folder);
        subFolder.setCreationDate(new Timestamp(System.currentTimeMillis()));
-       subFolder.setLastModified(new Timestamp(System.currentTimeMillis()));
-       subFolder.setDescription("FolderImpl 1");
-       subFolder.setName("subFolder1");
-       subFolder.setTitle("FolderImpl 1 Title");
+       subFolder.setLastModified(new Timestamp(System.currentTimeMillis()));       
+       subFolder.setName("subFolder1");       
        subFolder.setUri("/graffitotest/folder1/subfolder1"); 
        persistenceService.insert(subFolder);
 

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllFilesTestRdbmsPolicy.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllFilesTestRdbmsPolicy.java?rev=225707&r1=225706&r2=225707&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllFilesTestRdbmsPolicy.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllFilesTestRdbmsPolicy.java
Wed Jul 27 22:45:45 2005
@@ -22,11 +22,8 @@
 
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.UserPrincipal;
-
 import org.apache.jetspeed.security.impl.UserPrincipalImpl;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.AbstractSecurityTestcase;
-import org.apache.portals.graffito.security.impl.CmsPermissionImpl;
 
 /**
  * Test permission on "<< ALL FILES >>"

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllPermissionTestRdbmsPolicy.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllPermissionTestRdbmsPolicy.java?rev=225707&r1=225706&r2=225707&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllPermissionTestRdbmsPolicy.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/AllPermissionTestRdbmsPolicy.java
Wed Jul 27 22:45:45 2005
@@ -22,11 +22,8 @@
 
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.UserPrincipal;
-
 import org.apache.jetspeed.security.impl.UserPrincipalImpl;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.AbstractSecurityTestcase;
-import org.apache.portals.graffito.security.impl.CmsPermissionImpl;
 
 /**
  * This unit test comes from Jetspeed 2. It used to check if the J2 security

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestPermissions.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestPermissions.java?rev=225707&r1=225706&r2=225707&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestPermissions.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestPermissions.java
Wed Jul 27 22:45:45 2005
@@ -16,12 +16,10 @@
 
 
 
-import java.security.Permission;
 import java.security.Permissions;
 import java.util.Enumeration;
 import java.util.Iterator;
 
-import javax.security.auth.Subject;
 import javax.security.auth.login.LoginException;
 
 import junit.framework.Test;
@@ -29,13 +27,9 @@
 
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.UserPrincipal;
-
 import org.apache.jetspeed.security.impl.UserPrincipalImpl;
-import org.apache.portals.graffito.context.CmsRequestContext;
-import org.apache.portals.graffito.model.CmsPermission;
+import org.apache.portals.graffito.model.permission.CmsPermission;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.AbstractSecurityTestcase;
-import org.apache.portals.graffito.security.impl.CmsPermissionImpl;
 
 /**
  * This unit test comes from Jetspeed 2. It used to check if the J2 security

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestRdbmsPolicy.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestRdbmsPolicy.java?rev=225707&r1=225706&r2=225707&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestRdbmsPolicy.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/security/impl/TestRdbmsPolicy.java
Wed Jul 27 22:45:45 2005
@@ -28,12 +28,9 @@
 
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.UserPrincipal;
-
 import org.apache.jetspeed.security.impl.UserPrincipalImpl;
 import org.apache.portals.graffito.context.CmsRequestContext;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.AbstractSecurityTestcase;
-import org.apache.portals.graffito.security.impl.CmsPermissionImpl;
 
 /**
  * This unit test comes from Jetspeed 2. It used to check if the J2 security



Mime
View raw message