directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r376623 [20/38] - in /directory/sandbox/akarasulu/rc1/apacheds: core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ core-shared/src/main/java/org/...
Date Fri, 10 Feb 2006 10:49:57 GMT
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -39,6 +40,7 @@
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
 
+
 /**
  * Tests {@link MaxValueCountFilter}.
  *
@@ -47,21 +49,19 @@
  */
 public class MaxValueCountFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final Collection PROTECTED_ITEMS = new ArrayList();
     private static final Attributes ENTRY = new BasicAttributes();
     private static final Attributes FULL_ENTRY = new BasicAttributes();
-    
+
     static
     {
         Collection mvcItems = new ArrayList();
         mvcItems.add( new MaxValueCountItem( "testAttr", 2 ) );
         PROTECTED_ITEMS.add( new ProtectedItem.MaxValueCount( mvcItems ) );
-        
+
         ENTRY.put( "testAttr", "1" );
 
         Attribute attr = new BasicAttribute( "testAttr" );
@@ -69,56 +69,45 @@
         attr.add( "2" );
         FULL_ENTRY.put( attr );
     }
-    
+
+
     public void testWrongScope() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 ) );
-        
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true, 0 ) );
+
         tuples = Collections.unmodifiableCollection( tuples );
-        
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, null,
-                        null, null, null, null, null, null, null ) );
-
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, null, null, null, null, null, null ) );
+
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, null, null,
+            null, null, null, null, null, null ) );
+
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null,
+            null, null, null, null ) );
     }
-    
+
+
     public void testZeroTuple() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
-        
-        Assert.assertEquals(
-                0, filter.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 0, filter.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testDenialTuple() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS,
-                EMPTY_SET, false, 0 ) );
-        
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, EMPTY_SET, false, 0 ) );
+
         tuples = Collections.unmodifiableCollection( tuples );
-        
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "testAttr", null, ENTRY, null ) );
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "testAttr", null, FULL_ENTRY, null ) );
+
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
+            null, null, null, "testAttr", null, ENTRY, null ) );
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
+            null, null, null, "testAttr", null, FULL_ENTRY, null ) );
     }
 
 
@@ -126,18 +115,12 @@
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS,
-                EMPTY_SET, true, 0 ) );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "testAttr", null, ENTRY, null ).size() );
-
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "testAttr", null, FULL_ENTRY, null ).size() );
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, EMPTY_SET, true, 0 ) );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, "testAttr", null, ENTRY, null ).size() );
+
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, "testAttr", null, FULL_ENTRY, null ).size() );
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MicroOperationFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MicroOperationFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MicroOperationFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MicroOperationFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -33,6 +34,7 @@
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 
+
 /**
  * Tests {@link MicroOperationFilter}.
  *
@@ -41,15 +43,13 @@
  */
 public class MicroOperationFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final Set USER_OPERATIONS_A = new HashSet();
     private static final Set USER_OPERATIONS_B = new HashSet();
     private static final Set TUPLE_OPERATIONS = new HashSet();
-    
+
     static
     {
         USER_OPERATIONS_A.add( MicroOperation.ADD );
@@ -61,31 +61,25 @@
         TUPLE_OPERATIONS.add( MicroOperation.EXPORT );
     }
 
+
     public void testZeroTuple() throws Exception
     {
         MicroOperationFilter filter = new MicroOperationFilter();
-        
-        Assert.assertEquals(
-                0, filter.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 0, filter.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testOneTuple() throws Exception
     {
         MicroOperationFilter filter = new MicroOperationFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_SET,
-                TUPLE_OPERATIONS, true, 0 ) );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, null, null, null, null, null, USER_OPERATIONS_A ).size() );
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, null, null, null, null, null, USER_OPERATIONS_B ).size() );
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_SET, TUPLE_OPERATIONS, true, 0 ) );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null,
+            null, null, USER_OPERATIONS_A ).size() );
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null,
+            null, null, USER_OPERATIONS_B ).size() );
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -35,6 +36,7 @@
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 
+
 /**
  * Tests {@link MostSpecificProtectedItemFilter}.
  *
@@ -43,17 +45,15 @@
  */
 public class MostSpecificProtectedItemFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final List TUPLES_A = new ArrayList();
     private static final List TUPLES_B = new ArrayList();
     private static final List TUPLES_C = new ArrayList();
     private static final List TUPLES_D = new ArrayList();
     private static final List TUPLES_E = new ArrayList();
-    
+
     static
     {
         Collection attributeType = new ArrayList();
@@ -72,27 +72,20 @@
         allUserAttributeTypes.add( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES );
         allUserAttributeTypesAndValues.add( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES );
 
-        ACITuple attributeTypeTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, attributeType,
-                EMPTY_SET, true, 0 );
-        ACITuple allAttributeValuesTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, allAttributeValues,
-                EMPTY_SET, true, 0 );
-        ACITuple selfValueTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, selfValue,
-                EMPTY_SET, true, 0 );
-        ACITuple attributeValueTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, attributeValue,
-                EMPTY_SET, true, 0 );
-        ACITuple rangeOfValuesTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, rangeOfValues,
-                EMPTY_SET, true, 0 );
-        ACITuple allUserAttributeTypesTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, allUserAttributeTypes,
-                EMPTY_SET, true, 0 );
-        ACITuple allUserAttributeTypesAndValuesTuple = new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, allUserAttributeTypesAndValues,
-                EMPTY_SET, true, 0 );
+        ACITuple attributeTypeTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, attributeType,
+            EMPTY_SET, true, 0 );
+        ACITuple allAttributeValuesTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE,
+            allAttributeValues, EMPTY_SET, true, 0 );
+        ACITuple selfValueTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, selfValue, EMPTY_SET, true,
+            0 );
+        ACITuple attributeValueTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, attributeValue,
+            EMPTY_SET, true, 0 );
+        ACITuple rangeOfValuesTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, rangeOfValues,
+            EMPTY_SET, true, 0 );
+        ACITuple allUserAttributeTypesTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE,
+            allUserAttributeTypes, EMPTY_SET, true, 0 );
+        ACITuple allUserAttributeTypesAndValuesTuple = new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE,
+            allUserAttributeTypesAndValues, EMPTY_SET, true, 0 );
 
         TUPLES_A.add( attributeTypeTuple );
         TUPLES_A.add( allAttributeValuesTuple );
@@ -123,36 +116,31 @@
         TUPLES_E.add( allUserAttributeTypesTuple );
         TUPLES_E.add( allUserAttributeTypesAndValuesTuple );
     }
-    
+
+
     public void testZeroOrOneTuple() throws Exception
     {
         MostSpecificProtectedItemFilter filter = new MostSpecificProtectedItemFilter();
 
-        Assert.assertEquals(
-                0, filter.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
 
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, false, 0 ) );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, false, 0 ) );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testTuplesA() throws Exception
     {
         MostSpecificProtectedItemFilter filter = new MostSpecificProtectedItemFilter();
-        
+
         List tuples = new ArrayList( TUPLES_A );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 4, tuples.size() );
         Assert.assertSame( TUPLES_A.get( 0 ), tuples.get( 0 ) );
         Assert.assertSame( TUPLES_A.get( 1 ), tuples.get( 1 ) );
@@ -160,57 +148,57 @@
         Assert.assertSame( TUPLES_A.get( 3 ), tuples.get( 3 ) );
     }
 
+
     public void testTuplesB() throws Exception
     {
         MostSpecificProtectedItemFilter filter = new MostSpecificProtectedItemFilter();
-        
+
         List tuples = new ArrayList( TUPLES_B );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 3, tuples.size() );
         Assert.assertSame( TUPLES_B.get( 0 ), tuples.get( 0 ) );
         Assert.assertSame( TUPLES_B.get( 1 ), tuples.get( 1 ) );
         Assert.assertSame( TUPLES_B.get( 2 ), tuples.get( 2 ) );
     }
 
+
     public void testTuplesC() throws Exception
     {
         MostSpecificProtectedItemFilter filter = new MostSpecificProtectedItemFilter();
-        
+
         List tuples = new ArrayList( TUPLES_C );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 2, tuples.size() );
         Assert.assertSame( TUPLES_C.get( 0 ), tuples.get( 0 ) );
         Assert.assertSame( TUPLES_C.get( 1 ), tuples.get( 1 ) );
     }
 
+
     public void testTuplesD() throws Exception
     {
         MostSpecificProtectedItemFilter filter = new MostSpecificProtectedItemFilter();
-        
+
         List tuples = new ArrayList( TUPLES_D );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 1, tuples.size() );
         Assert.assertSame( TUPLES_D.get( 0 ), tuples.get( 0 ) );
     }
-    
+
+
     public void testTuplesE() throws Exception
     {
         MostSpecificProtectedItemFilter filter = new MostSpecificProtectedItemFilter();
-        
+
         List tuples = new ArrayList( TUPLES_E );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 2, tuples.size() );
         Assert.assertSame( TUPLES_E.get( 0 ), tuples.get( 0 ) );
         Assert.assertSame( TUPLES_E.get( 1 ), tuples.get( 1 ) );

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -34,6 +35,7 @@
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.aci.UserClass;
 
+
 /**
  * Tests {@link MostSpecificUserClassFilter}.
  *
@@ -42,17 +44,15 @@
  */
 public class MostSpecificUserClassFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final List TUPLES_A = new ArrayList();
     private static final List TUPLES_B = new ArrayList();
     private static final List TUPLES_C = new ArrayList();
     private static final List TUPLES_D = new ArrayList();
     private static final List TUPLES_E = new ArrayList();
-    
+
     static
     {
         Collection name = new ArrayList();
@@ -60,28 +60,20 @@
         Collection userGroup = new ArrayList();
         Collection subtree = new ArrayList();
         Collection allUsers = new ArrayList();
-        
+
         name.add( new UserClass.Name( EMPTY_SET ) );
         thisEntry.add( UserClass.THIS_ENTRY );
         userGroup.add( new UserClass.UserGroup( EMPTY_SET ) );
         subtree.add( new UserClass.Subtree( EMPTY_COLLECTION ) );
         allUsers.add( UserClass.ALL_USERS );
 
-        ACITuple nameTuple = new ACITuple(
-                name, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 );
-        ACITuple thisEntryTuple = new ACITuple(
-                thisEntry, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 );
-        ACITuple userGroupTuple = new ACITuple(
-                userGroup, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 );
-        ACITuple subtreeTuple = new ACITuple(
-                subtree, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 );
-        ACITuple allUsersTuple = new ACITuple(
-                allUsers, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 );
+        ACITuple nameTuple = new ACITuple( name, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true, 0 );
+        ACITuple thisEntryTuple = new ACITuple( thisEntry, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true,
+            0 );
+        ACITuple userGroupTuple = new ACITuple( userGroup, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true,
+            0 );
+        ACITuple subtreeTuple = new ACITuple( subtree, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true, 0 );
+        ACITuple allUsersTuple = new ACITuple( allUsers, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true, 0 );
 
         TUPLES_A.add( nameTuple );
         TUPLES_A.add( thisEntryTuple );
@@ -104,89 +96,84 @@
         TUPLES_E.add( allUsersTuple );
         TUPLES_E.add( allUsersTuple );
     }
-    
+
+
     public void testZeroOrOneTuple() throws Exception
     {
         MostSpecificUserClassFilter filter = new MostSpecificUserClassFilter();
 
-        Assert.assertEquals(
-                0, filter.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
 
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, false, 0 ) );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, false, 0 ) );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testNameAndThisEntry() throws Exception
     {
         MostSpecificUserClassFilter filter = new MostSpecificUserClassFilter();
-        
+
         List tuples = new ArrayList( TUPLES_A );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 2, tuples.size() );
         Assert.assertSame( TUPLES_A.get( 0 ), tuples.get( 0 ) );
         Assert.assertSame( TUPLES_A.get( 1 ), tuples.get( 1 ) );
     }
 
+
     public void testThisEntry() throws Exception
     {
         MostSpecificUserClassFilter filter = new MostSpecificUserClassFilter();
-        
+
         List tuples = new ArrayList( TUPLES_B );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 1, tuples.size() );
         Assert.assertSame( TUPLES_B.get( 0 ), tuples.get( 0 ) );
     }
 
+
     public void testUserGroup() throws Exception
     {
         MostSpecificUserClassFilter filter = new MostSpecificUserClassFilter();
-        
+
         List tuples = new ArrayList( TUPLES_C );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 1, tuples.size() );
         Assert.assertSame( TUPLES_C.get( 0 ), tuples.get( 0 ) );
     }
 
+
     public void testSubtree() throws Exception
     {
         MostSpecificUserClassFilter filter = new MostSpecificUserClassFilter();
-        
+
         List tuples = new ArrayList( TUPLES_D );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 1, tuples.size() );
         Assert.assertSame( TUPLES_D.get( 0 ), tuples.get( 0 ) );
     }
-    
+
+
     public void testOthers() throws Exception
     {
         MostSpecificUserClassFilter filter = new MostSpecificUserClassFilter();
-        
+
         List tuples = new ArrayList( TUPLES_E );
-        tuples = ( List ) filter.filter(
-                tuples, OperationScope.ENTRY, null, null, null,
-                null, null, null, null, null, null, null );
-        
+        tuples = ( List ) filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null, null, null,
+            null, null );
+
         Assert.assertEquals( 2, tuples.size() );
         Assert.assertSame( TUPLES_E.get( 0 ), tuples.get( 0 ) );
         Assert.assertSame( TUPLES_E.get( 1 ), tuples.get( 1 ) );

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/OperationScopeTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/OperationScopeTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/OperationScopeTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/OperationScopeTest.java Fri Feb 10 02:48:07 2006
@@ -18,11 +18,13 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import org.apache.directory.server.core.authz.support.OperationScope;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
+
 /**
  * Tests {@link OperationScope}.
  *
@@ -38,11 +40,13 @@
         Assert.assertEquals( "Attribute Type", OperationScope.ATTRIBUTE_TYPE.getName() );
         Assert.assertEquals( "Attribute Type & Value", OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName() );
     }
-    
+
+
     public void testGetNameAndToStringEquality()
     {
         Assert.assertEquals( OperationScope.ENTRY.getName(), OperationScope.ENTRY.toString() );
         Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE.getName(), OperationScope.ATTRIBUTE_TYPE.toString() );
-        Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName(), OperationScope.ATTRIBUTE_TYPE_AND_VALUE.toString() );
+        Assert.assertEquals( OperationScope.ATTRIBUTE_TYPE_AND_VALUE.getName(), OperationScope.ATTRIBUTE_TYPE_AND_VALUE
+            .toString() );
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -49,6 +50,7 @@
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.name.LdapName;
 
+
 /**
  * Tests {@link RelatedUserClassFilter}.
  *
@@ -57,16 +59,14 @@
  */
 public class RelatedProtectedItemFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final Name GROUP_NAME;
     private static final Name USER_NAME;
     private static final Set USER_NAMES = new HashSet();
     private static final Set GROUP_NAMES = new HashSet();
-    
+
     private static final AttributeTypeRegistry ATTR_TYPE_REGISTRY_A = new DummyAttributeTypeRegistry( false );
     private static final AttributeTypeRegistry ATTR_TYPE_REGISTRY_B = new DummyAttributeTypeRegistry( true );
     private static final OidRegistry OID_REGISTRY = new DummyOidRegistry();
@@ -74,25 +74,20 @@
     private static final RelatedProtectedItemFilter filterA;
     private static final RelatedProtectedItemFilter filterB;
 
-    
     static
     {
         try
         {
             GROUP_NAME = new LdapName( "ou=test,ou=groups,ou=system" );
             USER_NAME = new LdapName( "ou=test, ou=users, ou=system" );
-            
-            filterA = new RelatedProtectedItemFilter(
-                    new RefinementEvaluator(
-                            new RefinementLeafEvaluator( OID_REGISTRY ) ),
-                    new ExpressionEvaluator( OID_REGISTRY, ATTR_TYPE_REGISTRY_A ) );
-
-            filterB = new RelatedProtectedItemFilter(
-                    new RefinementEvaluator(
-                            new RefinementLeafEvaluator( OID_REGISTRY ) ),
-                    new ExpressionEvaluator( OID_REGISTRY, ATTR_TYPE_REGISTRY_B ) );
+
+            filterA = new RelatedProtectedItemFilter( new RefinementEvaluator( new RefinementLeafEvaluator(
+                OID_REGISTRY ) ), new ExpressionEvaluator( OID_REGISTRY, ATTR_TYPE_REGISTRY_A ) );
+
+            filterB = new RelatedProtectedItemFilter( new RefinementEvaluator( new RefinementLeafEvaluator(
+                OID_REGISTRY ) ), new ExpressionEvaluator( OID_REGISTRY, ATTR_TYPE_REGISTRY_B ) );
         }
-        catch( NamingException e )
+        catch ( NamingException e )
         {
             throw new Error();
         }
@@ -100,81 +95,70 @@
         USER_NAMES.add( USER_NAME );
         GROUP_NAMES.add( GROUP_NAME );
     }
-    
+
+
     public void testZeroTuple() throws Exception
     {
-        Assert.assertEquals(
-                0, filterA.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filterA.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testEntry() throws Exception
     {
         Collection tuples = getTuples( ProtectedItem.ENTRY );
-        
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.NONE, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.NONE, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testAllUserAttributeTypes() throws Exception
     {
         Collection tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES );
-        
+
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "userAttr", null, null, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "userAttr", null, null, null ).size() );
+
         tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "userAttr", null, null, null ).size() );
-        
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "userAttr", null, null, null ).size() );
+
         /* Not used anymore
-        Assert.assertEquals(
-                0, filterB.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "opAttr", null, null, null ).size() );
-        */  
+         Assert.assertEquals(
+         0, filterB.filter(
+         tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
+         null, null, null,
+         "opAttr", null, null, null ).size() );
+         */
     }
-    
+
+
     public void testAllUserAttributeTypesAndValues() throws Exception
     {
         Collection tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "userAttr", null, null, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "userAttr", null, null, null ).size() );
+
         tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "userAttr", null, null, null ).size() );
-        
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "userAttr", null, null, null ).size() );
+
         /* Not used anymore
-        Assert.assertEquals(
-                0, filterB.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "opAttr", null, null, null ).size() );
-        */  
+         Assert.assertEquals(
+         0, filterB.filter(
+         tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
+         null, null, null,
+         "opAttr", null, null, null ).size() );
+         */
     }
-    
+
+
     public void testAllAttributeValues() throws Exception
     {
         Collection attrTypes = new ArrayList();
@@ -182,27 +166,19 @@
         Collection tuples = getTuples( new ProtectedItem.AllAttributeValues( attrTypes ) );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, null, null ).size() );
+
         tuples = getTuples( new ProtectedItem.AllAttributeValues( attrTypes ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
-        Assert.assertEquals(
-                0, filterB.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrB", null, null, null ).size() );  
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrA", null, null, null ).size() );
+
+        Assert.assertEquals( 0, filterB.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrB", null, null, null ).size() );
     }
-    
+
+
     public void testAttributeType() throws Exception
     {
         Collection attrTypes = new ArrayList();
@@ -210,27 +186,19 @@
         Collection tuples = getTuples( new ProtectedItem.AttributeType( attrTypes ) );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, null, null ).size() );
+
         tuples = getTuples( new ProtectedItem.AttributeType( attrTypes ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrB", null, null, null ).size() );  
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrA", null, null, null ).size() );
+
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrB", null, null, null ).size() );
     }
-    
+
+
     public void testAttributeValue() throws Exception
     {
         Collection attributes = new ArrayList();
@@ -238,59 +206,43 @@
         Collection tuples = getTuples( new ProtectedItem.AttributeValue( attributes ) );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, null, null ).size() );
         tuples = getTuples( new ProtectedItem.AttributeValue( attributes ) );
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrA", null, null, null ).size() );
+
         tuples = getTuples( new ProtectedItem.AttributeValue( attributes ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", "valueA", null, null ).size() );
-        
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", "valueB", null, null ).size() );  
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrA", "valueA", null, null ).size() );
+
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrA", "valueB", null, null ).size() );
 
         tuples = getTuples( new ProtectedItem.AttributeValue( attributes ) );
 
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrB", "valueA", null, null ).size() );  
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrB", "valueA", null, null ).size() );
     }
-    
+
+
     public void testClasses() throws Exception
     {
         // TODO I don't know how to test with Refinement yet.
     }
 
+
     public void testMaxImmSub() throws Exception
     {
         Collection tuples = getTuples( new ProtectedItem.MaxImmSub( 2 ) );
 
         // Should always retain ruples.
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, null, null ).size() );
     }
-    
+
+
     public void testMaxValueCount() throws Exception
     {
         Collection mvcItems = new ArrayList();
@@ -298,53 +250,37 @@
         Collection tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, null, null ).size() );
         tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) );
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrA", null, null, null ).size() );
+
         tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrB", null, null, null ).size() );  
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrA", null, null, null ).size() );
+
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrB", null, null, null ).size() );
     }
-    
+
+
     public void testRangeOfValues() throws Exception
     {
         Attributes entry = new BasicAttributes();
         entry.put( "attrA", "valueA" );
         Collection tuples = getTuples( new ProtectedItem.RangeOfValues( new PresenceNode( "attrA" ) ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, new LdapName( "ou=testEntry" ),
-                        null, null, entry, null ).size() );
-        
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null,
+            new LdapName( "ou=testEntry" ), null, null, entry, null ).size() );
+
         entry.remove( "attrA" );
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, new LdapName( "ou=testEntry" ),
-                        null, null, entry, null ).size() );  
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, new LdapName( "ou=testEntry" ), null, null, entry, null ).size() );
     }
-    
+
+
     public void testRestrictedBy() throws Exception
     {
         Collection rbItems = new ArrayList();
@@ -352,82 +288,58 @@
         Collection tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems ) );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, null, null ).size() );
         tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems ) );
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, USER_NAME, null,
+            null, null, "attrA", null, null, null ).size() );
+
         tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, null, null ).size() );
-        
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrB", null, null, null ).size() );  
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrA", null, null, null ).size() );
+
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrB", null, null, null ).size() );
     }
-    
+
+
     public void testSelfValue() throws Exception
     {
         Collection attrTypes = new ArrayList();
         attrTypes.add( "attrA" );
         Collection tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) );
-        
+
         Attributes entry = new BasicAttributes();
         entry.put( "attrA", USER_NAME );
 
         // Test wrong scope
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, entry, null ).size() );
-        
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
+            "attrA", null, entry, null ).size() );
+
         tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) );
 
-        Assert.assertEquals(
-                1, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, entry, null ).size() );
-        
+        Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrA", null, entry, null ).size() );
+
         entry.remove( "attrA" );
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrA", null, entry, null ).size() );  
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrA", null, entry, null ).size() );
 
         tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) );
-        Assert.assertEquals(
-                0, filterA.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-                        null, null, null,
-                        "attrB", null, entry, null ).size() );  
+        Assert.assertEquals( 0, filterA.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
+            null, null, null, "attrB", null, entry, null ).size() );
     }
-    
+
+
     private static Collection getTuples( ProtectedItem protectedItem )
     {
         Collection protectedItems = new ArrayList();
         protectedItems.add( protectedItem );
-        
+
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, protectedItems,
-                EMPTY_SET, true, 0 ) );
-        
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, protectedItems, EMPTY_SET, true, 0 ) );
+
         return tuples;
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -38,6 +39,7 @@
 import org.apache.directory.shared.ldap.aci.UserClass;
 import org.apache.directory.shared.ldap.name.LdapName;
 
+
 /**
  * Tests {@link RelatedUserClassFilter}.
  *
@@ -46,20 +48,18 @@
  */
 public class RelatedUserClassFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final Name GROUP_NAME;
     private static final Name USER_NAME;
     private static final Set USER_NAMES = new HashSet();
     private static final Set GROUP_NAMES = new HashSet();
-    
+
     private static final SubtreeEvaluator SUBTREE_EVALUATOR = new SubtreeEvaluator( new DummyOidRegistry() );
 
     private static final RelatedUserClassFilter filter = new RelatedUserClassFilter( SUBTREE_EVALUATOR );
-    
+
     static
     {
         try
@@ -67,7 +67,7 @@
             GROUP_NAME = new LdapName( "ou=test,ou=groups,ou=system" );
             USER_NAME = new LdapName( "ou=test, ou=users, ou=system" );
         }
-        catch( NamingException e )
+        catch ( NamingException e )
         {
             throw new Error();
         }
@@ -75,134 +75,108 @@
         USER_NAMES.add( USER_NAME );
         GROUP_NAMES.add( GROUP_NAME );
     }
-    
+
+
     public void testZeroTuple() throws Exception
     {
-        Assert.assertEquals(
-                0, filter.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testAllUsers() throws Exception
     {
         Collection tuples = getTuples( UserClass.ALL_USERS );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.NONE, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.NONE, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testThisEntry() throws Exception
     {
         Collection tuples = getTuples( UserClass.THIS_ENTRY );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, AuthenticationLevel.NONE, USER_NAME,
-                        null, null, null, null ).size() );  
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, AuthenticationLevel.NONE, new LdapName( "ou=unrelated" ),
-                        null, null, null, null ).size() );  
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null,
+            AuthenticationLevel.NONE, USER_NAME, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null,
+            AuthenticationLevel.NONE, new LdapName( "ou=unrelated" ), null, null, null, null ).size() );
     }
-    
+
+
     public void testName() throws Exception
     {
         Collection tuples = getTuples( new UserClass.Name( USER_NAMES ) );
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, USER_NAME,
-                        null, AuthenticationLevel.NONE, null,
-                        null, null, null, null ).size() );  
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, new LdapName( "ou=unrelateduser, ou=users" ),
-                        null, AuthenticationLevel.NONE, USER_NAME,
-                        null, null, null, null ).size() );  
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null,
+            AuthenticationLevel.NONE, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, null,
+            new LdapName( "ou=unrelateduser, ou=users" ), null, AuthenticationLevel.NONE, USER_NAME, null, null, null,
+            null ).size() );
     }
-    
+
+
     public void testUserGroup() throws Exception
     {
         Collection tuples = getTuples( new UserClass.UserGroup( GROUP_NAMES ) );
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, GROUP_NAMES, USER_NAME,
-                        null, AuthenticationLevel.NONE, null,
-                        null, null, null, null ).size() );  
-        
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, GROUP_NAMES, USER_NAME, null,
+            AuthenticationLevel.NONE, null, null, null, null, null ).size() );
+
         Set wrongGroupNames = new HashSet();
         wrongGroupNames.add( new LdapName( "ou=unrelatedgroup" ) );
-        
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, wrongGroupNames, USER_NAME,
-                        null, AuthenticationLevel.NONE, USER_NAME,
-                        null, null, null, null ).size() );  
+
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, wrongGroupNames, USER_NAME, null,
+            AuthenticationLevel.NONE, USER_NAME, null, null, null, null ).size() );
     }
-    
+
+
     public void testSubtree() throws Exception
     {
         // TODO Don't know how to test yet.
     }
-    
+
+
     public void testAuthenticationLevel() throws Exception
     {
         Collection tuples = getTuples( AuthenticationLevel.SIMPLE, true );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.STRONG, null, null, null, null, null ).size() );
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.SIMPLE, null, null, null, null, null ).size() );
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.NONE, null, null, null, null, null ).size() );
-        
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.STRONG, null, null, null, null, null ).size() );
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.SIMPLE, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.NONE, null, null, null, null, null ).size() );
+
         tuples = getTuples( AuthenticationLevel.SIMPLE, false );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.NONE, null, null, null, null, null ).size() );
-
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.STRONG, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.NONE, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.STRONG, null, null, null, null, null ).size() );
 
         tuples = getTuples( AuthenticationLevel.SIMPLE, false );
 
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, AuthenticationLevel.SIMPLE, null, null, null, null, null ).size() );
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null,
+            AuthenticationLevel.SIMPLE, null, null, null, null, null ).size() );
     }
 
+
     private static Collection getTuples( UserClass userClass )
     {
         Collection classes = new ArrayList();
         classes.add( userClass );
-        
+
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                classes, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 ) );
-        
+        tuples.add( new ACITuple( classes, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true, 0 ) );
+
         return tuples;
     }
-    
+
+
     private static Collection getTuples( AuthenticationLevel level, boolean grant )
     {
         Collection classes = new ArrayList();
-        if( grant )
+        if ( grant )
         {
             classes.add( UserClass.ALL_USERS );
         }
@@ -213,19 +187,17 @@
             {
                 names.add( new LdapName( "dummy=dummy" ) );
             }
-            catch( NamingException e )
+            catch ( NamingException e )
             {
                 throw new Error();
             }
 
             classes.add( new UserClass.Name( names ) );
         }
-        
+
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                classes, level, EMPTY_COLLECTION,
-                EMPTY_SET, grant, 0 ) );
-        
+        tuples.add( new ACITuple( classes, level, EMPTY_COLLECTION, EMPTY_SET, grant, 0 ) );
+
         return tuples;
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.authz.support;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -39,6 +40,7 @@
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
 
+
 /**
  * Tests {@link RestrictedByFilter}.
  *
@@ -47,72 +49,61 @@
  */
 public class RestrictedByFilterTest extends TestCase
 {
-    private static final Collection EMPTY_COLLECTION =
-        Collections.unmodifiableCollection( new ArrayList() );
-    private static final Set EMPTY_SET =
-        Collections.unmodifiableSet( new HashSet() );
-    
+    private static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList() );
+    private static final Set EMPTY_SET = Collections.unmodifiableSet( new HashSet() );
+
     private static final Collection PROTECTED_ITEMS = new ArrayList();
     private static final Attributes ENTRY = new BasicAttributes();
-    
+
     static
     {
         Collection mvcItems = new ArrayList();
         mvcItems.add( new RestrictedByItem( "choice", "option" ) );
         PROTECTED_ITEMS.add( new ProtectedItem.RestrictedBy( mvcItems ) );
-        
+
         Attribute attr = new BasicAttribute( "option" );
         attr.add( "1" );
         attr.add( "2" );
-        
+
         ENTRY.put( attr );
     }
-    
+
+
     public void testWrongScope() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
-                EMPTY_SET, true, 0 ) );
-        
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION, EMPTY_SET, true, 0 ) );
+
         tuples = Collections.unmodifiableCollection( tuples );
-        
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE, null, null, null,
-                        null, null, null, null, null, null, null ) );
-
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ENTRY, null, null, null,
-                        null, null, null, null, null, null, null ) );
+
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE, null, null, null, null,
+            null, null, null, null, null, null ) );
+
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ENTRY, null, null, null, null, null, null,
+            null, null, null, null ) );
     }
-    
+
+
     public void testZeroTuple() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
-        
-        Assert.assertEquals(
-                0, filter.filter(
-                        EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE,
-                        null, null, null, null, null, null, null, null, null, null ).size() );
+
+        Assert.assertEquals( 0, filter.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
+            null, null, null, null, null, null, null, null ).size() );
     }
-    
+
+
     public void testDenialTuple() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS,
-                EMPTY_SET, false, 0 ) );
-        
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, EMPTY_SET, false, 0 ) );
+
         tuples = Collections.unmodifiableCollection( tuples );
-        
-        Assert.assertEquals(
-                tuples, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "testAttr", null, ENTRY, null ) );
+
+        Assert.assertEquals( tuples, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
+            null, null, null, "testAttr", null, ENTRY, null ) );
     }
 
 
@@ -120,23 +111,15 @@
     {
         RestrictedByFilter filter = new RestrictedByFilter();
         Collection tuples = new ArrayList();
-        tuples.add( new ACITuple(
-                EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS,
-                EMPTY_SET, true, 0 ) );
-        
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "choice", "1", ENTRY, null ).size() );
-
-        Assert.assertEquals(
-                1, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "choice", "2", ENTRY, null ).size() );
-
-        Assert.assertEquals(
-                0, filter.filter(
-                        tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
-                        null, null, null, "choice", "3", ENTRY, null ).size() );
+        tuples.add( new ACITuple( EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, EMPTY_SET, true, 0 ) );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, "choice", "1", ENTRY, null ).size() );
+
+        Assert.assertEquals( 1, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, "choice", "2", ENTRY, null ).size() );
+
+        Assert.assertEquals( 0, filter.filter( tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
+            null, null, "choice", "3", ENTRY, null ).size() );
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java Fri Feb 10 02:48:07 2006
@@ -56,14 +56,9 @@
 public class InterceptorChainTest extends TestCase
 {
     private final MockInterceptor[] interceptorArray =
-    {
-            new MockInterceptor( "0" ),
-            new MockInterceptor( "1" ),
-            new MockInterceptor( "2" ),
-            new MockInterceptor( "3" ),
-            new MockInterceptor( "4" )
-    };
-//    private final static Logger log = LoggerFactory.getLogger( InterceptorChainTest.class );
+        { new MockInterceptor( "0" ), new MockInterceptor( "1" ), new MockInterceptor( "2" ),
+            new MockInterceptor( "3" ), new MockInterceptor( "4" ) };
+    //    private final static Logger log = LoggerFactory.getLogger( InterceptorChainTest.class );
     private InterceptorChain chain;
     private List interceptors = new ArrayList( interceptorArray.length );
 
@@ -95,14 +90,15 @@
         Context ctx = new DeadContext();
         DirectoryService ds = new MockDirectoryService();
         DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
-        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn } );
+        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]
+            { dn } );
         InvocationStack.getInstance().push( i );
 
         try
         {
             chain.lookup( dn );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
         }
 
@@ -120,14 +116,15 @@
         Context ctx = new DeadContext();
         DirectoryService ds = new MockDirectoryService();
         DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
-        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, Collections.singleton( "0" ) );
+        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]
+            { dn }, Collections.singleton( "0" ) );
         InvocationStack.getInstance().push( i );
 
         try
         {
             chain.lookup( dn );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
         }
 
@@ -152,14 +149,15 @@
         Collection bypass = new HashSet();
         bypass.add( "0" );
         bypass.add( "1" );
-        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, bypass );
+        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]
+            { dn }, bypass );
         InvocationStack.getInstance().push( i );
 
         try
         {
             chain.lookup( dn );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
         }
 
@@ -185,14 +183,15 @@
         Collection bypass = new HashSet();
         bypass.add( "0" );
         bypass.add( "4" );
-        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, bypass );
+        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]
+            { dn }, bypass );
         InvocationStack.getInstance().push( i );
 
         try
         {
             chain.lookup( dn );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
         }
 
@@ -214,14 +213,15 @@
         Collection bypass = new HashSet();
         bypass.add( "1" );
         bypass.add( "3" );
-        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, bypass );
+        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]
+            { dn }, bypass );
         InvocationStack.getInstance().push( i );
 
         try
         {
             chain.lookup( dn );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
         }
 
@@ -240,27 +240,27 @@
         Context ctx = new DeadContext();
         DirectoryService ds = new MockDirectoryService();
         DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
-        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn },
-                DirectoryPartitionNexusProxy.BYPASS_ALL_COLLECTION );
+        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]
+            { dn }, DirectoryPartitionNexusProxy.BYPASS_ALL_COLLECTION );
         InvocationStack.getInstance().push( i );
 
         try
         {
             chain.lookup( dn );
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
         }
 
         assertEquals( 0, interceptors.size() );
     }
 
-
     class MockInterceptor implements Interceptor
     {
         String name;
 
-        public MockInterceptor( String name )
+
+        public MockInterceptor(String name)
         {
             this.name = name;
         }
@@ -272,7 +272,8 @@
         }
 
 
-        public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
+        public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg )
+            throws NamingException
         {
         }
 
@@ -310,7 +311,8 @@
         }
 
 
-        public void addContextPartition( NextInterceptor next, DirectoryPartitionConfiguration cfg ) throws NamingException
+        public void addContextPartition( NextInterceptor next, DirectoryPartitionConfiguration cfg )
+            throws NamingException
         {
             interceptors.add( this );
             next.addContextPartition( cfg );
@@ -338,7 +340,8 @@
         }
 
 
-        public void add( NextInterceptor next, String userProvidedName, Name normalizedName, Attributes entry ) throws NamingException
+        public void add( NextInterceptor next, String userProvidedName, Name normalizedName, Attributes entry )
+            throws NamingException
         {
             interceptors.add( this );
             next.add( userProvidedName, normalizedName, entry );
@@ -352,7 +355,7 @@
         }
 
 
-        public void modify( NextInterceptor next, Name name, ModificationItem [] items ) throws NamingException
+        public void modify( NextInterceptor next, Name name, ModificationItem[] items ) throws NamingException
         {
             interceptors.add( this );
             next.modify( name, items );
@@ -366,7 +369,8 @@
         }
 
 
-        public NamingEnumeration search( NextInterceptor next, Name baseName, Map environment, ExprNode filter, SearchControls searchControls ) throws NamingException
+        public NamingEnumeration search( NextInterceptor next, Name baseName, Map environment, ExprNode filter,
+            SearchControls searchControls ) throws NamingException
         {
             interceptors.add( this );
             return next.search( baseName, environment, filter, searchControls );
@@ -380,7 +384,7 @@
         }
 
 
-        public Attributes lookup( NextInterceptor next, Name dn, String [] attrIds ) throws NamingException
+        public Attributes lookup( NextInterceptor next, Name dn, String[] attrIds ) throws NamingException
         {
             interceptors.add( this );
             return next.lookup( dn, attrIds );
@@ -401,7 +405,8 @@
         }
 
 
-        public void modifyRn( NextInterceptor next, Name name, String newRn, boolean deleteOldRn ) throws NamingException
+        public void modifyRn( NextInterceptor next, Name name, String newRn, boolean deleteOldRn )
+            throws NamingException
         {
             interceptors.add( this );
             next.modifyRn( name, newRn, deleteOldRn );
@@ -415,14 +420,16 @@
         }
 
 
-        public void move( NextInterceptor next, Name oldName, Name newParentName, String newRn, boolean deleteOldRn ) throws NamingException
+        public void move( NextInterceptor next, Name oldName, Name newParentName, String newRn, boolean deleteOldRn )
+            throws NamingException
         {
             interceptors.add( this );
             next.move( oldName, newParentName, newRn, deleteOldRn );
         }
 
 
-        public void bind( NextInterceptor next, Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+        public void bind( NextInterceptor next, Name bindDn, byte[] credentials, List mechanisms, String saslAuthId )
+            throws NamingException
         {
             interceptors.add( this );
             next.bind( bindDn, credentials, mechanisms, saslAuthId );
@@ -436,7 +443,6 @@
         }
     }
 
-
     class MockDirectoryService extends DirectoryService
     {
         public void startup( DirectoryServiceListener listener, Hashtable environment ) throws NamingException
@@ -459,25 +465,26 @@
 
         public boolean isStarted()
         {
-            return false;  //To change body of implemented methods use File | Settings | File Templates.
+            return false; //To change body of implemented methods use File | Settings | File Templates.
         }
 
 
         public DirectoryServiceConfiguration getConfiguration()
         {
-            return null;  //To change body of implemented methods use File | Settings | File Templates.
+            return null; //To change body of implemented methods use File | Settings | File Templates.
         }
 
 
         public Context getJndiContext( String baseName ) throws NamingException
         {
-            return null;  //To change body of implemented methods use File | Settings | File Templates.
+            return null; //To change body of implemented methods use File | Settings | File Templates.
         }
 
 
-        public Context getJndiContext( String principal, byte[] credential, String authentication, String baseName ) throws NamingException
+        public Context getJndiContext( String principal, byte[] credential, String authentication, String baseName )
+            throws NamingException
         {
-            return null;  //To change body of implemented methods use File | Settings | File Templates.
+            return null; //To change body of implemented methods use File | Settings | File Templates.
         }
     }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java Fri Feb 10 02:48:07 2006
@@ -15,7 +15,7 @@
  *
  */
 package org.apache.directory.server.core.jndi;
- 
+
 
 import java.util.Hashtable;
 
@@ -50,7 +50,7 @@
         }
     }
 
-    
+
     public void testNullEnv() throws Exception
     {
         try

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/RootDSETest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/RootDSETest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/RootDSETest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/jndi/RootDSETest.java Fri Feb 10 02:48:07 2006
@@ -101,7 +101,13 @@
 
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
 
-        try { new InitialContext( env ); } catch( Exception e ) {}
+        try
+        {
+            new InitialContext( env );
+        }
+        catch ( Exception e )
+        {
+        }
     }
 
 
@@ -182,7 +188,8 @@
 
         DirContext ctx = ( DirContext ) initCtx.lookup( "" );
 
-        Attributes attributes = ctx.getAttributes( "", new String[]{ "namingContexts", "vendorName" });
+        Attributes attributes = ctx.getAttributes( "", new String[]
+            { "namingContexts", "vendorName" } );
 
         assertEquals( 2, attributes.size() );
 
@@ -339,7 +346,8 @@
 
         try
         {
-            ctx.modifyAttributes( "", new ModificationItem[]{} );
+            ctx.modifyAttributes( "", new ModificationItem[]
+                {} );
 
             fail( "we should never get here" );
         }

Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/prefs/PreferencesUtilsTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/prefs/PreferencesUtilsTest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/prefs/PreferencesUtilsTest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/test/java/org/apache/directory/server/core/prefs/PreferencesUtilsTest.java Fri Feb 10 02:48:07 2006
@@ -47,9 +47,8 @@
 
         Name dn = PreferencesUtils.toSysDn( test );
 
-        assertEquals( dn.toString(), "prefNodeName=kerberos,prefNodeName=apache,prefNodeName=org," + PreferencesUtils.SYSPREF_BASE );
-
-
+        assertEquals( dn.toString(), "prefNodeName=kerberos,prefNodeName=apache,prefNodeName=org,"
+            + PreferencesUtils.SYSPREF_BASE );
 
         // simple test without trailing '/'
 
@@ -57,9 +56,8 @@
 
         dn = PreferencesUtils.toSysDn( test );
 
-        assertEquals( dn.toString(), "prefNodeName=kerberos,prefNodeName=apache,prefNodeName=org," + PreferencesUtils.SYSPREF_BASE );
-
-
+        assertEquals( dn.toString(), "prefNodeName=kerberos,prefNodeName=apache,prefNodeName=org,"
+            + PreferencesUtils.SYSPREF_BASE );
 
         // basis condition tests
 
@@ -68,8 +66,6 @@
         dn = PreferencesUtils.toSysDn( test );
 
         assertEquals( dn.toString(), PreferencesUtils.SYSPREF_BASE );
-
-
 
         // endpoint tests
 



Mime
View raw message