You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by vt...@apache.org on 2004/11/19 02:18:31 UTC

svn commit: r96487 - in incubator/directory/janus/trunk: sandbox/src/test/org/apache/janus/script/xml script/src/test/org/apache/janus/script/xml

Author: vtence
Date: Thu Nov 18 17:18:30 2004
New Revision: 96487

Modified:
   incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JGroupBuilderTest.java
   incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JRoleBuilderTest.java
   incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JRealmBuilderTest.java
Log:
Clarified tests names

Modified: incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JGroupBuilderTest.java
==============================================================================
--- incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JGroupBuilderTest.java	(original)
+++ incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JGroupBuilderTest.java	Thu Nov 18 17:18:30 2004
@@ -33,7 +33,7 @@
  */
 public class Dom4JGroupBuilderTest extends MockObjectTestCase
 {
-    public void testCanAddGroupsToUsers() throws Exception
+    public void testParsesUsersFromXMLDocumentAndAddsGroupAttributesToProvider() throws Exception
     {
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( userWithTwoGroups() ) );
 
@@ -56,7 +56,7 @@
         return content;
     }
 
-    public void testCanAddGroupsToGroups() throws Exception
+    public void testParsesGroupsFromXMLDocumentAndAddsGroupAttributesToProvider() throws Exception
     {
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( groupWithTwoGroups() ) );
 
@@ -79,7 +79,7 @@
         return content;
     }
 
-    public void testNotifiesOfDuplicateAttributes() throws Exception
+    public void testNotifiesMonitorWhenDuplicateAttributesAreFound() throws Exception
     {
         Mock mockMonitor = new Mock( InformationProviderBuilderMonitor.class );
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( twiceSameAttribute() ),
@@ -102,7 +102,7 @@
         return content;
     }
 
-    public void testNotifiesOfCyclicAssociations() throws Exception
+    public void testNotifiesMonitorWhenCyclicAssociationsAreFound() throws Exception
     {
         Mock mockMonitor = new Mock( InformationProviderBuilderMonitor.class );
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( withCyclicAssociation() ),

Modified: incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JRoleBuilderTest.java
==============================================================================
--- incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JRoleBuilderTest.java	(original)
+++ incubator/directory/janus/trunk/sandbox/src/test/org/apache/janus/script/xml/Dom4JRoleBuilderTest.java	Thu Nov 18 17:18:30 2004
@@ -16,22 +16,18 @@
  */
 package org.apache.janus.script.xml;
 
-import org.apache.janus.authentication.CyclicAssociationException;
 import org.apache.janus.authentication.MutableInformationProvider;
-import org.apache.janus.authentication.attribute.AttributeProvider;
-import org.apache.janus.script.InformationProviderBuilderMonitor;
 import org.apache.janus.testmodel.Groups;
-import org.apache.janus.testmodel.Usernames;
 import org.apache.janus.testmodel.Roles;
+import org.apache.janus.testmodel.Usernames;
 import org.jmock.Mock;
 import org.jmock.MockObjectTestCase;
-import org.jmock.core.Constraint;
 
 import java.io.StringReader;
 
 public class Dom4JRoleBuilderTest extends MockObjectTestCase
 {
-    public void testCanAddRolesToUsers() throws Exception
+    public void testParsesUsersFromXMLDocumentAndAddRoleAttributesToUsers() throws Exception
     {
         Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( userWithTwoRoles() ) );
 
@@ -54,7 +50,7 @@
         return content;
     }
 
-    public void testCanAddRolesToGroups() throws Exception
+    public void testParsesGroupsFromXMLDocumentAndAddsRoleAttributesToGroups() throws Exception
     {
         Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( groupsWithRoles() ) );
 
@@ -79,7 +75,7 @@
         return content;
     }
 
-    public void testCanAddRolesToRoles() throws Exception
+    public void testParsesRolesFromXMLDocumentAndAddsRoleAttributesToRoles() throws Exception
     {
         Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( roleWithTwoRoles() ) );
 

Modified: incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JRealmBuilderTest.java
==============================================================================
--- incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JRealmBuilderTest.java	(original)
+++ incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JRealmBuilderTest.java	Thu Nov 18 17:18:30 2004
@@ -38,9 +38,9 @@
         junit.textui.TestRunner.run( Dom4JRealmBuilderTest.class );
     }
 
-    public void testAddsIdentitiesToRealm() throws Exception
+    public void testParsesUsersFromXMLDocumentAndAddsIdentitiesToRealm() throws Exception
     {
-        Dom4JRealmBuilder builder = Dom4JRealmBuilder.fromReader( new StringReader( simpleRealm() ) );
+        Dom4JRealmBuilder builder = Dom4JRealmBuilder.fromReader( new StringReader( realmWithTwoIdentities() ) );
 
         Mock mockRealm = new Mock( MutableRealm.class );
         mockRealm.expects( once() ).method( "addIdentity" ).with( eq( johnCredentials() ) );
@@ -51,7 +51,7 @@
         mockRealm.verify();
     }
 
-    private String simpleRealm()
+    private String realmWithTwoIdentities()
     {
         String content = "<?xml version=\"1.0\"?>\n"
                 + "<realm>\n"
@@ -61,23 +61,7 @@
         return content;
     }
 
-    private CredentialSet johnCredentials()
-    {
-        CredentialSet johnCredentials = new CredentialSet();
-        johnCredentials.add( new UsernameCredential( "john" ) );
-        johnCredentials.add( new PasswordCredential( "doe" ) );
-        return johnCredentials;
-    }
-
-    private CredentialSet janeCredentials()
-    {
-        CredentialSet johnCredentials = new CredentialSet();
-        johnCredentials.add( new UsernameCredential( "jane" ) );
-        johnCredentials.add( new PasswordCredential( "doe" ) );
-        return johnCredentials;
-    }
-
-    public void testNotifiesOfDuplicateIdentities() throws Exception
+    public void testNotifiesMonitorIfDuplicateIdentitiesAreFound() throws Exception
     {
         Mock mockMonitor = new Mock( RealmBuilderMonitor.class );
         Dom4JRealmBuilder builder = Dom4JRealmBuilder.fromReader( new StringReader( realmWithDuplicateIdentity() ),
@@ -98,4 +82,21 @@
                 + "</realm>";
         return content;
     }
+
+    private CredentialSet johnCredentials()
+    {
+        CredentialSet johnCredentials = new CredentialSet();
+        johnCredentials.add( new UsernameCredential( "john" ) );
+        johnCredentials.add( new PasswordCredential( "doe" ) );
+        return johnCredentials;
+    }
+
+    private CredentialSet janeCredentials()
+    {
+        CredentialSet johnCredentials = new CredentialSet();
+        johnCredentials.add( new UsernameCredential( "jane" ) );
+        johnCredentials.add( new PasswordCredential( "doe" ) );
+        return johnCredentials;
+    }
 }
+