You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/01/21 01:58:22 UTC

svn commit: r901474 - in /directory/apacheds/trunk: avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ core/src/test/java/org/apache/directory/server/core/authz/support/ core/src/test/java/org/apache/directory/server/core/parti...

Author: elecharny
Date: Thu Jan 21 00:58:21 2010
New Revision: 901474

URL: http://svn.apache.org/viewvc?rev=901474&view=rev
Log:
Switched to JUnit 4 @nnotations

Removed:
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/partition/tree/
Modified:
    directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java

Modified: directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java?rev=901474&r1=901473&r2=901474&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java (original)
+++ directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java Thu Jan 21 00:58:21 2010
@@ -22,14 +22,17 @@
 
 import static org.apache.directory.server.core.partition.avl.TableData.injectDupsData;
 import static org.apache.directory.server.core.partition.avl.TableData.injectNoDupsData;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Comparator;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.junit.Before;
+import org.junit.Test;
 
 
 /**
@@ -38,7 +41,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AvlTableTest extends TestCase
+public class AvlTableTest
 {
     private AvlTable<Integer,Integer> dups;
     private AvlTable<Integer,Integer> nodups;
@@ -53,6 +56,7 @@
     }
     
     
+    @Test
     public void testGetName()
     {
         assertEquals( "dups", dups.getName() );
@@ -60,6 +64,7 @@
     }
     
     
+    @Test
     public void testCursorWithKey() throws Exception
     {
         injectNoDupsData( nodups );
@@ -107,6 +112,7 @@
     }
     
     
+    @Test
     public void testCursor() throws Exception
     {
         injectNoDupsData( nodups );
@@ -255,6 +261,7 @@
      * Checks that cursor.after() behavior with duplicates enabled obeys 
      * the required semantics.
      */
+    @Test
     public void testCursorAfterWithDups() throws Exception
     {
         injectDupsData( dups );
@@ -293,6 +300,7 @@
     /**
      * Tests the put() and get() methods on an AvlTable.
      */
+    @Test
     public void testPutGetCount() throws Exception
     {
         // ---------------------------------------------------------

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=901474&r1=901473&r2=901474&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Thu Jan 21 00:58:21 2010
@@ -119,7 +119,8 @@
     private static DirectoryService service;
 
     
-    @BeforeClass public static void setup() throws Exception
+    @BeforeClass 
+    public static void setup() throws Exception
     {
         service = new DefaultDirectoryService();
 
@@ -129,7 +130,8 @@
     }
 
 
-    @Test public void testWrongScope() throws Exception
+    @Test 
+    public void testWrongScope() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
@@ -146,7 +148,8 @@
     }
 
 
-    @Test public void testRootDSE() throws Exception
+    @Test 
+    public void testRootDSE() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
 
@@ -161,7 +164,8 @@
     }
 
 
-    @Test public void testZeroTuple() throws Exception
+    @Test 
+    public void testZeroTuple() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
 
@@ -170,7 +174,8 @@
     }
 
 
-    @Test public void testDenialTuple() throws Exception
+    @Test 
+    public void testDenialTuple() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
@@ -184,7 +189,8 @@
     }
 
 
-    @Test public void testGrantTuple() throws Exception
+    @Test 
+    public void testGrantTuple() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=901474&r1=901473&r2=901474&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java Thu Jan 21 00:58:21 2010
@@ -93,7 +93,9 @@
         }
     }
     
-    @Before public void setup() throws NamingException
+    
+    @Before 
+    public void setup() throws NamingException
     {
         LdapDN entryName = new LdapDN( "ou=test, ou=system" );
         ENTRY = new DefaultServerEntry( schemaManager, entryName );
@@ -104,7 +106,8 @@
     }
 
 
-    @Test public void testWrongScope() throws Exception
+    @Test 
+    public void testWrongScope() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
@@ -121,7 +124,8 @@
     }
 
 
-    @Test public void testZeroTuple() throws Exception
+    @Test 
+    public void testZeroTuple() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
 
@@ -130,7 +134,8 @@
     }
 
 
-    @Test public void testDenialTuple() throws Exception
+    @Test 
+    public void testDenialTuple() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
@@ -146,7 +151,8 @@
     }
 
 
-    @Test public void testGrantTuple() throws Exception
+    @Test 
+    public void testGrantTuple() throws Exception
     {
         MaxValueCountFilter filter = new MaxValueCountFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();

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=901474&r1=901473&r2=901474&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 Thu Jan 21 00:58:21 2010
@@ -87,7 +87,8 @@
     private static AttributeType CN_AT;
 
     
-    @BeforeClass public static void setup() throws Exception
+    @BeforeClass 
+    public static void setup() throws Exception
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
@@ -129,14 +130,16 @@
         return jndiAttributes;
     }
 
-    @Test public void testZeroTuple() throws Exception
+    @Test 
+    public void testZeroTuple() throws Exception
     {
         assertEquals( 0, filterA.filter( null, EMPTY_ACI_TUPLE_COLLECTION, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null,
             null, null, null, null, null, null, null, null, null ).size() );
     }
 
 
-    @Test public void testEntry() throws Exception
+    @Test 
+    public void testEntry() throws Exception
     {
         Collection<ACITuple> tuples = getTuples( ProtectedItem.ENTRY );
 
@@ -145,7 +148,8 @@
     }
 
 
-    @Test public void testAllUserAttributeTypes() throws Exception
+    @Test 
+    public void testAllUserAttributeTypes() throws Exception
     {
         Collection<ACITuple> tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES );
 
@@ -160,7 +164,8 @@
     }
 
 
-    @Test public void testAllUserAttributeTypesAndValues() throws Exception
+    @Test 
+    public void testAllUserAttributeTypesAndValues() throws Exception
     {
         Collection<ACITuple> tuples = getTuples( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES );
 
@@ -175,7 +180,8 @@
     }
 
 
-    @Test public void testAllAttributeValues() throws Exception
+    @Test 
+    public void testAllAttributeValues() throws Exception
     {
         Collection<String> attrTypes = new ArrayList<String>();
         attrTypes.add( "cn" );
@@ -195,7 +201,8 @@
     }
 
 
-    @Test public void testAttributeType() throws Exception
+    @Test 
+    public void testAttributeType() throws Exception
     {
         Collection<String> attrTypes = new ArrayList<String>();
         attrTypes.add( "cn" );
@@ -215,7 +222,8 @@
     }
 
 
-    @Test public void testAttributeValue() throws Exception
+    @Test 
+    public void testAttributeValue() throws Exception
     {
         Collection<ServerAttribute> attributes = new ArrayList<ServerAttribute>();
         attributes.add( new DefaultServerAttribute( "cn", CN_AT, "valueA" ) );
@@ -249,7 +257,8 @@
     }
 
 
-    @Test public void testMaxImmSub() throws Exception
+    @Test 
+    public void testMaxImmSub() throws Exception
     {
         Collection<ACITuple> tuples = getTuples( new ProtectedItem.MaxImmSub( 2 ) );
 
@@ -259,7 +268,8 @@
     }
 
 
-    @Test public void testMaxValueCount() throws Exception
+    @Test 
+    public void testMaxValueCount() throws Exception
     {
         Collection<MaxValueCountItem> mvcItems = new ArrayList<MaxValueCountItem>();
         mvcItems.add( new MaxValueCountItem( "cn", 3 ) );
@@ -302,7 +312,8 @@
     */
 
 
-    @Test public void testRestrictedBy() throws Exception
+    @Test 
+    public void testRestrictedBy() throws Exception
     {
         Collection<RestrictedByItem> rbItems = new ArrayList<RestrictedByItem>();
         rbItems.add( new RestrictedByItem( "cn", "sn" ) );
@@ -325,7 +336,8 @@
     }
 
 
-    @Test public void testSelfValue() throws Exception
+    @Test 
+    public void testSelfValue() throws Exception
     {
         Collection<String> attrTypes = new ArrayList<String>();
         attrTypes.add( "cn" );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=901474&r1=901473&r2=901474&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java Thu Jan 21 00:58:21 2010
@@ -75,7 +75,8 @@
     private static SchemaManager schemaManager;
 
     
-    @BeforeClass public static void setup() throws Exception
+    @BeforeClass 
+    public static void setup() throws Exception
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
@@ -96,7 +97,8 @@
     }
 
 
-    @Test public void testWrongScope() throws Exception
+    @Test 
+    public void testWrongScope() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
@@ -112,7 +114,8 @@
     }
 
 
-    @Test public void testZeroTuple() throws Exception
+    @Test 
+    public void testZeroTuple() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
 
@@ -121,7 +124,8 @@
     }
 
 
-    @Test public void testDenialTuple() throws Exception
+    @Test 
+    public void testDenialTuple() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
@@ -134,7 +138,8 @@
     }
 
 
-    @Test public void testGrantTuple() throws Exception
+    @Test 
+    public void testGrantTuple() throws Exception
     {
         RestrictedByFilter filter = new RestrictedByFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?rev=901474&r1=901473&r2=901474&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java Thu Jan 21 00:58:21 2010
@@ -104,7 +104,8 @@
     /**
      * Sets evaluator and registries to null.
      */
-    @After public void tearDown()
+    @After 
+    public void tearDown()
     {
         evaluator = null;
     }
@@ -114,7 +115,8 @@
      * Test cases for various bad combinations of arguments
      * @throws Exception if something goes wrong
      */
-    @Test public void testForBadArguments() throws Exception
+    @Test 
+    public void testForBadArguments() throws Exception
     {
         try
         {
@@ -145,7 +147,8 @@
     }
 
 
-    @Test public void testMatchByName() throws Exception
+    @Test 
+    public void testMatchByName() throws Exception
     {
         ServerAttribute objectClasses = null;
 
@@ -165,7 +168,8 @@
     }
 
 
-    @Test public void testMatchByOID() throws Exception
+    @Test 
+    public void testMatchByOID() throws Exception
     {
         ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
         
@@ -184,7 +188,8 @@
     }
 
 
-    @Test public void testComplexOrRefinement() throws Exception
+    @Test 
+    public void testComplexOrRefinement() throws Exception
     {
         ExprNode refinement = null;
         ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
@@ -202,7 +207,8 @@
     }
 
 
-    @Test public void testComplexAndRefinement() throws Exception
+    @Test 
+    public void testComplexAndRefinement() throws Exception
     {
         ExprNode refinement = null;
         ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
@@ -224,7 +230,8 @@
     }
 
 
-    @Test public void testComplexNotRefinement() throws Exception
+    @Test 
+    public void testComplexNotRefinement() throws Exception
     {
         ExprNode refinement = null;
         ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?rev=901474&r1=901473&r2=901474&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Thu Jan 21 00:58:21 2010
@@ -101,7 +101,8 @@
     /**
      * Sets evaluator and registries to null.
      */
-    @After public void tearDown()
+    @After 
+    public void tearDown()
     {
         evaluator = null;
     }
@@ -111,7 +112,8 @@
      * Test cases for various bad combinations of arguments
      * @throws Exception if something goes wrongg
      */
-    @Test public void testForBadArguments() throws Exception
+    @Test 
+    public void testForBadArguments() throws Exception
     {
         ServerAttribute objectClasses = null;
 
@@ -164,7 +166,8 @@
     }
 
 
-    @Test public void testMatchByName() throws Exception
+    @Test 
+    public void testMatchByName() throws Exception
     {
         // positive test
         ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
@@ -184,7 +187,8 @@
     }
 
 
-    @Test public void testMatchByOID() throws Exception
+    @Test 
+    public void testMatchByOID() throws Exception
     {
         ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );