directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1483466 - in /directory/apacheds/trunk: core-avl/src/test/java/org/apache/directory/server/core/avltree/ core-integ/src/test/java/org/apache/directory/server/core/configuration/ core-integ/src/test/java/org/apache/directory/server/core/ope...
Date Thu, 16 May 2013 17:47:08 GMT
Author: elecharny
Date: Thu May 16 17:47:08 2013
New Revision: 1483466

URL: http://svn.apache.org/r1483466
Log:
o Removed useless imports
o Replace deprecated declarations by some that aren't

Modified:
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/AliasSearchIT.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/messages/ChangePasswordReply.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/codec/KerberosEncoder.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/replay/ReplayCacheImplTest.java
    directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchWithReferralsTest.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
    directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
    directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java
(original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java
Thu May 16 17:47:08 2013
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.avltree;
 
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotSame;
@@ -30,13 +30,14 @@ import static org.junit.Assert.fail;
 
 import java.util.Comparator;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * An AVL tree testcase.

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
(original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
Thu May 16 17:47:08 2013
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.avltree;
 
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -30,13 +30,14 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * An AVLTreeMap testcase.
@@ -187,7 +188,7 @@ public class AvlTreeMapTest
 
         assertTrue( node.value.getOrderedSet().getClass() == AvlTreeImpl.class );
 
-        AvlTree<Integer> dupsTree = ( ( SingletonOrOrderedSet<Integer> ) node.value
).getOrderedSet();
+        AvlTree<Integer> dupsTree = node.value.getOrderedSet();
         assertEquals( 3, dupsTree.getSize() );
     }
 

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
(original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
Thu May 16 17:47:08 2013
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.avltree;
 
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -30,13 +30,14 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * An AVL tree testcase.

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
(original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
Thu May 16 17:47:08 2013
@@ -20,17 +20,18 @@
 package org.apache.directory.server.core.avltree;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.Serializable;
+
 import org.apache.commons.lang.ArrayUtils;
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.io.Serializable;
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
 
 /**

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
Thu May 16 17:47:08 2013
@@ -20,8 +20,8 @@
 package org.apache.directory.server.core.configuration;
 
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 import java.util.UUID;
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/AliasSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/AliasSearchIT.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/AliasSearchIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/AliasSearchIT.java
Thu May 16 17:47:08 2013
@@ -20,9 +20,9 @@
 package org.apache.directory.server.core.operations.search;
 
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/messages/ChangePasswordReply.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/messages/ChangePasswordReply.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/messages/ChangePasswordReply.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/changepwd/messages/ChangePasswordReply.java
Thu May 16 17:47:08 2013
@@ -22,11 +22,10 @@ package org.apache.directory.server.kerb
 
 import java.nio.ByteBuffer;
 
+import org.apache.directory.api.asn1.EncoderException;
 import org.apache.directory.server.kerberos.changepwd.exceptions.ChangePasswdErrorType;
 import org.apache.directory.server.kerberos.changepwd.exceptions.ChangePasswordException;
 import org.apache.directory.server.kerberos.protocol.codec.KerberosDecoder;
-import org.apache.directory.api.asn1.DecoderException;
-import org.apache.directory.api.asn1.EncoderException;
 import org.apache.directory.shared.kerberos.exceptions.KerberosException;
 import org.apache.directory.shared.kerberos.messages.ApRep;
 import org.apache.directory.shared.kerberos.messages.KrbPriv;
@@ -40,16 +39,17 @@ public class ChangePasswordReply extends
     private ApRep applicationReply;
     private KrbPriv privateMessage;
 
-    private short applicationReplyLen ;
+    private short applicationReplyLen;
     private short privateMessageLen;
     private short messageLength;
 
+
     public ChangePasswordReply( ApRep applicationReply, KrbPriv privateMessage )
     {
         this( PVNO, applicationReply, privateMessage );
     }
-    
-    
+
+
     /**
      * Creates a new instance of ChangePasswordReply.
      *
@@ -93,9 +93,9 @@ public class ChangePasswordReply extends
     {
         applicationReplyLen = ( short ) applicationReply.computeLength();
         privateMessageLen = ( short ) privateMessage.computeLength();
-        
+
         messageLength = ( short ) ( HEADER_LENGTH + applicationReplyLen + privateMessageLen
);
-        
+
         return messageLength;
     }
 
@@ -106,14 +106,14 @@ public class ChangePasswordReply extends
         buf.putShort( messageLength );
         buf.putShort( getVersionNumber() );
         buf.putShort( applicationReplyLen );
-        
+
         applicationReply.encode( buf );
         privateMessage.encode( buf );
-        
+
         return buf;
     }
 
-    
+
     /**
      * Decodes a {@link ByteBuffer} into a {@link ChangePasswordReply}.
      *
@@ -128,21 +128,21 @@ public class ChangePasswordReply extends
             short messageLength = buf.getShort();
             short protocolVersion = buf.getShort();
             short encodedAppReplyLength = buf.getShort();
-            
+
             byte[] encodedAppReply = new byte[encodedAppReplyLength];
             buf.get( encodedAppReply );
-            
+
             ApRep applicationReply = KerberosDecoder.decodeApRep( encodedAppReply );
-            
+
             int privateBytesLength = messageLength - HEADER_LENGTH - encodedAppReplyLength;
             byte[] encodedPrivateMessage = new byte[privateBytesLength];
             buf.get( encodedPrivateMessage );
-            
+
             KrbPriv privateMessage = KerberosDecoder.decodeKrbPriv( encodedPrivateMessage
);
-            
+
             return new ChangePasswordReply( protocolVersion, applicationReply, privateMessage
);
         }
-        catch( KerberosException e )
+        catch ( KerberosException e )
         {
             throw new ChangePasswordException( ChangePasswdErrorType.KRB5_KPASSWD_MALFORMED,
e );
         }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/codec/KerberosEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/codec/KerberosEncoder.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/codec/KerberosEncoder.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/codec/KerberosEncoder.java
Thu May 16 17:47:08 2013
@@ -25,7 +25,6 @@ import java.nio.ByteBuffer;
 
 import org.apache.directory.api.asn1.AbstractAsn1Object;
 import org.apache.directory.api.asn1.EncoderException;
-import org.apache.directory.api.asn1.util.Asn1StringUtils;
 
 
 /**
@@ -37,16 +36,16 @@ public class KerberosEncoder
     {
         ByteBuffer response = null;
         ByteBuffer kerberosMessage = null;
-        
+
         int responseLength = asn1Obj.computeLength();
         kerberosMessage = ByteBuffer.allocate( responseLength );
-        
+
         try
         {
             asn1Obj.encode( kerberosMessage );
 
             if ( isTcp )
-            { 
+            {
                 response = ByteBuffer.allocate( responseLength + 4 );
                 response.putInt( responseLength );
                 response.put( kerberosMessage.array() );
@@ -60,9 +59,9 @@ public class KerberosEncoder
 
             return response;
         }
-        catch( EncoderException e )
+        catch ( EncoderException e )
         {
-            throw new IOException(e.getMessage());
+            throw new IOException( e.getMessage() );
         }
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/KerberosTime.java
Thu May 16 17:47:08 2013
@@ -19,12 +19,12 @@
  */
 package org.apache.directory.shared.kerberos;
 
+
 import java.text.ParseException;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.TimeZone;
 
-import org.apache.directory.api.util.DateUtils;
 import org.apache.directory.api.util.Strings;
 
 
@@ -311,8 +311,8 @@ public class KerberosTime implements Com
     {
         return kerberosTime == 0;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/replay/ReplayCacheImplTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/replay/ReplayCacheImplTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/replay/ReplayCacheImplTest.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/replay/ReplayCacheImplTest.java
Thu May 16 17:47:08 2013
@@ -24,8 +24,6 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.io.InputStream;
-import java.util.Arrays;
 import java.util.List;
 
 import javax.security.auth.kerberos.KerberosPrincipal;
@@ -71,9 +69,9 @@ public class ReplayCacheImplTest
         try
         {
             long clockSkew = 1000; // 1 sec
-    
+
             cacheManager = new CacheManager();
-    
+
             cacheManager.addCache( "kdcReplayCache" );
             Cache ehCache = cacheManager.getCache( "kdcReplayCache" );
             ehCache.getCacheConfiguration().setMaxElementsInMemory( 2 );

Modified: directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
Thu May 16 17:47:08 2013
@@ -32,8 +32,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.PoolableLdapConnectionFactory;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.ldap.LdapServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -41,10 +39,6 @@ import org.slf4j.LoggerFactory;
  */
 public class LdapApiIntegrationUtils
 {
-
-    /** The class logger. */
-    private static final Logger LOG = LoggerFactory.getLogger( LdapApiIntegrationUtils.class
);
-
     /** The Constant DEFAULT_HOST. */
     private static final String DEFAULT_HOST = "localhost";
 

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
Thu May 16 17:47:08 2013
@@ -30,7 +30,6 @@ import static org.junit.Assert.fail;
 import java.lang.reflect.Method;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.directory.api.ldap.model.exception.LdapContextNotEmptyException;
 import org.apache.directory.api.ldap.model.exception.LdapException;
@@ -94,7 +93,7 @@ public class ClientDeleteRequestTest ext
     @Before
     public void setup() throws Exception
     {
-        connection = (LdapNetworkConnection)LdapApiIntegrationUtils.getPooledAdminConnection(
getLdapServer() );
+        connection = ( LdapNetworkConnection ) LdapApiIntegrationUtils.getPooledAdminConnection(
getLdapServer() );
         session = getLdapServer().getDirectoryService().getAdminSession();
     }
 

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchWithReferralsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchWithReferralsTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchWithReferralsTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchWithReferralsTest.java
Thu May 16 17:47:08 2013
@@ -33,7 +33,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.cursor.EntryCursor;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
-import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.ldif.LdifEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifReader;
 import org.apache.directory.api.ldap.model.message.SearchScope;
@@ -113,91 +112,91 @@ import org.junit.runner.RunWith;
 })
 public class SearchWithReferralsTest extends AbstractLdapTestUnit
 {
-    private LdapNetworkConnection connection;
-    
-    
-    @Before
-    public void setupReferrals() throws Exception
-    {
-        String ldif =
-            "dn: c=europ,ou=Countries,ou=system\n" +
-                "objectClass: top\n" +
-                "objectClass: referral\n" +
-                "objectClass: extensibleObject\n" +
-                "c: europ\n" +
-                "ref: ldap://localhost:52489/c=france,ou=system\n\n" +
-    
-                "dn: c=america,ou=Countries,ou=system\n" +
-                "objectClass: top\n" +
-                "objectClass: referral\n" +
-                "objectClass: extensibleObject\n" +
-                "c: america\n" +
-                "ref: ldap://localhost:52489/c=usa,ou=system\n\n";
-    
-        LdifReader reader = new LdifReader( new StringReader( ldif ) );
-    
-        while ( reader.hasNext() )
-        {
-            LdifEntry entry = reader.next();
-            getLdapServer().getDirectoryService().getAdminSession().add(
-                new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(),
entry.getEntry() ) );
-        }
-    
-        reader.close();
-    
-        connection = ( LdapNetworkConnection ) LdapApiIntegrationUtils.getPooledAdminConnection(
getLdapServer() );
-    }
-    
-    
-    @After
-    public void shutdown() throws Exception
+private LdapNetworkConnection connection;
+
+
+@Before
+public void setupReferrals() throws Exception
+{
+    String ldif =
+        "dn: c=europ,ou=Countries,ou=system\n" +
+            "objectClass: top\n" +
+            "objectClass: referral\n" +
+            "objectClass: extensibleObject\n" +
+            "c: europ\n" +
+            "ref: ldap://localhost:52489/c=france,ou=system\n\n" +
+
+            "dn: c=america,ou=Countries,ou=system\n" +
+            "objectClass: top\n" +
+            "objectClass: referral\n" +
+            "objectClass: extensibleObject\n" +
+            "c: america\n" +
+            "ref: ldap://localhost:52489/c=usa,ou=system\n\n";
+
+    LdifReader reader = new LdifReader( new StringReader( ldif ) );
+
+    while ( reader.hasNext() )
     {
-        LdapApiIntegrationUtils.releasePooledAdminConnection( connection, getLdapServer()
);
+        LdifEntry entry = reader.next();
+        getLdapServer().getDirectoryService().getAdminSession().add(
+            new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(), entry.getEntry()
) );
     }
-    
-    
-    /**
-     * Test of an search operation with a referral
-     *
-     * search for "cn=alex karasulu" on "c=america, ou=system"
-     * we should get a referral URL thrown, which point to
-     * "c=usa, ou=system", and ask for a subtree search
-     */
-    @Test
-    public void testSearchWithReferralThrow() throws Exception
+
+    reader.close();
+
+    connection = ( LdapNetworkConnection ) LdapApiIntegrationUtils.getPooledAdminConnection(
getLdapServer() );
+}
+
+
+@After
+public void shutdown() throws Exception
+{
+    LdapApiIntegrationUtils.releasePooledAdminConnection( connection, getLdapServer() );
+}
+
+
+/**
+ * Test of an search operation with a referral
+ *
+ * search for "cn=alex karasulu" on "c=america, ou=system"
+ * we should get a referral URL thrown, which point to
+ * "c=usa, ou=system", and ask for a subtree search
+ */
+@Test
+public void testSearchWithReferralThrow() throws Exception
+{
+    EntryCursor cursor = connection.search( "ou=Countries,ou=system", "(objectClass=*)",
+        SearchScope.SUBTREE, "*", "+" );
+    int count = 0;
+    Entry entry = null;
+    List<String> refs = new ArrayList<String>();
+
+    while ( cursor.next() )
     {
-        EntryCursor cursor = connection.search( "ou=Countries,ou=system", "(objectClass=*)",
-            SearchScope.SUBTREE, "*", "+" );
-        int count = 0;
-        Entry entry = null;
-        List<String> refs = new ArrayList<String>();
-    
-        while ( cursor.next() )
+        try
         {
-            try
-            {
-                entry = cursor.get();
-    
-                assertNotNull( entry );
-                count++;
-            }
-            catch ( CursorLdapReferralException clre )
+            entry = cursor.get();
+
+            assertNotNull( entry );
+            count++;
+        }
+        catch ( CursorLdapReferralException clre )
+        {
+            count++;
+
+            do
             {
-                count++;
-    
-                do
-                {
-                    String ref = clre.getReferralInfo();
-                    refs.add( ref );
-                }
-                while ( clre.skipReferral() );
+                String ref = clre.getReferralInfo();
+                refs.add( ref );
             }
+            while ( clre.skipReferral() );
         }
-    
-        assertEquals( 3, count );
-        assertEquals( 2, refs.size() );
-        assertTrue( refs.contains( "ldap://localhost:52489/c=usa,ou=system??sub" ) );
-        assertTrue( refs.contains( "ldap://localhost:52489/c=france,ou=system??sub" ) );
-        cursor.close();
     }
+
+    assertEquals( 3, count );
+    assertEquals( 2, refs.size() );
+    assertTrue( refs.contains( "ldap://localhost:52489/c=usa,ou=system??sub" ) );
+    assertTrue( refs.contains( "ldap://localhost:52489/c=france,ou=system??sub" ) );
+    cursor.close();
+}
 }

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
Thu May 16 17:47:08 2013
@@ -33,7 +33,6 @@ import org.apache.directory.api.asn1.Enc
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.KerberosConfig;
 import org.apache.directory.server.kerberos.kdc.KdcContext;
-import org.apache.directory.server.kerberos.kdc.KdcServer;
 import org.apache.directory.server.kerberos.protocol.codec.KerberosDecoder;
 import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumHandler;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.CipherTextHandler;
@@ -43,10 +42,8 @@ import org.apache.directory.server.kerbe
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry;
 import org.apache.directory.shared.kerberos.KerberosConstants;
-import org.apache.directory.shared.kerberos.KerberosMessageType;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.KerberosUtils;
-import org.apache.directory.shared.kerberos.codec.options.ApOptions;
 import org.apache.directory.shared.kerberos.codec.options.KdcOptions;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.codec.types.LastReqType;
@@ -165,7 +162,7 @@ public class TicketGrantingService
 
     private static void selectEncryptionType( TicketGrantingContext tgsContext ) throws Exception
     {
-        KdcContext kdcContext = (KdcContext)tgsContext;
+        KdcContext kdcContext = tgsContext;
         KerberosConfig config = kdcContext.getConfig();
 
         Set<EncryptionType> requestedTypes = kdcContext.getRequest().getKdcReqBody().getEType();
@@ -260,7 +257,7 @@ public class TicketGrantingService
     {
         ApReq authHeader = tgsContext.getAuthHeader();
         Ticket tgt = tgsContext.getTgt();
-        
+
         KdcOptions kdcOptions = tgsContext.getRequest().getKdcReqBody().getKdcOptions();
         boolean isValidate = kdcOptions.get( KdcOptions.VALIDATE );
 
@@ -273,8 +270,10 @@ public class TicketGrantingService
         InetAddress clientAddress = tgsContext.getClientAddress();
         CipherTextHandler cipherTextHandler = tgsContext.getCipherTextHandler();
 
-        Authenticator authenticator = KerberosUtils.verifyAuthHeader( authHeader, tgt, serverKey,
clockSkew, replayCache,
-            emptyAddressesAllowed, clientAddress, cipherTextHandler, KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY,
isValidate );
+        Authenticator authenticator = KerberosUtils.verifyAuthHeader( authHeader, tgt, serverKey,
clockSkew,
+            replayCache,
+            emptyAddressesAllowed, clientAddress, cipherTextHandler,
+            KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY, isValidate );
 
         tgsContext.setAuthenticator( authenticator );
     }
@@ -314,15 +313,15 @@ public class TicketGrantingService
                 Ticket tgt = tgsContext.getTgt();
                 EncTicketPart encTicketPart = tgt.getEncTicketPart();
                 EncryptionKey sessionKey = encTicketPart.getKey();
-                
+
                 if ( authenticatorChecksum == null || authenticatorChecksum.getChecksumType()
== null
                     || authenticatorChecksum.getChecksumValue() == null || bodyBytes == null
)
                 {
                     throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
                 }
-                
+
                 LOG.debug( "Verifying body checksum type '{}'.", authenticatorChecksum.getChecksumType()
);
-                
+
                 checksumHandler.verifyChecksum( authenticatorChecksum, bodyBytes, sessionKey.getKeyValue(),
                     KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_AUTHNT_CKSUM_TGS_SESS_KEY );
             }
@@ -357,7 +356,7 @@ public class TicketGrantingService
         KerberosConfig config = tgsContext.getConfig();
 
         tgsContext.getRequest().getKdcReqBody().getAdditionalTickets();
-        
+
         EncTicketPart newTicketPart = new EncTicketPart();
 
         newTicketPart.setClientAddresses( tgt.getEncTicketPart().getClientAddresses() );
@@ -387,18 +386,18 @@ public class TicketGrantingService
         {
             Ticket[] additionalTkts = tgsContext.getRequest().getKdcReqBody().getAdditionalTickets();
 
-            if( additionalTkts == null || additionalTkts.length == 0 )
+            if ( additionalTkts == null || additionalTkts.length == 0 )
             {
                 throw new KerberosException( ErrorType.KDC_ERR_BADOPTION );
             }
-            
+
             Ticket additionalTgt = additionalTkts[0];
             // reject if it is not a TGT
-            if( !additionalTgt.getEncTicketPart().getFlags().isInitial() )
+            if ( !additionalTgt.getEncTicketPart().getFlags().isInitial() )
             {
                 throw new KerberosException( ErrorType.KDC_ERR_POLICY );
             }
-            
+
             serverKey = additionalTgt.getEncTicketPart().getKey();
             /*
              * if (server not specified) then
@@ -414,13 +413,14 @@ public class TicketGrantingService
              */
             //throw new KerberosException( ErrorType.KDC_ERR_BADOPTION );
         }
-        
-        EncryptedData encryptedData = cipherTextHandler.seal( serverKey, newTicketPart, KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY
);
-        
+
+        EncryptedData encryptedData = cipherTextHandler.seal( serverKey, newTicketPart,
+            KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY );
+
         Ticket newTicket = new Ticket( request.getKdcReqBody().getSName(), encryptedData
);
         newTicket.setEncTicketPart( newTicketPart );
         newTicket.setRealm( request.getKdcReqBody().getRealm() );
-        
+
         tgsContext.setNewTicket( newTicket );
     }
 
@@ -497,15 +497,15 @@ public class TicketGrantingService
         {
             Ticket tgt = tgsContext.getTgt();
             long clockSkew = tgsContext.getConfig().getAllowableClockSkew();
-            
+
             Checksum cksum = tgsContext.getAuthenticator().getCksum();
-            
+
             ChecksumType checksumType = null;
             if ( cksum != null )
             {
                 checksumType = cksum.getChecksumType();
             }
-            
+
             InetAddress clientAddress = tgsContext.getClientAddress();
             HostAddresses clientAddresses = tgt.getEncTicketPart().getClientAddresses();
 
@@ -588,7 +588,7 @@ public class TicketGrantingService
         }
     }
 
-    
+
     private static void processFlags( KerberosConfig config, KdcReq request, Ticket tgt,
         EncTicketPart newTicketPart ) throws KerberosException
     {

Modified: directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
Thu May 16 17:47:08 2013
@@ -24,7 +24,7 @@ import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.nio.ByteBuffer;
 import java.security.SecureRandom;
-import java.util.List;
+
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
@@ -77,7 +77,8 @@ public abstract class AbstractAuthentica
 
         EncryptionKey clientKey = getEncryptionKey( clientPrincipal, passPhrase );
 
-        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
+        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp,
+            KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
 
         ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
         byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();

Modified: directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
Thu May 16 17:47:08 2013
@@ -33,7 +33,6 @@ import org.apache.directory.server.kerbe
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.options.KdcOptions;
-import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.codec.types.PaDataType;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
@@ -72,7 +71,7 @@ public class PreAuthenticationTest exten
     {
         kdcServer = new KdcServer();
         config = kdcServer.getConfig();
-        store  = new MapPrincipalStoreImpl();
+        store = new MapPrincipalStoreImpl();
         handler = new KerberosProtocolHandler( kdcServer, store );
         session = new KrbDummySession();
         lockBox = new CipherTextHandler();
@@ -260,7 +259,8 @@ public class PreAuthenticationTest exten
         assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
         KrbError error = ( KrbError ) msg;
 
-        assertEquals( "ignores unknown pre-auth type and expects PA_ENC_TMSTMP pre-auth",
ErrorType.KDC_ERR_PREAUTH_REQUIRED, error.getErrorCode() );
+        assertEquals( "ignores unknown pre-auth type and expects PA_ENC_TMSTMP pre-auth",
+            ErrorType.KDC_ERR_PREAUTH_REQUIRED, error.getErrorCode() );
     }
 
 
@@ -305,7 +305,8 @@ public class PreAuthenticationTest exten
 
         EncryptionKey clientKey = getEncryptionKey( clientPrincipal, passPhrase );
 
-        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
+        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp,
+            KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
 
         ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
         byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java?rev=1483466&r1=1483465&r2=1483466&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
Thu May 16 17:47:08 2013
@@ -20,9 +20,9 @@
 package org.apache.directory.server.ssl;
 
 
-import static junit.framework.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;



Mime
View raw message