Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 63538 invoked from network); 19 Sep 2007 23:36:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2007 23:36:16 -0000 Received: (qmail 48667 invoked by uid 500); 19 Sep 2007 23:36:07 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 48636 invoked by uid 500); 19 Sep 2007 23:36:07 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 48625 invoked by uid 99); 19 Sep 2007 23:36:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 16:36:07 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 23:38:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 992891A9838; Wed, 19 Sep 2007 16:35:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r577469 - /directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Date: Wed, 19 Sep 2007 23:35:52 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070919233552.992891A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Wed Sep 19 16:35:51 2007 New Revision: 577469 URL: http://svn.apache.org/viewvc?rev=577469&view=rev Log: Removed a bunch of warnings using generics Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=577469&r1=577468&r2=577469&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java (original) +++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Wed Sep 19 16:35:51 2007 @@ -43,7 +43,9 @@ import org.apache.directory.server.schema.registries.OidRegistry; import org.apache.directory.shared.ldap.aci.ACITuple; import org.apache.directory.shared.ldap.aci.AuthenticationLevel; +import org.apache.directory.shared.ldap.aci.MicroOperation; import org.apache.directory.shared.ldap.aci.ProtectedItem; +import org.apache.directory.shared.ldap.aci.UserClass; import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem; import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem; import org.apache.directory.shared.ldap.message.AttributeImpl; @@ -59,8 +61,9 @@ */ 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_USER_CLASS_COLLECTION = Collections.unmodifiableCollection( new ArrayList() ); + private static final Collection EMPTY_ACI_TUPLE_COLLECTION = Collections.unmodifiableCollection( new ArrayList() ); + private static final Set EMPTY_MICRO_OPERATION_SET = Collections.unmodifiableSet( new HashSet() ); private static final LdapDN GROUP_NAME; private static final LdapDN USER_NAME; @@ -99,14 +102,14 @@ public void testZeroTuple() throws Exception { - Assert.assertEquals( 0, filterA.filter( EMPTY_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, + Assert.assertEquals( 0, filterA.filter( EMPTY_ACI_TUPLE_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 ); + Collection tuples = getTuples( ProtectedItem.ENTRY ); Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ENTRY, null, null, null, null, AuthenticationLevel.NONE, null, "ou", null, null, null ).size() ); @@ -115,7 +118,7 @@ public void testAllUserAttributeTypes() throws Exception { - Collection tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES ); + 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, @@ -138,7 +141,7 @@ public void testAllUserAttributeTypesAndValues() throws Exception { - Collection tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES ); + 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, @@ -163,7 +166,7 @@ { Collection attrTypes = new ArrayList(); attrTypes.add( "attrA" ); - Collection tuples = getTuples( new ProtectedItem.AllAttributeValues( attrTypes ) ); + 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, @@ -183,7 +186,7 @@ { Collection attrTypes = new ArrayList(); attrTypes.add( "attrA" ); - Collection tuples = getTuples( new ProtectedItem.AttributeType( attrTypes ) ); + 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, @@ -203,7 +206,7 @@ { Collection attributes = new ArrayList(); attributes.add( new AttributeImpl( "attrA", "valueA" ) ); - Collection tuples = getTuples( new ProtectedItem.AttributeValue( attributes ) ); + 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, @@ -235,7 +238,7 @@ public void testMaxImmSub() throws Exception { - Collection tuples = getTuples( new ProtectedItem.MaxImmSub( 2 ) ); + 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, @@ -247,7 +250,7 @@ { Collection mvcItems = new ArrayList(); mvcItems.add( new MaxValueCountItem( "attrA", 3 ) ); - Collection tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems ) ); + 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, @@ -289,7 +292,7 @@ { Collection rbItems = new ArrayList(); rbItems.add( new RestrictedByItem( "attrA", "attrB" ) ); - Collection tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems ) ); + 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, @@ -312,7 +315,7 @@ { Collection attrTypes = new ArrayList(); attrTypes.add( "attrA" ); - Collection tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) ); + Collection tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) ); Attributes entry = new AttributesImpl(); entry.put( "attrA", USER_NAME.toNormName() ); @@ -336,13 +339,13 @@ } - private static Collection getTuples( ProtectedItem protectedItem ) + 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_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, protectedItems, EMPTY_MICRO_OPERATION_SET, true, 0 ) ); return tuples; }