directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r896599 [22/30] - in /directory/apacheds/trunk: ./ avl-partition/ avl-partition/src/ avl-partition/src/main/ avl-partition/src/main/java/ avl-partition/src/main/java/org/ avl-partition/src/main/java/org/apache/ avl-partition/src/main/java/o...
Date Wed, 06 Jan 2010 18:27:19 GMT
Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java Wed Jan  6 18:26:43 2010
@@ -19,29 +19,35 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.directory.server.xdbm.Table;
-import org.apache.directory.server.xdbm.Tuple;
-import org.apache.directory.server.schema.SerializableComparator;
-import org.apache.directory.server.schema.registries.ComparatorRegistry;
-import org.apache.directory.shared.ldap.cursor.Cursor;
-import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
-import org.apache.directory.shared.ldap.schema.parsers.ComparatorDescription;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
+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 static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.Comparator;
-import java.util.Iterator;
 
 import jdbm.RecordManager;
 import jdbm.recman.BaseRecordManager;
 
-import javax.naming.NamingException;
+import org.apache.directory.server.xdbm.Table;
+import org.apache.directory.server.xdbm.Tuple;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.cursor.Cursor;
+import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
+import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.loader.ldif.LdifSchemaLoader;
+import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -56,15 +62,44 @@
     private static final Logger LOG = LoggerFactory.getLogger( NoDupsCursorTest.class.getSimpleName() );
     private static final String TEST_OUTPUT_PATH = "test.output.path";
 
-    transient Table<Integer,Integer> table;
+    transient Table<String,String> table;
     transient File dbFile;
     transient RecordManager recman;
+    private static SchemaManager schemaManager;
+
+
+    @BeforeClass
+    public static void init() throws Exception
+    {
+        String workingDirectory = System.getProperty( "workingDirectory" );
+
+        if ( workingDirectory == null )
+        {
+            String path = DupsContainerCursorTest.class.getResource( "" ).getPath();
+            int targetPos = path.indexOf( "target" );
+            workingDirectory = path.substring( 0, targetPos + 6 );
+        }
+
+        File schemaRepository = new File( workingDirectory, "schema" );
+        SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
+        extractor.extractOrCopy( true );
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        schemaManager = new DefaultSchemaManager( loader );
+
+        boolean loaded = schemaManager.loadAllEnabled();
+
+        if ( !loaded )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( schemaManager.getErrors() ) );
+        }
+    }
 
 
     @Before
     public void createTable() throws Exception
     {
         File tmpDir = null;
+        
         if ( System.getProperty( TEST_OUTPUT_PATH, null ) != null )
         {
             tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
@@ -73,9 +108,11 @@
         dbFile = File.createTempFile( getClass().getSimpleName(), "db", tmpDir );
         recman = new BaseRecordManager( dbFile.getAbsolutePath() );
 
-        // gosh this is a terrible use of a global static variable
-        SerializableComparator.setRegistry( new MockComparatorRegistry() );
-        table = new JdbmTable<Integer,Integer>( "test", recman, new SerializableComparator<Integer>( "" ), null, null );
+        SerializableComparator<String> comparator = new SerializableComparator<String>( SchemaConstants.INTEGER_ORDERING_MATCH_MR_OID );
+        comparator.setSchemaManager( schemaManager );
+
+        table = new JdbmTable<String,String>( schemaManager, "test", recman, 
+            comparator, null, null );
         LOG.debug( "Created new table and populated it with data" );
     }
 
@@ -98,7 +135,7 @@
     @Test( expected=InvalidCursorPositionException.class )
     public void testEmptyTable() throws Exception
     {
-        Cursor<Tuple<Integer,Integer>> cursor = table.cursor();
+        Cursor<Tuple<String,String>> cursor = table.cursor();
         assertNotNull( cursor );
         
         assertFalse( cursor.available() );
@@ -111,7 +148,7 @@
         cursor = table.cursor();
         assertFalse( cursor.next() );
 
-        cursor.after( new Tuple<Integer,Integer>(7,7) );
+        cursor.after( new Tuple<String,String>( "7", "7" ) );
         cursor.get();
     }
 
@@ -119,13 +156,13 @@
     @Test
     public void testOnTableWithSingleEntry() throws Exception
     {
-        table.put( 1, 1 );
-        Cursor<Tuple<Integer,Integer>> cursor = table.cursor();
+        table.put( "1", "1" );
+        Cursor<Tuple<String,String>> cursor = table.cursor();
         assertTrue( cursor.first() );
     
-        Tuple<Integer,Integer> tuple = cursor.get();
-        assertTrue( tuple.getKey().equals( 1 ) );
-        assertTrue( tuple.getValue().equals( 1 ) );
+        Tuple<String,String> tuple = cursor.get();
+        assertEquals( "1", tuple.getKey() );
+        assertEquals( "1", tuple.getValue() );
     
         cursor.beforeFirst();
         assertFalse( cursor.previous() );
@@ -138,35 +175,36 @@
     {
         for( int i=1; i < 10; i++ )
         {
-            table.put( i, i );
+            String istr = Integer.toString( i );
+            table.put( istr, istr );
         }
     
-        Cursor<Tuple<Integer,Integer>> cursor = table.cursor();
+        Cursor<Tuple<String,String>> cursor = table.cursor();
         
-        cursor.after( new Tuple<Integer,Integer>( 2,2 ) );
+        cursor.after( new Tuple<String,String>( "2", "2" ) );
         assertTrue( cursor.next() );
     
-        Tuple<Integer,Integer> tuple = cursor.get();
-        assertTrue( tuple.getKey().equals( 3 ) );
-        assertTrue( tuple.getValue().equals( 3 ) );
+        Tuple<String,String> tuple = cursor.get();
+        assertEquals( "3", tuple.getKey() );
+        assertEquals( "3", tuple.getValue() );
     
-        cursor.before( new Tuple<Integer,Integer>(7,7) );
+        cursor.before( new Tuple<String,String>( "7", "7" ) );
         cursor.next();
         tuple = cursor.get();
-        assertTrue( tuple.getKey().equals( 7 ) );
-        assertTrue( tuple.getValue().equals( 7 ) );
+        assertEquals( "7", tuple.getKey() );
+        assertEquals( "7", tuple.getValue() );
     
         cursor.last();
         cursor.next();
         tuple = cursor.get();
-        assertTrue( tuple.getKey().equals( 9 ) );
-        assertTrue( tuple.getValue().equals( 9 ) );
+        assertEquals( "9", tuple.getKey() );
+        assertEquals( "9", tuple.getValue() );
     
         cursor.beforeFirst();
         cursor.next();
         tuple = cursor.get();
-        assertTrue( tuple.getKey().equals( 1 ) );
-        assertTrue( tuple.getValue().equals( 1 ) );
+        assertEquals( "1", tuple.getKey() );
+        assertEquals( "1", tuple.getValue() );
     
         cursor.afterLast();
         assertFalse( cursor.next() );
@@ -176,13 +214,13 @@
         
         // just to clear the jdbmTuple value so that line 127 inside after(tuple) method
         // can be executed as part of the below after(tuple) call
-        cursor.before(new Tuple<Integer,Integer>( 1,1 )); 
-        cursor.after( new Tuple<Integer,Integer>( 0,0 ) );
+        cursor.before(new Tuple<String,String>( "1", "1" )); 
+        cursor.after( new Tuple<String,String>( "0", "0" ) );
         
         cursor.next();
         tuple = cursor.get();
-        assertTrue( tuple.getKey().equals( 1 ) );
-        assertTrue( tuple.getValue().equals( 1 ) );
+        assertEquals( "1", tuple.getKey() );
+        assertEquals( "1", tuple.getValue() );
     }
     
 
@@ -191,59 +229,60 @@
     {
         for( int i=1; i < 10; i++ )
         {
-            table.put( i, i );
+            String istr = Integer.toString( i );
+            table.put( istr, istr );
         }
     
-        Cursor<Tuple<Integer,Integer>> cursor = table.cursor();
+        Cursor<Tuple<String,String>> cursor = table.cursor();
         
         // go to last and call next then previous twice then next
         cursor.afterLast();
         assertFalse( cursor.next() );
         assertTrue( cursor.previous() );
-        assertEquals( 9, ( int ) cursor.get().getKey() );
+        assertEquals( "9", cursor.get().getKey() );
         
         assertTrue( cursor.previous() );
-        assertEquals( 8, ( int ) cursor.get().getKey() );
+        assertEquals( "8", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
-         assertEquals( 9, ( int ) cursor.get().getKey() );
+         assertEquals( "9", cursor.get().getKey() );
  
         
         // go to last and call previous then next and again previous 
         cursor.afterLast();
         assertTrue( cursor.previous() );
-        assertEquals( 9, ( int ) cursor.get().getKey() );
+        assertEquals( "9", cursor.get().getKey() );
         
         assertTrue( cursor.next() );
-        assertEquals( 9, ( int ) cursor.get().getKey() );
+        assertEquals( "9", cursor.get().getKey() );
         
         assertTrue( cursor.previous() );
-        assertEquals( 8, ( int ) cursor.get().getKey() );
+        assertEquals( "8", cursor.get().getKey() );
         
         
         // go to first and call previous then next twice and again next
         cursor.beforeFirst();
         assertFalse( cursor.previous() );
         assertTrue( cursor.next() );
-        assertEquals( 1, ( int ) cursor.get().getKey() );
+        assertEquals( "1", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
-        assertEquals( 2, ( int ) cursor.get().getKey() );
+        assertEquals( "2", cursor.get().getKey() );
         
         assertTrue( cursor.previous() );
-        assertEquals( 1, ( int ) cursor.get().getKey() );
+        assertEquals( "1", cursor.get().getKey() );
 
 
         // go to first and call next twice then previous
         cursor.beforeFirst();
         assertTrue( cursor.next() );
-        assertEquals( 1, ( int ) cursor.get().getKey() );
+        assertEquals( "1", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
-        assertEquals( 2, ( int ) cursor.get().getKey() );
+        assertEquals( "2", cursor.get().getKey() );
         
         assertTrue( cursor.previous() );
-        assertEquals( 1, ( int ) cursor.get().getKey() );
+        assertEquals( "1", cursor.get().getKey() );
 
     }
     
@@ -252,65 +291,4 @@
     public void testMiscellaneous() throws Exception
     {
     }
-
-
-    private class MockComparatorRegistry implements ComparatorRegistry
-    {
-        private Comparator<Integer> comparator = new Comparator<Integer>()
-        {
-            public int compare( Integer i1, Integer i2 )
-            {
-                return i1.compareTo( i2 );
-            }
-        };
-
-        public String getSchemaName( String oid ) throws NamingException
-        {
-            return null;
-        }
-
-
-        public void register( ComparatorDescription description, Comparator comparator ) throws NamingException
-        {
-        }
-
-
-        public Comparator lookup( String oid ) throws NamingException
-        {
-            return comparator;
-        }
-
-
-        public boolean hasComparator( String oid )
-        {
-            return true;
-        }
-
-
-        public Iterator<String> iterator()
-        {
-            return null;
-        }
-
-
-        public Iterator<ComparatorDescription> comparatorDescriptionIterator()
-        {
-            return null;
-        }
-
-
-        public void unregister( String oid ) throws NamingException
-        {
-        }
-
-
-        public void unregisterSchemaElements( String schemaName )
-        {
-        }
-
-
-        public void renameSchema( String originalSchemaName, String newSchemaName )
-        {
-        }
-    }
 }

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java Wed Jan  6 18:26:43 2010
@@ -46,20 +46,18 @@
 
 package jdbm.btree;
 
-import jdbm.RecordManager;
-
-import jdbm.helper.Serializer;
-import jdbm.helper.Tuple;
-import jdbm.helper.TupleBrowser;
-
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.Serializable;
-
 import java.util.Comparator;
 
+import jdbm.RecordManager;
+import jdbm.helper.Serializer;
+import jdbm.helper.Tuple;
+import jdbm.helper.TupleBrowser;
+
 /**
  * B+Tree persistent indexing data structure.  B+Trees are optimized for
  * block-based, random I/O storage because they store multiple keys on
@@ -605,5 +603,14 @@
             return false;
         }
     }
+
+
+    /**
+     * @return the _comparator
+     */
+    public Comparator getComparator()
+    {
+        return _comparator;
+    }
 }
 

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Ticket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Ticket.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Ticket.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Ticket.java Wed Jan  6 18:26:43 2010
@@ -29,14 +29,8 @@
 import org.apache.directory.server.kerberos.shared.KerberosConstants;
 import org.apache.directory.server.kerberos.shared.KerberosUtils;
 import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
-import org.apache.directory.server.kerberos.shared.messages.value.AuthorizationData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
-import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
-import org.apache.directory.server.kerberos.shared.messages.value.HostAddresses;
-import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
 import org.apache.directory.server.kerberos.shared.messages.value.PrincipalName;
-import org.apache.directory.server.kerberos.shared.messages.value.TransitedEncoding;
-import org.apache.directory.server.kerberos.shared.messages.value.flags.TicketFlags;
 import org.apache.directory.shared.asn1.AbstractAsn1Object;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java Wed Jan  6 18:26:43 2010
@@ -23,7 +23,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.directory.DirContext;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.core.CoreSession;
@@ -33,11 +32,11 @@
 import org.apache.directory.server.core.entry.ServerModification;
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
 import org.apache.directory.server.protocol.shared.store.DirectoryServiceOperation;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -77,16 +76,16 @@
             return null;
         }
 
-        AttributeTypeRegistry registry = session.getDirectoryService().getRegistries().getAttributeTypeRegistry();
+        SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
         
         List<Modification> mods = new ArrayList<Modification>(2);
         
         ServerAttribute newPasswordAttribute = new DefaultServerAttribute( 
-            registry.lookup( SchemaConstants.USER_PASSWORD_AT ), StringTools.getBytesUtf8( newPassword ) );
+            schemaManager.lookupAttributeTypeRegistry( SchemaConstants.USER_PASSWORD_AT ), StringTools.getBytesUtf8( newPassword ) );
         mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, newPasswordAttribute ) );
         
         ServerAttribute principalAttribute = new DefaultServerAttribute( 
-            registry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ), principal.getName() );
+            schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ), principal.getName() );
         mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, principalAttribute ) );
         
         //FIXME check if keyderivation is necessary

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java Wed Jan  6 18:26:43 2010
@@ -94,7 +94,7 @@
     {
         PrincipalStoreEntryModifier modifier = new PrincipalStoreEntryModifier();
 
-        modifier.setDistinguishedName( entry.getDn().getUpName() );
+        modifier.setDistinguishedName( entry.getDn().getName() );
 
         String principal = entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ).getString();
         modifier.setPrincipal( new KerberosPrincipal( principal ) );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java Wed Jan  6 18:26:43 2010
@@ -28,7 +28,6 @@
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -37,6 +36,7 @@
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -101,9 +101,9 @@
      * @return the filter expression tree
      * @throws Exception if there are problems while looking up attributes
      */
-    private static ExprNode getFilter( AttributeTypeRegistry registry, String principal ) throws Exception
+    private static ExprNode getFilter( SchemaManager schemaManager, String principal ) throws Exception
     {
-        AttributeType type = registry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
+        AttributeType type = schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
         Value<String> value = new ServerStringValue( type, principal );
         return new EqualityNode<String>( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, value );
     }
@@ -125,9 +125,9 @@
         
         try
         {
-            AttributeTypeRegistry registry = session.getDirectoryService().getRegistries().getAttributeTypeRegistry();
+            SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
             cursor = session.search( searchBaseDn, SearchScope.SUBTREE, 
-                getFilter( registry, principal ), AliasDerefMode.DEREF_ALWAYS, null );
+                getFilter( schemaManager, principal ), AliasDerefMode.DEREF_ALWAYS, null );
     
             cursor.beforeFirst();
             if ( cursor.next() )

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java Wed Jan  6 18:26:43 2010
@@ -24,16 +24,18 @@
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.kerberos.shared.KerberosUtils;
-
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Test the KerberosUtils class
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class KerberosUtilsTest extends TestCase
+public class KerberosUtilsTest
 {
+    @Before
     public void setUp()
     {
         // First setup a default realm
@@ -42,6 +44,7 @@
     }
 
     
+    @Test
     public void testKerberosNameSimple() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc" );
@@ -66,6 +69,7 @@
     */
 
 
+    @Test
     public void testKerberosNameSimpleWithRealm() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc@APACHE.ORG" );
@@ -75,6 +79,7 @@
         assertEquals( "abc", names.get( 0 ) );
     }
     
+    @Test
     public void testKerberosNameThree() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc/def/ghi" );
@@ -86,6 +91,7 @@
         assertEquals( "ghi", names.get( 2 ) );
     }
 
+    @Test
     public void testKerberosNameThreeWithRealm() throws Exception
     {
         KerberosPrincipal kp = new KerberosPrincipal( "abc/def/ghi@APACHE.ORG" );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java Wed Jan  6 18:26:43 2010
@@ -29,8 +29,10 @@
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests the use of AES for Kerberos, using test vectors from RFC 3962,
@@ -39,7 +41,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AesEncryptionTest extends TestCase
+public class AesEncryptionTest
 {
     private byte[] keyBytes =
         { ( byte ) 0x63, ( byte ) 0x68, ( byte ) 0x69, ( byte ) 0x63, ( byte ) 0x6b, ( byte ) 0x65, ( byte ) 0x6e,
@@ -60,6 +62,7 @@
      * Tests the first test vector from RFC 3962,
      * "Advanced Encryption Standard (AES) Encryption for Kerberos 5."
      */
+    @Test
     public void testFirstAesVector()
     {
         if ( !VendorHelper.isCtsSupported() )
@@ -88,6 +91,7 @@
      * Tests the last test vector from RFC 3962,
      * "Advanced Encryption Standard (AES) Encryption for Kerberos 5."
      */
+    @Test
     public void testLastAesVector()
     {
         if ( !VendorHelper.isCtsSupported() )

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java Wed Jan  6 18:26:43 2010
@@ -28,13 +28,14 @@
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedTimeStamp;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -43,7 +44,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class CipherTextHandlerTest extends TestCase
+public class CipherTextHandlerTest
 {
     private byte[] desEncryptedTimeStamp =
         { ( byte ) 0x97, ( byte ) 0x21, ( byte ) 0x58, ( byte ) 0x5f, ( byte ) 0x81, ( byte ) 0x46, ( byte ) 0x17,
@@ -111,6 +112,7 @@
      * of the supported encryption types.  The length of the Kerberos Cipher Text
      * is relevant to the structure of the underlying plaintext.
      */
+    @Test
     public void testTestVectorLengths()
     {
         assertEquals( "DES length", 56, desEncryptedTimeStamp.length );
@@ -126,6 +128,7 @@
      * an integrity check, an attempt is made to decode the bytes as an EncryptedTimestamp.  The
      * result is timestamp data.
      */
+    @Test
     public void testDesGoodPasswordDecrypt()
     {
         CipherTextHandler lockBox = new CipherTextHandler();
@@ -152,6 +155,7 @@
      * Tests the unsealing of Kerberos CipherText with a bad password.  After decryption, the
      * checksum is tested and should fail on comparison, resulting in an integrity check error.
      */
+    @Test
     public void testDesBadPasswordDecrypt()
     {
         CipherTextHandler lockBox = new CipherTextHandler();
@@ -178,6 +182,7 @@
      * an integrity check, an attempt is made to decode the bytes as an EncryptedTimestamp.  The
      * result is timestamp data.
      */
+    @Test
     public void testTripleDesGoodPasswordDecrypt()
     {
         CipherTextHandler lockBox = new CipherTextHandler();
@@ -208,6 +213,7 @@
      * 
      * @throws ParseException 
      */
+    @Test
     public void testTripleDesGoodPasswordEncrypt() throws ParseException
     {
         CipherTextHandler lockBox = new CipherTextHandler();
@@ -252,6 +258,7 @@
      * an integrity check, an attempt is made to decode the bytes as an EncryptedTimestamp.  The
      * result is timestamp data.
      */
+    @Test
     public void testAes128GoodPasswordDecrypt()
     {
         if ( !VendorHelper.isCtsSupported() )
@@ -286,6 +293,7 @@
      * 
      * @throws ParseException 
      */
+    @Test
     public void testAes128GoodPasswordEncrypt() throws ParseException
     {
         if ( !VendorHelper.isCtsSupported() )
@@ -334,6 +342,7 @@
      * an integrity check, an attempt is made to decode the bytes as an EncryptedTimestamp.  The
      * result is timestamp data.
      */
+    @Test
     public void testAes256GoodPasswordDecrypt()
     {
         if ( !VendorHelper.isCtsSupported() )
@@ -380,6 +389,7 @@
      * 
      * @throws ParseException 
      */
+    @Test
     public void testAes256GoodPasswordEncrypt() throws ParseException
     {
         if ( !VendorHelper.isCtsSupported() )

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryptionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryptionTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryptionTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryptionTest.java Wed Jan  6 18:26:43 2010
@@ -25,7 +25,9 @@
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -35,7 +37,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Des3CbcSha1KdEncryptionTest extends TestCase
+public class Des3CbcSha1KdEncryptionTest
 {
     private Des3CbcSha1KdEncryption keyDerivationFunction = new Des3CbcSha1KdEncryption();
 
@@ -43,6 +45,7 @@
     /**
      * Tests setting parity as defined in RFC 3961.
      */
+    @Test
     public void testParity()
     {
         byte[] test =
@@ -60,6 +63,7 @@
     /**
      * Tests 'deriveRandom' and 'randomToKey' functions. 
      */
+    @Test
     public void testDerivedKey()
     {
         byte[] key =
@@ -94,6 +98,7 @@
     /**
      * Tests 'deriveRandom' and 'randomToKey' functions. 
      */
+    @Test
     public void testDerivedKey2()
     {
         byte[] key =
@@ -128,6 +133,7 @@
     /**
      * Tests that key derivation can be performed for a Triple-DES key.
      */
+    @Test
     public void testTestVectorsTripleDesKerberosKey1()
     {
         byte[] expectedKey =
@@ -148,6 +154,7 @@
     /**
      * Tests that key derivation can be performed for a Triple-DES key.
      */
+    @Test
     public void testTestVectorsTripleDesKerberosKey2()
     {
         byte[] expectedKey =
@@ -168,6 +175,7 @@
     /**
      * Tests that key derivation can be performed for a Triple-DES key.
      */
+    @Test
     public void testTestVectorsTripleDesKerberosKey3()
     {
         byte[] expectedKey =
@@ -188,6 +196,7 @@
     /**
      * Tests that key derivation can be performed for a Triple-DES key.
      */
+    @Test
     public void testTestVectorsTripleDesKerberosKey4()
     {
         if ( VendorHelper.isIbm() )
@@ -213,6 +222,7 @@
     /**
      * Tests that key derivation can be performed for a Triple-DES key.
      */
+    @Test
     public void testTestVectorsTripleDesKerberosKey5()
     {
         if ( VendorHelper.isIbm() )

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryptionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryptionTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryptionTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryptionTest.java Wed Jan  6 18:26:43 2010
@@ -23,10 +23,10 @@
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -35,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class DesCbcCrcEncryptionTest extends TestCase
+public class DesCbcCrcEncryptionTest
 {
     private static final char[] PASSWORD = "password".toCharArray();
 
@@ -45,6 +45,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testPlainTextSizeLessThanBlockSize() throws Exception
     {
         KerberosKey key = new KerberosKey( new KerberosPrincipal( "hnelson@EXAMPLE.COM" ), PASSWORD, "DES" );
@@ -68,6 +69,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testPlainTextSizeEqualsBlockSize() throws Exception
     {
         KerberosKey key = new KerberosKey( new KerberosPrincipal( "hnelson@EXAMPLE.COM" ), PASSWORD, "DES" );
@@ -91,6 +93,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testPlainTextSizeGreaterThanBlockSize() throws Exception
     {
         KerberosKey key = new KerberosKey( new KerberosPrincipal( "hnelson@EXAMPLE.COM" ), PASSWORD, "DES" );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5EncryptionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5EncryptionTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5EncryptionTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5EncryptionTest.java Wed Jan  6 18:26:43 2010
@@ -23,10 +23,10 @@
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -35,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class DesCbcMd5EncryptionTest extends TestCase
+public class DesCbcMd5EncryptionTest
 {
     private static final char[] PASSWORD = "password".toCharArray();
 
@@ -45,6 +45,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testPlainTextSizeLessThanBlockSize() throws Exception
     {
         KerberosKey key = new KerberosKey( new KerberosPrincipal( "hnelson@EXAMPLE.COM" ), PASSWORD, "DES" );
@@ -68,6 +69,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testPlainTextSizeEqualsBlockSize() throws Exception
     {
         KerberosKey key = new KerberosKey( new KerberosPrincipal( "hnelson@EXAMPLE.COM" ), PASSWORD, "DES" );
@@ -91,6 +93,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testPlainTextSizeGreaterThanBlockSize() throws Exception
     {
         KerberosKey key = new KerberosKey( new KerberosPrincipal( "hnelson@EXAMPLE.COM" ), PASSWORD, "DES" );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesStringToKeyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesStringToKeyTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesStringToKeyTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesStringToKeyTest.java Wed Jan  6 18:26:43 2010
@@ -25,7 +25,9 @@
 
 import javax.crypto.spec.DESKeySpec;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -35,7 +37,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class DesStringToKeyTest extends TestCase
+public class DesStringToKeyTest
 {
     private byte[] fanFold1 =
         { ( byte ) 0xC0, ( byte ) 0x1E, ( byte ) 0x38, ( byte ) 0x68, ( byte ) 0x8A, ( byte ) 0xC8, ( byte ) 0x6C,
@@ -63,6 +65,7 @@
     /**
      * Tests DES StringToKey test vector 1 from RFC 3961.
      */
+    @Test
     public void testDesStringToKeyVector1()
     {
         byte[] key = stringToKey.getKey( "password", "ATHENA.MIT.EDU", "raeburn" );
@@ -74,6 +77,7 @@
     /**
      * Tests DES StringToKey test vector 2 from RFC 3961.
      */
+    @Test
     public void testDesStringToKeyVector2()
     {
         byte[] key = stringToKey.getKey( "potatoe", "WHITEHOUSE.GOV", "danny" );
@@ -87,6 +91,7 @@
      *
      * @throws InvalidKeyException
      */
+    @Test
     public void testIntermediateDesStringToKeyVector1() throws InvalidKeyException
     {
         String passPhrase = "passwordATHENA.MIT.EDUraeburn";
@@ -110,6 +115,7 @@
      * 
      * @throws InvalidKeyException
      */
+    @Test
     public void testIntermediateDesStringToKeyVector2() throws InvalidKeyException
     {
         String passPhrase = "potatoeWHITEHOUSE.GOVdanny";

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java Wed Jan  6 18:26:43 2010
@@ -28,9 +28,10 @@
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -40,11 +41,12 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class KerberosKeyFactoryTest extends TestCase
+public class KerberosKeyFactoryTest
 {
     /**
      * Tests that key derivation can be performed for a DES key.
      */
+    @Test
     public void testDesKerberosKey()
     {
         KerberosPrincipal principal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" );
@@ -57,6 +59,7 @@
     /**
      * Tests that key derivation can be performed for a Triple-DES key.
      */
+    @Test
     public void testTripleDesKerberosKey()
     {
         KerberosPrincipal principal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" );
@@ -70,6 +73,7 @@
     /**
      * Tests that key derivation can be performed for an RC4-HMAC key.
      */
+    @Test
     public void testArcFourHmacKerberosKey()
     {
         if ( !VendorHelper.isArcFourHmacSupported() )
@@ -89,6 +93,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testAes128KerberosKey() throws Exception
     {
         KerberosPrincipal principal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" );
@@ -101,6 +106,7 @@
     /**
      * Tests that key derivation can be performed for an AES-256 key.
      */
+    @Test
     public void testAes256KerberosKey()
     {
         try
@@ -119,6 +125,7 @@
     /**
      * Tests that key derivation can be performed by the factory for the des-cbc-md5 encryption type.
      */
+    @Test
     public void testKerberosKeyFactoryOnlyDes()
     {
         String principalName = "hnelson@EXAMPLE.COM";
@@ -150,6 +157,7 @@
     /**
      * Tests that key derivation can be performed by the factory for the des3-cbc-sha1-kd encryption type.
      */
+    @Test
     public void testKerberosKeyFactoryOnlyTripleDes()
     {
         if ( !VendorHelper.isTripleDesSupported() )
@@ -188,6 +196,7 @@
     /**
      * Tests that key derivation can be performed by the factory for the rc4-hmac encryption type.
      */
+    @Test
     public void testKerberosKeyFactoryOnlyArcFourHmac()
     {
         if ( !VendorHelper.isArcFourHmacSupported() )
@@ -225,6 +234,7 @@
     /**
      * Tests that key derivation can be performed by the factory for the aes128-cts-hmac-sha1-96 encryption type.
      */
+    @Test
     public void testKerberosKeyFactoryOnlyAes128()
     {
         if ( VendorHelper.isIbm() )
@@ -263,6 +273,7 @@
     /**
      * Tests that key derivation can be performed by the factory for the aes256-cts-hmac-sha1-96 encryption type.
      */
+    @Test
     public void testKerberosKeyFactoryOnlyAes256()
     {
         if ( VendorHelper.isIbm() )
@@ -306,6 +317,7 @@
     /**
      * Tests that key derivation can be performed by the factory for multiple encryption types.
      */
+    @Test
     public void testKerberosKeyFactory()
     {
         if ( VendorHelper.isIbm() )

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java Wed Jan  6 18:26:43 2010
@@ -26,7 +26,6 @@
 import java.security.Security;
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -37,8 +36,10 @@
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.DESKeySpec;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test cases for the encryption types used by Kerberos "5.2" per RFC 4120,
@@ -58,16 +59,17 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class KeyTypeTest extends TestCase
+public class KeyTypeTest
 {
     /**
      * Tests that the cipher types used by Kerberos exist, namely
      * DES, DESede, RC4, and AES.
      */
+    @Test
     public void testKeyTypes()
     {
         String[] names = getCryptoImpls( "Cipher" );
-        List ciphers = Arrays.asList( names );
+        List<String> ciphers = Arrays.asList( names );
 
         assertTrue( ciphers.contains( "DES" ) );
         assertTrue( ciphers.contains( "DESede" ) );
@@ -82,10 +84,11 @@
      * Tests that the message digest types used by Kerberos exist, namely
      * SHA1 and MD5.
      */
+    @Test
     public void testMessageDigestTypes()
     {
         String[] names = getCryptoImpls( "MessageDigest" );
-        List ciphers = Arrays.asList( names );
+        List<String> ciphers = Arrays.asList( names );
 
         assertTrue( ciphers.contains( "MD5" ) );
         assertTrue( ciphers.contains( "SHA1" ) );
@@ -96,10 +99,11 @@
      * Tests that the MAC types used by Kerberos exist, namely
      * HmacMD5 and HmacSHA1.
      */
+    @Test
     public void testMacTypes()
     {
         String[] names = getCryptoImpls( "Mac" );
-        List ciphers = Arrays.asList( names );
+        List<String> ciphers = Arrays.asList( names );
 
         assertTrue( ciphers.contains( "HmacMD5" ) );
         assertTrue( ciphers.contains( "HmacSHA1" ) );
@@ -111,6 +115,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void generateDes() throws Exception
     {
         byte[] desKeyData =
@@ -129,6 +134,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testDesCipher() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "DES" );
@@ -145,6 +151,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testTripleDesCipher() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "DESede" );
@@ -161,6 +168,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testArcFourCipher() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "ARCFOUR" );
@@ -178,6 +186,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testAes128Cipher() throws Exception
     {
         KeyGenerator keyGenerator = KeyGenerator.getInstance( "AES" );
@@ -204,6 +213,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testAes256Cipher() throws Exception
     {
         KeyGenerator keyGenerator = KeyGenerator.getInstance( "AES" );
@@ -233,6 +243,7 @@
      * 
      * @throws Exception
      */
+    @Test
     public void testGenerateHmacMd5() throws Exception
     {
         KeyGenerator kg = KeyGenerator.getInstance( "HmacMD5" );
@@ -251,6 +262,7 @@
      * 
      * @throws Exception
      */
+    @Test
     public void testGenerateHmacSha1() throws Exception
     {
         KeyGenerator kg = KeyGenerator.getInstance( "HmacSHA1" );
@@ -275,13 +287,15 @@
         Set<String> result = new HashSet<String>();
 
         Provider[] providers = Security.getProviders();
-        for ( int i = 0; i < providers.length; i++ )
+        
+        for ( Provider provider : providers )
         {
             // Get services provided by each provider
-            Set keys = providers[i].keySet();
-            for ( Iterator it = keys.iterator(); it.hasNext(); )
+            Set<Object> keys = provider.keySet();
+            
+            for ( Object keyObject : keys )
             {
-                String key = ( String ) it.next();
+                String key = ( String ) keyObject;
                 key = key.split( " " )[0];
 
                 if ( key.startsWith( serviceType + "." ) )

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NFoldTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NFoldTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NFoldTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NFoldTest.java Wed Jan  6 18:26:43 2010
@@ -22,7 +22,9 @@
 
 import java.util.Arrays;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -32,11 +34,12 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class NFoldTest extends TestCase
+public class NFoldTest
 {
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold1()
     {
         int n = 64;
@@ -58,6 +61,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold2()
     {
         int n = 56;
@@ -78,6 +82,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold3()
     {
         int n = 64;
@@ -99,6 +104,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold4()
     {
         int n = 168;
@@ -122,6 +128,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold5()
     {
         int n = 192;
@@ -146,6 +153,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold6()
     {
         int n = 168;
@@ -169,6 +177,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFold7()
     {
         int n = 168;
@@ -192,6 +201,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFoldKerberos64()
     {
         int n = 64;
@@ -213,6 +223,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFoldKerberos128()
     {
         int n = 128;
@@ -235,6 +246,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFoldKerberos168()
     {
         int n = 168;
@@ -258,6 +270,7 @@
     /**
      * Tests an n-fold test vector from RFC 3961.
      */
+    @Test
     public void testNFoldKerberos256()
     {
         int n = 256;
@@ -284,6 +297,7 @@
      * that for purposes of n-folding, we do not actually complement the
      * result of the addition.
      */
+    @Test
     public void testSum()
     {
         byte[] n1 =

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java Wed Jan  6 18:26:43 2010
@@ -28,10 +28,11 @@
 import javax.crypto.SecretKey;
 import javax.crypto.spec.DESKeySpec;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test cases for random-to-key functions for DES-, DES3-, AES-, and RC4-based
@@ -40,13 +41,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class RandomKeyFactoryTest extends TestCase
+public class RandomKeyFactoryTest
 {
     /**
      * Tests that random DES keys can be generated.
      *
      * @throws Exception
      */
+    @Test
     public void testGenerateDesKey() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "DES" );
@@ -61,6 +63,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testGenerateTripleDesKey() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "DESede" );
@@ -74,6 +77,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testGenerateAes128Key() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "AES" );
@@ -88,6 +92,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testGenerateAes256Key() throws Exception
     {
         KeyGenerator keygen = KeyGenerator.getInstance( "AES" );
@@ -102,6 +107,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testGenerateArcFourKey() throws Exception
     {
         if ( !VendorHelper.isArcFourHmacSupported() )
@@ -120,6 +126,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testGenerateRc4Key() throws Exception
     {
         if ( !VendorHelper.isArcFourHmacSupported() )
@@ -138,6 +145,7 @@
      * 
      * @throws Exception
      */
+    @Test
     public void testRandomKeyFactory() throws Exception
     {
         Map<EncryptionType, EncryptionKey> map = RandomKeyFactory.getRandomKeys();
@@ -188,6 +196,7 @@
      * 
      * @throws Exception
      */
+    @Test
     public void testRandomKeyFactoryOnlyDes() throws Exception
     {
         Set<EncryptionType> encryptionTypes = new HashSet<EncryptionType>();

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java Wed Jan  6 18:26:43 2010
@@ -32,13 +32,15 @@
 
 import javax.crypto.spec.DESKeySpec;
 
-import junit.framework.TestCase;
-
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KerberosKeyFactory;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
 import org.apache.mina.core.buffer.IoBuffer;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -49,7 +51,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class KeytabTest extends TestCase
+public class KeytabTest
 {
     private static final byte[] keytab1 = new byte[]
         { ( byte ) 0x05, ( byte ) 0x02, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x3C, ( byte ) 0x00,
@@ -90,6 +92,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testReadKeytab1() throws Exception
     {
         Keytab keytab = Keytab.read( keytab1 );
@@ -116,6 +119,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testReadKeytab2() throws Exception
     {
         Keytab keytab = Keytab.read( keytab2 );
@@ -142,6 +146,7 @@
      *
      * @throws Exception
      */
+    @Test
     public void testWriteKeytab() throws Exception
     {
         List<KeytabEntry> entries = new ArrayList<KeytabEntry>();

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java Wed Jan  6 18:26:43 2010
@@ -28,8 +28,10 @@
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.store.TicketFactory;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the Ticket encoding and decoding
@@ -37,8 +39,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class TicketTest extends TestCase
+public class TicketTest
 {
+    @Test
     public void testTicket() throws Exception
     {
         TicketFactory ticketFactory = new TicketFactory();

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java Wed Jan  6 18:26:43 2010
@@ -24,9 +24,9 @@
 import java.util.Arrays;
 
 import org.apache.directory.server.kerberos.shared.messages.value.types.AuthorizationType;
+import org.junit.Test;
 
-import junit.framework.TestCase;
-
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the AuthorizationData encoding and decoding
@@ -34,8 +34,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class AuthorizationDataTest extends TestCase
+public class AuthorizationDataTest
 {
+    @Test
     public void testAuthorizationDataOneAD() throws Exception
     {
         AuthorizationData ad = new AuthorizationData();
@@ -60,6 +61,7 @@
     }
 
 
+    @Test
     public void testAuthorizationDataThreeAD() throws Exception
     {
         AuthorizationData ad = new AuthorizationData();

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java Wed Jan  6 18:26:43 2010
@@ -24,8 +24,8 @@
 import java.util.Arrays;
 
 import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumType;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -34,8 +34,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class ChecksumTest extends TestCase
+public class ChecksumTest
 {
+    @Test
     public void testEncodingChecksum() throws Exception
     {
         Checksum chk = new Checksum( ChecksumType.CRC32, new byte[]
@@ -59,6 +60,7 @@
     }
 
 
+    @Test
     public void testEncodingNullChecksum() throws Exception
     {
         Checksum chk = new Checksum( ChecksumType.CRC32, null );
@@ -83,6 +85,7 @@
     /**
      * Tests that two Checksums are equal if both their type and value are equal.
      */
+    @Test
     public void testEquality()
     {
         byte[] checksumValue =

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java Wed Jan  6 18:26:43 2010
@@ -25,9 +25,9 @@
 
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the EncryptedData encoding and decoding
@@ -35,8 +35,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class EncryptedDataTest extends TestCase
+public class EncryptedDataTest
 {
+    @Test
     public void testEncodingEncryptedData() throws Exception
     {
         EncryptedData ed = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, 1, new byte[]
@@ -61,6 +62,7 @@
     }
 
 
+    @Test
     public void testEncodingEncryptedDataNullCipher() throws Exception
     {
         EncryptedData ed = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, 1, null );
@@ -84,6 +86,7 @@
     }
 
 
+    @Test
     public void testEncodingEncryptedDataNoKvno() throws Exception
     {
         EncryptedData ed = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, new byte[]
@@ -106,6 +109,7 @@
     }
 
 
+    @Test
     public void testEncodingEncryptedDataNoKvnoNullCipher() throws Exception
     {
         EncryptedData ed = new EncryptedData( EncryptionType.AES128_CTS_HMAC_SHA1_96, null );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java Wed Jan  6 18:26:43 2010
@@ -27,9 +27,8 @@
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.io.encoder.EncryptionKeyEncoder;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the EncryptionKey encoding and decoding
@@ -37,8 +36,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class EncryptionKeyTest extends TestCase
+public class EncryptionKeyTest
 {
+    @Test
     public void testEncodingFast() throws Exception
     {
         EncryptionKey ec = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, new byte[]
@@ -61,6 +61,7 @@
     }
 
 
+    @Test
     public void testEncodingNoStructureFast() throws Exception
     {
         EncryptionKey ec = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, null );
@@ -102,6 +103,7 @@
      }
      */
 
+    @Test
     public void testEncodingSlow() throws Exception
     {
         EncryptionKey ec = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, new byte[]
@@ -122,6 +124,7 @@
     }
 
 
+    @Test
     public void testPerfSlow() throws IOException
     {
         EncryptionKey ec = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, new byte[]
@@ -141,6 +144,7 @@
     }
 
 
+    @Test
     public void testPerfFast() throws EncoderException
     {
         EncryptionKey ec = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, new byte[]

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressTest.java Wed Jan  6 18:26:43 2010
@@ -24,9 +24,8 @@
 import java.util.Arrays;
 
 import org.apache.directory.server.kerberos.shared.messages.value.types.HostAddrType;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the HostAddress encoding and decoding
@@ -34,8 +33,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class HostAddressTest extends TestCase
+public class HostAddressTest
 {
+    @Test
     public void testEncodingHostAddressIP() throws Exception
     {
         HostAddress ha = new HostAddress( HostAddrType.ADDRTYPE_INET, new byte[]
@@ -59,6 +59,7 @@
     }
 
 
+    @Test
     public void testEncodingHostAddressIPNullAddress() throws Exception
     {
         HostAddress ha = new HostAddress( HostAddrType.ADDRTYPE_INET, null );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressesTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressesTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressesTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressesTest.java Wed Jan  6 18:26:43 2010
@@ -24,9 +24,8 @@
 import java.util.Arrays;
 
 import org.apache.directory.server.kerberos.shared.messages.value.types.HostAddrType;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the HostAddresses encoding and decoding
@@ -34,8 +33,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class HostAddressesTest extends TestCase
+public class HostAddressesTest
 {
+    @Test
     public void testEncodingHostAddressesIPOneAddresses() throws Exception
     {
         HostAddress[] ha = new HostAddress[]
@@ -63,6 +63,7 @@
     }
 
 
+    @Test
     public void testEncodingHostAddressesIP3Addresses() throws Exception
     {
         HostAddress[] ha = new HostAddress[]
@@ -104,6 +105,7 @@
     }
 
 
+    @Test
     public void testEncodingHostAddressIPNullAddress() throws Exception
     {
         HostAddresses has = new HostAddresses( null );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java Wed Jan  6 18:26:43 2010
@@ -24,9 +24,8 @@
 import java.util.Arrays;
 
 import org.apache.directory.server.kerberos.shared.messages.value.types.PaDataType;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the PaData encoding and decoding
@@ -34,8 +33,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class PaDataTest extends TestCase
+public class PaDataTest
 {
+    @Test
     public void testEncodingPreAuthenticationData() throws Exception
     {
         PaData pad = new PaData( PaDataType.PA_ASF3_SALT, new byte[]
@@ -59,6 +59,7 @@
     }
 
 
+    @Test
     public void testEncodingNullPreAuthenticationData() throws Exception
     {
         PaData pad = new PaData( PaDataType.PA_ASF3_SALT, null );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java Wed Jan  6 18:26:43 2010
@@ -24,9 +24,8 @@
 
 import org.apache.directory.server.kerberos.shared.messages.value.types.PrincipalNameType;
 import org.apache.directory.shared.ldap.util.StringTools;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Test the PrincipalName encoding and decoding
@@ -34,8 +33,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class PrincipalNameTest extends TestCase
+public class PrincipalNameTest
 {
+    @Test
     public void testEncodingPrincipalNameOneName() throws Exception
     {
         PrincipalName principal = new PrincipalName( "Test@APACHE", PrincipalNameType.KRB_NT_PRINCIPAL );
@@ -59,6 +59,7 @@
     }
 
 
+    @Test
     public void testEncodingPrincipalName3names() throws Exception
     {
         PrincipalName principal = new PrincipalName( "Test1@APACHE", PrincipalNameType.KRB_NT_PRINCIPAL );
@@ -88,6 +89,7 @@
     }
 
 
+    @Test
     public void testEncodingPrincipalNameNullName() throws Exception
     {
         PrincipalName principal = new PrincipalName( null, PrincipalNameType.KRB_NT_PRINCIPAL );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingTest.java Wed Jan  6 18:26:43 2010
@@ -24,9 +24,8 @@
 import java.util.Arrays;
 
 import org.apache.directory.server.kerberos.shared.messages.value.types.TransitedEncodingType;
-
-import junit.framework.TestCase;
-
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test the TransitedEncoding encoding and decoding
@@ -34,8 +33,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 542147 $, $Date: 2007-05-28 10:14:21 +0200 (Mon, 28 May 2007) $
  */
-public class TransitedEncodingTest extends TestCase
+public class TransitedEncodingTest
 {
+    @Test
     public void testEncodingFast() throws Exception
     {
         TransitedEncoding te = new TransitedEncoding( TransitedEncodingType.DOMAIN_X500_COMPRESS, new byte[]
@@ -58,6 +58,7 @@
     }
 
 
+    @Test
     public void testEncodingNoStructureFast() throws Exception
     {
         TransitedEncoding te = new TransitedEncoding( TransitedEncodingType.DOMAIN_X500_COMPRESS, null );

Propchange: directory/apacheds/trunk/kerberos-test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jan  6 18:26:43 2010
@@ -0,0 +1,5 @@
+.classpath
+.project
+.settings
+target
+bin

Propchange: directory/apacheds/trunk/ldap-api-test/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jan  6 18:26:43 2010
@@ -1,5 +1,17 @@
 target
-.classpath
-.project
+.clover
+.wtpmodules
 .settings
+.deployables
+apache.org
+.metadata
+*.md5
+*.log
+*.iml
+*.ipr
+*.iws
+.project
+.classpath
+nbproject
+schema
 server-work

Modified: directory/apacheds/trunk/ldap-api-test/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/pom.xml?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/pom.xml (original)
+++ directory/apacheds/trunk/ldap-api-test/pom.xml Wed Jan  6 18:26:43 2010
@@ -82,25 +82,11 @@
     </dependency>  
 
     <dependency>
-      <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-schema-extras</artifactId>
-      <version>${pom.version}</version>
-      <scope>test</scope>
-    </dependency>  
-
-    <dependency>
       <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-client-api</artifactId>
       <version>${org.apache.directory.shared.version}</version>
       <scope>test</scope>
     </dependency>  
-
-    <dependency>
-      <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-bootstrap-partition</artifactId>
-      <version>${pom.version}</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>

Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Wed Jan  6 18:26:43 2010
@@ -19,17 +19,17 @@
  */
 package org.apache.directory.shared.client.api;
 
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.client.api.LdapConnection;
 import org.apache.directory.shared.ldap.client.api.exception.LdapException;
 import org.apache.directory.shared.ldap.client.api.messages.BindResponse;
@@ -43,13 +43,15 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.CLASS )
-public class LdapConnectionTest
+@RunWith ( FrameworkRunner.class )
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" ), 
+        @CreateTransport( protocol = "LDAPS" ) 
+    })
+public class LdapConnectionTest extends AbstractLdapTestUnit
 {
-    /** The server instance */
-    public static LdapServer ldapServer;
-
     
     /**
      * Test a successful bind request
@@ -93,7 +95,7 @@
         LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort() );
 
         LdapDN dn = new LdapDN( "uid=admin,ou=system" );
-        connection.bind( dn.getUpName(), "secret" );
+        connection.bind( dn.getName(), "secret" );
         
         List<String> controlList = connection.getSupportedConrols();
         assertNotNull( controlList );



Mime
View raw message