directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235326 [15/28] - in /directory/apacheds/trunk: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partitio...
Date Tue, 24 Jan 2012 16:15:29 GMT
Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java Tue Jan 24 16:15:05 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.kerberos.shared.messages.components;
 
+
 import static org.junit.Assert.assertEquals;
 
 import javax.security.auth.kerberos.KerberosPrincipal;
@@ -33,6 +34,7 @@ import org.junit.runner.RunWith;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
+
 /**
  * Test the Ticket encoding and decoding
  * 
@@ -57,37 +59,37 @@ public class TicketTest
         Ticket serviceTicket = ticketFactory.getTicket( clientPrincipal, serverPrincipal, serverKey );
 
         byte[] encodedTicket = serviceTicket.encode( null ).array();
-        
+
         byte[] expectedResult = new byte[]
             {
-              0x61, (byte)0x81, (byte)0xFA,
-                0x30, (byte)0x81, (byte)0xF7, 
-                  (byte)0xA0, 0x03,
-                    0x02, 0x01, 0x05,
-                  (byte)0xA1, 0x0D,
-                    0x1B, 0x0B, 
-                      'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M',
-                  (byte)0xA2, 0x28,
-                    0x30, 0x26,
-                      (byte)0xA0, 0x03, 
-                        0x02, 0x01, 0x01, 
-                      (byte)0xA1, 0x1F, 
-                        0x30, 0x1D, 
-                          0x1B, 0x1B, 
-                            'k', 'a', 'd', 'm', 'i', 'n', '/',
-                            'c', 'h', 'a', 'n', 'g', 'e', 'p', 'w', '@', 'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M',
-                  (byte)0xA3, (byte)0x81, (byte)0xB6, 
-                    0x30, (byte)0x81, (byte)0xB3,
-                      (byte)0xA0, 0x03,
-                        0x02, 0x01, 0x03,
-                      (byte)0xA2, (byte)0x81, (byte)0xAB,
-                        0x04, (byte)0x81, (byte)0xA8
-            };
+                0x61, ( byte ) 0x81, ( byte ) 0xFA,
+                0x30, ( byte ) 0x81, ( byte ) 0xF7,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x05,
+                ( byte ) 0xA1, 0x0D,
+                0x1B, 0x0B,
+                'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M',
+                ( byte ) 0xA2, 0x28,
+                0x30, 0x26,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x1F,
+                0x30, 0x1D,
+                0x1B, 0x1B,
+                'k', 'a', 'd', 'm', 'i', 'n', '/',
+                'c', 'h', 'a', 'n', 'g', 'e', 'p', 'w', '@', 'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M',
+                ( byte ) 0xA3, ( byte ) 0x81, ( byte ) 0xB6,
+                0x30, ( byte ) 0x81, ( byte ) 0xB3,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x03,
+                ( byte ) 0xA2, ( byte ) 0x81, ( byte ) 0xAB,
+                0x04, ( byte ) 0x81, ( byte ) 0xA8
+        };
 
         // We will just compared the first bytes (everything before the encrypted data)
-        String expectedResultString = Strings.dumpBytes(expectedResult);
-        String resultString = Strings.dumpBytes(encodedTicket).substring( 0,  expectedResultString.length() );
-        
+        String expectedResultString = Strings.dumpBytes( expectedResult );
+        String resultString = Strings.dumpBytes( encodedTicket ).substring( 0, expectedResultString.length() );
+
         assertEquals( expectedResultString, resultString );
     }
 

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java Tue Jan 24 16:15:05 2012
@@ -33,6 +33,7 @@ import org.apache.directory.shared.kerbe
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the AuthorizationData encoding and decoding
  * 
@@ -54,14 +55,14 @@ public class AuthorizationDataTest
         ad.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0F, 
-                0x30, 0x0d, 
-                  ( byte ) 0xA0, 0x03, 
-                    0x02, 0x01, 0x04, 
-                  ( byte ) 0xA1, 0x06, 
-                    0x04, 0x04, 0x01, 0x02, 0x03, 0x04 
-            };
+            {
+                0x30, 0x0F,
+                0x30, 0x0d,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x04,
+                ( byte ) 0xA1, 0x06,
+                0x04, 0x04, 0x01, 0x02, 0x03, 0x04
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -83,27 +84,27 @@ public class AuthorizationDataTest
         ad.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x2D, 
-                0x30, 0x0d, 
-                  ( byte ) 0xA0, 0x03, 
-                    0x02, 0x01, 0x04, 
-                  ( byte ) 0xA1, 0x06, 
-                    0x04, 0x04, 
-                      0x01, 0x02, 0x03, 0x04, 
-                0x30, 0x0d, 
-                  ( byte ) 0xA0, 0x03, 
-                    0x02, 0x01, 0x01, 
-                  ( byte ) 0xA1, 0x06, 
-                    0x04, 0x04,
-                      0x05, 0x06, 0x07, 0x08, 
-                0x30, 0x0d, 
-                  ( byte ) 0xA0, 0x03, 
-                    0x02, 0x01, 0x06, 
-                  ( byte ) 0xA1, 0x06, 
-                    0x04, 0x04, 
-                      0x09, 0x0A, 0x0B, 0x0C 
-            };
+            {
+                0x30, 0x2D,
+                0x30, 0x0d,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x04,
+                ( byte ) 0xA1, 0x06,
+                0x04, 0x04,
+                0x01, 0x02, 0x03, 0x04,
+                0x30, 0x0d,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x06,
+                0x04, 0x04,
+                0x05, 0x06, 0x07, 0x08,
+                0x30, 0x0d,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x06,
+                ( byte ) 0xA1, 0x06,
+                0x04, 0x04,
+                0x09, 0x0A, 0x0B, 0x0C
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java Tue Jan 24 16:15:05 2012
@@ -51,27 +51,32 @@ public class ChecksumTest
     private static Checksum checksumC;
     private static Checksum checksumD;
 
-    private static final byte[] CHECKSUM_VALUE_A = { ( byte ) 0x30, ( byte ) 0x1A, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18, ( byte ) 0x0F, ( byte ) 0x32,
-        ( byte ) 0x30 };
-    private static final byte[] CHECKSUM_VALUE_B = { ( byte ) 0x30, ( byte ) 0x1A, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18, ( byte ) 0x0F, ( byte ) 0x32,
-        ( byte ) 0x30 };
-    private static final byte[] CHECKSUM_VALUE_C = { ( byte ) 0x30, ( byte ) 0x1B, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18, ( byte ) 0x0F, ( byte ) 0x32,
-        ( byte ) 0x30 };
-    
+    private static final byte[] CHECKSUM_VALUE_A =
+        { ( byte ) 0x30, ( byte ) 0x1A, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18, ( byte ) 0x0F, ( byte ) 0x32,
+            ( byte ) 0x30 };
+    private static final byte[] CHECKSUM_VALUE_B =
+        { ( byte ) 0x30, ( byte ) 0x1A, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18, ( byte ) 0x0F, ( byte ) 0x32,
+            ( byte ) 0x30 };
+    private static final byte[] CHECKSUM_VALUE_C =
+        { ( byte ) 0x30, ( byte ) 0x1B, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18, ( byte ) 0x0F, ( byte ) 0x32,
+            ( byte ) 0x30 };
+
+
     /**
      * Initialize name instances
      */
     @BeforeClass
     public static void initNames() throws Exception
     {
-        checksumA = new Checksum ( ChecksumType.RSA_MD5, CHECKSUM_VALUE_A );
-        checksumACopy = new Checksum ( ChecksumType.RSA_MD5, CHECKSUM_VALUE_A );
-        checksumB = new Checksum ( ChecksumType.RSA_MD5, CHECKSUM_VALUE_B );
-        checksumC = new Checksum ( ChecksumType.RSA_MD5, CHECKSUM_VALUE_C );
-        checksumD = new Checksum ( ChecksumType.RSA_MD4, CHECKSUM_VALUE_A );
+        checksumA = new Checksum( ChecksumType.RSA_MD5, CHECKSUM_VALUE_A );
+        checksumACopy = new Checksum( ChecksumType.RSA_MD5, CHECKSUM_VALUE_A );
+        checksumB = new Checksum( ChecksumType.RSA_MD5, CHECKSUM_VALUE_B );
+        checksumC = new Checksum( ChecksumType.RSA_MD5, CHECKSUM_VALUE_C );
+        checksumD = new Checksum( ChecksumType.RSA_MD4, CHECKSUM_VALUE_A );
 
     }
-    
+
+
     @Test
     public void testEncodingChecksum() throws Exception
     {
@@ -83,14 +88,14 @@ public class ChecksumTest
         chk.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-            0x30, 0x0c, 
-              (byte)0xA0, 0x03, 
-                0x02, 0x01, 0x01, 
-              (byte)0xA1, 0x05, 
-                0x04, 0x03, 
-                  0x01, 0x02, 0x03 
-            };
+            {
+                0x30, 0x0c,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x05,
+                0x04, 0x03,
+                0x01, 0x02, 0x03
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -106,13 +111,13 @@ public class ChecksumTest
         chk.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-                0x30, 0x09, 
-                  ( byte ) 0xA0, 
-                    0x03, 0x02, 0x01, 0x01, 
-                  ( byte ) 0xA1, 0x02, 
-                    0x04, 0x00 
-            };
+            {
+                0x30, 0x09,
+                ( byte ) 0xA0,
+                0x03, 0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x02,
+                0x04, 0x00
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java Tue Jan 24 16:15:05 2012
@@ -34,6 +34,7 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the EncryptedData encoding and decoding
  * 
@@ -54,17 +55,17 @@ public class EncryptedDataTest
         ed.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-                0x30, 0x12, 
-                  ( byte ) 0xA0, 0x03, 
-                    0x02, 0x01, 0x11, 
-                  ( byte ) 0xA1, 0x03, 
-                    0x02, 0x01, 0x01, 
-                  ( byte ) 0xA2, 0x06, 
-                    0x04, 0x04, 0x01, 0x02, 0x03, 0x04 
-            };
+            {
+                0x30, 0x12,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA1, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA2, 0x06,
+                0x04, 0x04, 0x01, 0x02, 0x03, 0x04
+        };
 
-        assertEquals( Strings.dumpBytes(expectedResult), Strings.dumpBytes(encoded.array()) );
+        assertEquals( Strings.dumpBytes( expectedResult ), Strings.dumpBytes( encoded.array() ) );
     }
 
 
@@ -78,15 +79,15 @@ public class EncryptedDataTest
         ed.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0E, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x11, 
-                ( byte ) 0xA1, 0x03, 
-                  0x02, 0x01, 0x01, 
-                ( byte ) 0xA2, 0x02, 
-                  0x04, 0x00 
-            };
+            {
+                0x30, 0x0E,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA1, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA2, 0x02,
+                0x04, 0x00
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -103,13 +104,13 @@ public class EncryptedDataTest
         ed.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0D, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x11, 
-                ( byte ) 0xA2, 0x06, 
-                  0x04, 0x04, 0x01, 0x02, 0x03, 0x04 
-            };
+            {
+                0x30, 0x0D,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA2, 0x06,
+                0x04, 0x04, 0x01, 0x02, 0x03, 0x04
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -125,13 +126,13 @@ public class EncryptedDataTest
         ed.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x09, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x11, 
-                ( byte ) 0xA2, 0x02, 
-                  0x04, 0x00 
-            };
+            {
+                0x30, 0x09,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA2, 0x02,
+                0x04, 0x00
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java Tue Jan 24 16:15:05 2012
@@ -36,6 +36,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the EncryptionKey encoding and decoding
  * 
@@ -51,26 +52,29 @@ public class EncryptionKeyTest
     private static EncryptionKey encryptionC;
     private static EncryptionKey encryptionD;
 
-    private static final byte[] ENCRYPTION_VALUE_A = { 0x01, 0x02, 0x03 };
-    private static final byte[] ENCRYPTION_VALUE_B = { 0x01, 0x02, 0x03 };
-    private static final byte[] ENCRYPTION_VALUE_C = { 0x01, 0x02, 0x04 };
+    private static final byte[] ENCRYPTION_VALUE_A =
+        { 0x01, 0x02, 0x03 };
+    private static final byte[] ENCRYPTION_VALUE_B =
+        { 0x01, 0x02, 0x03 };
+    private static final byte[] ENCRYPTION_VALUE_C =
+        { 0x01, 0x02, 0x04 };
+
 
-    
     /**
      * Initialize name instances
      */
     @BeforeClass
     public static void initNames() throws Exception
     {
-        encryptionA = new EncryptionKey ( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_A );
-        encryptionACopy = new EncryptionKey ( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_A );
-        encryptionB = new EncryptionKey ( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_B );
-        encryptionC = new EncryptionKey ( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_C );
-        encryptionD = new EncryptionKey ( EncryptionType.AES256_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_A );
+        encryptionA = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_A );
+        encryptionACopy = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_A );
+        encryptionB = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_B );
+        encryptionC = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_C );
+        encryptionD = new EncryptionKey( EncryptionType.AES256_CTS_HMAC_SHA1_96, ENCRYPTION_VALUE_A );
 
     }
 
-    
+
     @Test
     public void testEncodingFast() throws Exception
     {
@@ -82,13 +86,13 @@ public class EncryptionKeyTest
         ec.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0c, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x11, 
-                ( byte ) 0xA1, 0x05, 
-                  0x04, 0x03, 0x01, 0x02, 0x03 
-            };
+            {
+                0x30, 0x0c,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA1, 0x05,
+                0x04, 0x03, 0x01, 0x02, 0x03
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -104,13 +108,13 @@ public class EncryptionKeyTest
         ec.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x09, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x11, 
-                ( byte ) 0xA1, 0x02, 
-                  0x04, 0x00 
-            };
+            {
+                0x30, 0x09,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA1, 0x02,
+                0x04, 0x00
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -147,13 +151,13 @@ public class EncryptionKeyTest
         ec.encode( buffer );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0c, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x11, 
-                ( byte ) 0xA1, 0x05, 
-                  0x04, 0x03, 0x01, 0x02, 0x03 
-            };
+            {
+                0x30, 0x0c,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x11,
+                ( byte ) 0xA1, 0x05,
+                0x04, 0x03, 0x01, 0x02, 0x03
+        };
 
         assertTrue( Arrays.equals( expectedResult, buffer.array() ) );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java Tue Jan 24 16:15:05 2012
@@ -30,6 +30,7 @@ import org.apache.directory.shared.kerbe
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java Tue Jan 24 16:15:05 2012
@@ -32,6 +32,7 @@ import org.apache.directory.shared.kerbe
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the PaData encoding and decoding
  * 
@@ -52,14 +53,14 @@ public class PaDataTest
         pad.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-            0x30, 0x0c, 
-              ( byte ) 0xA1, 0x03, 
-                0x02, 0x01, 0x0A, 
-              ( byte ) 0xA2, 0x05, 
-                0x04, 0x03, 
-                  0x01, 0x02, 0x03 
-            };
+            {
+                0x30, 0x0c,
+                ( byte ) 0xA1, 0x03,
+                0x02, 0x01, 0x0A,
+                ( byte ) 0xA2, 0x05,
+                0x04, 0x03,
+                0x01, 0x02, 0x03
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
@@ -75,13 +76,13 @@ public class PaDataTest
         pad.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-                0x30, 0x09, 
-                  ( byte ) 0xA1, 0x03, 
-                    0x02, 0x01, 0x0A, 
-                  ( byte ) 0xA2, 0x02, 
-                    0x04, 0x00 
-            };
+            {
+                0x30, 0x09,
+                ( byte ) 0xA1, 0x03,
+                0x02, 0x01, 0x0A,
+                ( byte ) 0xA2, 0x02,
+                0x04, 0x00
+        };
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java Tue Jan 24 16:15:05 2012
@@ -32,6 +32,7 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Test the PrincipalName encoding and decoding
  * 
@@ -51,17 +52,17 @@ public class PrincipalNameTest
         principal.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0F, 
-                (byte) 0xA0, 0x03, 
-                  0x02, 0x01, 0x01, 
-                (byte) 0xA1, 0x08, 
-                  0x30, 0x06, 
-                    0x1B, 0x04, 
-                      'T', 'e', 's', 't' 
-            };
+            {
+                0x30, 0x0F,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x08,
+                0x30, 0x06,
+                0x1B, 0x04,
+                'T', 'e', 's', 't'
+        };
 
-        assertEquals( Strings.dumpBytes(expectedResult), Strings.dumpBytes(encoded.array()) );
+        assertEquals( Strings.dumpBytes( expectedResult ), Strings.dumpBytes( encoded.array() ) );
     }
 
 
@@ -77,21 +78,21 @@ public class PrincipalNameTest
         principal.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x1e, 
-                (byte) 0xA0, 0x03, 
-                  0x02, 0x01, 0x01, 
-                (byte) 0xA1, 0x17, 
-                  0x30, 0x15, 
-                    0x1B, 0x05, 
-                      'T', 'e', 's', 't', '1', 
-                    0x1B, 0x05, 
-                      'T', 'e', 's', 't', '2', 
-                    0x1B, 0x05, 
-                      'T', 'e', 's', 't', '3' 
-            };
+            {
+                0x30, 0x1e,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x17,
+                0x30, 0x15,
+                0x1B, 0x05,
+                'T', 'e', 's', 't', '1',
+                0x1B, 0x05,
+                'T', 'e', 's', 't', '2',
+                0x1B, 0x05,
+                'T', 'e', 's', 't', '3'
+        };
 
-        assertEquals( Strings.dumpBytes(expectedResult), Strings.dumpBytes(encoded.array()) );
+        assertEquals( Strings.dumpBytes( expectedResult ), Strings.dumpBytes( encoded.array() ) );
     }
 
 
@@ -105,15 +106,15 @@ public class PrincipalNameTest
         principal.encode( encoded );
 
         byte[] expectedResult = new byte[]
-            { 
-              0x30, 0x0B, 
-                ( byte ) 0xA0, 0x03, 
-                  0x02, 0x01, 0x01, 
-                ( byte ) 0xA1, 0x04, 
-                  0x30, 0x02,
-                    0x1B, 0x00
-            };
+            {
+                0x30, 0x0B,
+                ( byte ) 0xA0, 0x03,
+                0x02, 0x01, 0x01,
+                ( byte ) 0xA1, 0x04,
+                0x30, 0x02,
+                0x1B, 0x00
+        };
 
-        assertEquals( Strings.dumpBytes(expectedResult), Strings.dumpBytes(encoded.array()) );
+        assertEquals( Strings.dumpBytes( expectedResult ), Strings.dumpBytes( encoded.array() ) );
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlagsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlagsTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlagsTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/AbstractKerberosFlagsTest.java Tue Jan 24 16:15:05 2012
@@ -47,9 +47,9 @@ public class AbstractKerberosFlagsTest
         // Flags 1, 2, 4, 8 set
         AbstractKerberosFlags akf = new AbstractKerberosFlags(
             ( 1 << ( 31 - TicketFlag.FORWARDABLE.getValue() ) )
-                  + ( 1 << ( 31 - TicketFlag.FORWARDED.getValue() ) )
-                  + ( 1 << ( 31 - TicketFlag.PROXY.getValue() ) )
-                  + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) )
+                + ( 1 << ( 31 - TicketFlag.FORWARDED.getValue() ) )
+                + ( 1 << ( 31 - TicketFlag.PROXY.getValue() ) )
+                + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) )
         {
             private static final long serialVersionUID = 1L;
         };
@@ -59,7 +59,7 @@ public class AbstractKerberosFlagsTest
         assertEquals(
             "clear(KerberosFlag)",
             (
-                  ( 1 << ( 31 - TicketFlag.FORWARDABLE.getValue() ) )
+            ( 1 << ( 31 - TicketFlag.FORWARDABLE.getValue() ) )
                 + ( 1 << ( 31 - TicketFlag.FORWARDED.getValue() ) )
                 + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) ),
             akf.getIntValue() );
@@ -69,7 +69,7 @@ public class AbstractKerberosFlagsTest
         assertEquals(
             "clear(int)",
             ( ( 1 << ( 31 - TicketFlag.FORWARDABLE.getValue() ) )
-                + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) ), akf.getIntValue() );
+            + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) ), akf.getIntValue() );
     }
 
 
@@ -79,9 +79,9 @@ public class AbstractKerberosFlagsTest
         // Flags 1, 2, 4, 8 set
         AbstractKerberosFlags akfIntConstructor = new AbstractKerberosFlags(
             ( ( 1 << ( 31 - TicketFlag.FORWARDABLE.getValue() ) )
-            + ( 1 << ( 31 - TicketFlag.FORWARDED.getValue() ) )
-            + ( 1 << ( 31 - TicketFlag.PROXY.getValue() ) )
-            + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) ) )
+                + ( 1 << ( 31 - TicketFlag.FORWARDED.getValue() ) )
+                + ( 1 << ( 31 - TicketFlag.PROXY.getValue() ) )
+                + ( 1 << ( 31 - TicketFlag.RENEWABLE.getValue() ) ) ) )
         {
             private static final long serialVersionUID = 1L;
         };

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java Tue Jan 24 16:15:05 2012
@@ -74,7 +74,8 @@ public class TicketFlagsTest
     public void testGivenIntConstructor() throws Exception
     {
         // Flags 1, 2, 4, 8 set
-        TicketFlags tf = new TicketFlags( ( int ) ( Math.pow( 2, 31 - 1 ) + Math.pow( 2, 31 - 2 ) + Math.pow( 2, 31 - 4 ) + Math.pow(
+        TicketFlags tf = new TicketFlags( ( int ) ( Math.pow( 2, 31 - 1 ) + Math.pow( 2, 31 - 2 )
+            + Math.pow( 2, 31 - 4 ) + Math.pow(
             2, 31 - 8 ) ) );
         assertFalse( tf.isReserved() ); // 0
         assertTrue( tf.isForwardable() ); // 1
@@ -98,10 +99,10 @@ public class TicketFlagsTest
     {
         // Flags 1, 2, 4, 8 set
         TicketFlags tf = new TicketFlags(
-            getBytes( ( int ) ( ( 1 << ( 31 - 1 ) ) | 
-                                ( 1 << ( 31 - 2 ) ) | 
-                                ( 1 << ( 31 - 4 ) ) |
-                                ( 1 << 31 - 8 ) ) ) );
+            getBytes( ( int ) ( ( 1 << ( 31 - 1 ) ) |
+                ( 1 << ( 31 - 2 ) ) |
+                ( 1 << ( 31 - 4 ) ) |
+            ( 1 << 31 - 8 ) ) ) );
         assertFalse( tf.isReserved() ); // 0
         assertTrue( tf.isForwardable() ); // 1
         assertTrue( tf.isForwarded() ); // 2
@@ -124,7 +125,7 @@ public class TicketFlagsTest
     public void testSetFlag() throws Exception
     {
         TicketFlags tf = new TicketFlags();
-        
+
         for ( TicketFlag t : TicketFlag.values() )
         {
             if ( !t.equals( TicketFlag.MAX_VALUE ) )
@@ -132,7 +133,7 @@ public class TicketFlagsTest
                 tf.setFlag( t );
             }
         }
-        
+
         assertTrue( tf.isReserved() ); // 0
         assertTrue( tf.isForwardable() ); // 1
         assertTrue( tf.isForwarded() ); // 2
@@ -201,9 +202,9 @@ public class TicketFlagsTest
     private byte[] getBytes( int flags )
     {
         return new byte[]
-            {   0x00,
-                ( byte ) ( flags >>> 24 ), 
-                ( byte ) ( ( flags >> 16 ) & 0x00ff ), 
+            { 0x00,
+                ( byte ) ( flags >>> 24 ),
+                ( byte ) ( ( flags >> 16 ) & 0x00ff ),
                 ( byte ) ( ( flags >> 8 ) & 0x00ff ),
                 ( byte ) ( flags & 0x00ff ) };
     }

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=1235326&r1=1235325&r2=1235326&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 Tue Jan 24 16:15:05 2012
@@ -65,24 +65,24 @@ public class ReplayCacheImplTest
     public void testCacheSetting() throws Exception
     {
         CacheManager cacheManager = null;
-        
+
         try
         {
             long clockSkew = 1000; // 1 sec
-    
+
             cacheManager = new CacheManager( ReplayCacheImplTest.class.getClassLoader().getResource(
                 "directory-cacheservice.xml" ) );
-    
+
             Cache ehCache = cacheManager.getCache( "kdcReplayCache" );
             ehCache.getCacheConfiguration().setMaxElementsInMemory( 2 );
             ehCache.getCacheConfiguration().setTimeToLiveSeconds( 1 );
             ehCache.getCacheConfiguration().setTimeToIdleSeconds( 1 );
             ehCache.getCacheConfiguration().setDiskExpiryThreadIntervalSeconds( 1 );
-    
+
             ReplayCacheImpl cache = new ReplayCacheImpl( ehCache, clockSkew );
-    
+
             int i = 0;
-    
+
             // Inject 4 entries
             while ( i < 4 )
             {
@@ -90,26 +90,26 @@ public class ReplayCacheImplTest
                     PrincipalNameType.KRB_NT_PRINCIPAL.getValue() );
                 KerberosPrincipal clientPrincipal = new KerberosPrincipal( "client" + i + "@APACHE.ORG",
                     PrincipalNameType.KRB_NT_PRINCIPAL.getValue() );
-    
+
                 cache.save( serverPrincipal, clientPrincipal, new KerberosTime( System.currentTimeMillis() ), 0 );
-    
+
                 i++;
             }
-    
+
             List<?> keys = ehCache.getKeys();
-    
+
             // We should have 4 entries
             assertTrue( keys.size() != 0 );
-    
+
             // Wait till the timetolive time exceeds
             Thread.sleep( 1200 );
-    
+
             // then access the cache so that the objects present in the cache will be expired
             for ( Object k : keys )
             {
                 assertNull( ehCache.get( k ) );
             }
-    
+
             assertEquals( 0, ehCache.getKeys().size() );
         }
         finally

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdAndOrDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdAndOrDecoderTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdAndOrDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdAndOrDecoderTest.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.shared.kerberos.codec;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
@@ -33,6 +34,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 
+
 /**
  * Test cases for AD-AND-OR codec.
  *
@@ -44,34 +46,62 @@ public class AdAndOrDecoderTest
     public void testDecodeFullAdAndOr()
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 0x2D );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x2B,
-                  (byte)0xA0, 0x03,                 // condition count
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x24,                 // elements
-                    0x30, 0x22,
-                      0x30, 0x0F,
-                        (byte)0xA0, 0x03,                 // ad-type
-                          0x02, 0x01, 0x02,
-                        (byte)0xA1, 0x08,                 // ad-data
-                          0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
-                      0x30, 0x0F,
-                        (byte)0xA0, 0x03,                 // ad-type
-                          0x02, 0x01, 0x02,
-                        (byte)0xA1, 0x08,                 // ad-data
-                          0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
-            } );
-        
-        String decodedPdu = Strings.dumpBytes(stream.array());
+                ( byte ) 0xA0, 0x03, // condition count
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x24, // elements
+                0x30,
+                0x22,
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'g',
+                'h',
+                'i',
+                'j',
+                'k',
+                'l'
+        } );
+
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
         adAndOrContainer.setStream( stream );
-        
+
         try
         {
             krbDecoder.decode( stream, adAndOrContainer );
@@ -82,20 +112,20 @@ public class AdAndOrDecoderTest
         }
 
         AdAndOr adAndOr = adAndOrContainer.getAdAndOr();
-        
+
         assertEquals( 2, adAndOr.getConditionCount() );
-        
+
         ByteBuffer bb = ByteBuffer.allocate( adAndOr.computeLength() );
-        
+
         try
         {
             bb = adAndOr.encode( bb );
-    
+
             // Check the length
             assertEquals( 0x2D, bb.limit() );
-    
-            String encodedPdu = Strings.dumpBytes(bb.array());
-    
+
+            String encodedPdu = Strings.dumpBytes( bb.array() );
+
             assertEquals( encodedPdu, decodedPdu );
         }
         catch ( EncoderException ee )
@@ -104,19 +134,19 @@ public class AdAndOrDecoderTest
         }
     }
 
-    
-    @Test( expected = DecoderException.class )
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrWithEmptySeq() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 2 );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x0
-            } );
-        
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
@@ -126,20 +156,20 @@ public class AdAndOrDecoderTest
         fail();
     }
 
-    
-    @Test( expected = DecoderException.class )
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrEmptyConditionCount() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 4 );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x02,
-                  (byte)0xA0, 0x00
-            } );
-        
+                ( byte ) 0xA0, 0x00
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
@@ -149,21 +179,21 @@ public class AdAndOrDecoderTest
         fail();
     }
 
-    
-    @Test( expected = DecoderException.class )
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrNullConditionCount() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 6 );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x04,
-                  (byte)0xA0, 0x02,
-                    0x02, 0x00
-            } );
-        
+                ( byte ) 0xA0, 0x02,
+                0x02, 0x00
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
@@ -173,31 +203,56 @@ public class AdAndOrDecoderTest
         fail();
     }
 
-    
-    @Test( expected = DecoderException.class )
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrNoConditionCount() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 0x28 );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x26,
-                  (byte)0xA1, 0x24,                 // elements
-                    0x30, 0x22,
-                      0x30, 0x0F,
-                        (byte)0xA0, 0x03,                 // ad-type
-                          0x02, 0x01, 0x02,
-                        (byte)0xA1, 0x08,                 // ad-data
-                          0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
-                      0x30, 0x0F,
-                        (byte)0xA0, 0x03,                 // ad-type
-                          0x02, 0x01, 0x02,
-                        (byte)0xA1, 0x08,                 // ad-data
-                          0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
-            } );
-        
+                ( byte ) 0xA1, 0x24, // elements
+                0x30,
+                0x22,
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'g',
+                'h',
+                'i',
+                'j',
+                'k',
+                'l'
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
@@ -207,21 +262,23 @@ public class AdAndOrDecoderTest
         fail();
     }
 
-    
-    @Test( expected = DecoderException.class )
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrNoElements() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 0x07 );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x05,
-                  (byte)0xA0, 0x03,                 // condition count
-                    0x02, 0x01, 0x02,
-            } );
-        
+                ( byte ) 0xA0, 0x03, // condition count
+                0x02,
+                0x01,
+                0x02,
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
@@ -230,23 +287,26 @@ public class AdAndOrDecoderTest
         krbDecoder.decode( stream, adAndOrContainer );
         fail();
     }
-    
-    
-    @Test( expected = DecoderException.class )
+
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrEmptyElements() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 0x09 );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x07,
-                  (byte)0xA0, 0x03,                 // condition count
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x00                  // elements
-            } );
-        
+                ( byte ) 0xA0, 0x03, // condition count
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x00 // elements
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();
@@ -254,24 +314,28 @@ public class AdAndOrDecoderTest
         krbDecoder.decode( stream, adAndOrContainer );
         fail();
     }
-    
-    
-    @Test( expected = DecoderException.class )
+
+
+    @Test(expected = DecoderException.class)
     public void testDecodeAdAndOrNullElements() throws DecoderException
     {
         Asn1Decoder krbDecoder = new Asn1Decoder();
-        
+
         ByteBuffer stream = ByteBuffer.allocate( 0x0B );
 
         stream.put( new byte[]
-            { 
+            {
                 0x30, 0x09,
-                  (byte)0xA0, 0x03,                 // condition count
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x02,                 // elements
-                    0x30, 0x00
-            } );
-        
+                ( byte ) 0xA0, 0x03, // condition count
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x02, // elements
+                0x30,
+                0x00
+        } );
+
         stream.flip();
 
         AdAndOrContainer adAndOrContainer = new AdAndOrContainer();

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdIfRelevantDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdIfRelevantDecoderTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdIfRelevantDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdIfRelevantDecoderTest.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.shared.kerberos.codec;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -38,6 +39,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 
+
 /**
  * Test cases for AD-IF-RELEVANT decoder.
  *
@@ -52,27 +54,49 @@ public class AdIfRelevantDecoderTest
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x24 );
-        
+
         stream.put( new byte[]
-            { 
-              0x30, 0x22,
-                0x30, 0x0F,
-                  (byte)0xA0, 0x03,                 // ad-type
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x08,                 // ad-data
-                    0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
+            {
+                0x30, 0x22,
                 0x30, 0x0F,
-                  (byte)0xA0, 0x03,                 // ad-type
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x08,                 // ad-data
-                    0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
-            } );
+                ( byte ) 0xA0, 0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'g',
+                'h',
+                'i',
+                'j',
+                'k',
+                'l'
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         AdIfRelevantContainer adIfRelevantContainer = new AdIfRelevantContainer();
-        
+
         // Decode the AdIfRelevant PDU
         try
         {
@@ -84,32 +108,33 @@ public class AdIfRelevantDecoderTest
         }
 
         AdIfRelevant adIfRelevant = adIfRelevantContainer.getAdIfRelevant();
-        
+
         assertNotNull( adIfRelevant.getAuthorizationData().size() );
         assertEquals( 2, adIfRelevant.getAuthorizationData().size() );
-        
-        String[] expected = new String[]{ "abcdef", "ghijkl" };
+
+        String[] expected = new String[]
+            { "abcdef", "ghijkl" };
         int i = 0;
-        
+
         for ( AuthorizationDataEntry ad : adIfRelevant.getAuthorizationData() )
         {
             assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
-            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) );
-            
+            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );
+
         }
 
         // Check the encoding
         ByteBuffer bb = ByteBuffer.allocate( adIfRelevant.computeLength() );
-        
+
         try
         {
             bb = adIfRelevant.encode( bb );
-    
+
             // Check the length
             assertEquals( 0x24, bb.limit() );
-    
-            String encodedPdu = Strings.dumpBytes(bb.array());
-    
+
+            String encodedPdu = Strings.dumpBytes( bb.array() );
+
             assertEquals( encodedPdu, decodedPdu );
         }
         catch ( EncoderException ee )

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdKdcIssuedDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdKdcIssuedDecoderTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdKdcIssuedDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdKdcIssuedDecoderTest.java Tue Jan 24 16:15:05 2012
@@ -66,40 +66,104 @@ public class AdKdcIssuedDecoderTest
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x60 );
-        
+
         stream.put( new byte[]
-            { 
-              0x30, 0x5E,                               
-                (byte)0xA0, 0x11,
-                  0x30, 0x0F,
-                    (byte)0xA0, 0x03,                   // cksumtype
-                      0x02, 0x01, 0x02,
-                    (byte)0xA1, 0x08,                   // checksum
-                      0x04, 0x06, 'c', 'h', 'k', 's', 'u', 'm',
-                (byte)0xA1, 0x0D,                       // realm
-                  0x1B, 0x0B, 'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M',
-                (byte)0xA2, 0x14,                     // sname
-                  0x30, 0x12,
-                    (byte)0xA0, 0x03,                 // name-type
-                      0x02, 0x01, 0x01,
-                    (byte)0xA1, 0x0B,                 // name-string
-                      0x30, 0x09,
-                        0x1B, 0x07, 'h', 'n', 'e', 'l', 's', 'o', 'n',
-                (byte)0xA3, 0x24,                     // enc-part
-                  0x30, 0x22,
-                    0x30, 0x0F,
-                      (byte)0xA0, 0x03,                 // ad-type
-                        0x02, 0x01, 0x02,
-                      (byte)0xA1, 0x08,                 // ad-data
-                        0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
-                    0x30, 0x0F,
-                      (byte)0xA0, 0x03,                 // ad-type
-                        0x02, 0x01, 0x02,
-                      (byte)0xA1, 0x08,                 // ad-data
-                        0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
-            } );
+            {
+                0x30, 0x5E,
+                ( byte ) 0xA0, 0x11,
+                0x30, 0x0F,
+                ( byte ) 0xA0, 0x03, // cksumtype
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // checksum
+                0x04,
+                0x06,
+                'c',
+                'h',
+                'k',
+                's',
+                'u',
+                'm',
+                ( byte ) 0xA1,
+                0x0D, // realm
+                0x1B,
+                0x0B,
+                'E',
+                'X',
+                'A',
+                'M',
+                'P',
+                'L',
+                'E',
+                '.',
+                'C',
+                'O',
+                'M',
+                ( byte ) 0xA2,
+                0x14, // sname
+                0x30,
+                0x12,
+                ( byte ) 0xA0,
+                0x03, // name-type
+                0x02,
+                0x01,
+                0x01,
+                ( byte ) 0xA1,
+                0x0B, // name-string
+                0x30,
+                0x09,
+                0x1B,
+                0x07,
+                'h',
+                'n',
+                'e',
+                'l',
+                's',
+                'o',
+                'n',
+                ( byte ) 0xA3,
+                0x24, // enc-part
+                0x30,
+                0x22,
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'g',
+                'h',
+                'i',
+                'j',
+                'k',
+                'l'
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a AdKdcIssued Container
@@ -117,34 +181,35 @@ public class AdKdcIssuedDecoderTest
         }
 
         // Check the decoded AdKdcIssued
-        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer).getAdKdcIssued();
+        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();
 
         Checksum checksum = adKdcIssued.getAdChecksum();
-        
+
         assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
-        assertTrue( Arrays.equals( Strings.getBytesUtf8("chksum"), checksum.getChecksumValue() ) );
+        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );
 
         assertEquals( "EXAMPLE.COM", adKdcIssued.getIRealm() );
-        
+
         PrincipalName principalName = adKdcIssued.getISName();
 
         assertNotNull( principalName );
         assertEquals( PrincipalNameType.KRB_NT_PRINCIPAL, principalName.getNameType() );
         assertTrue( principalName.getNames().contains( "hnelson" ) );
-        
+
         AuthorizationData authData = adKdcIssued.getElements();
-        
+
         assertNotNull( authData.getAuthorizationData().size() );
         assertEquals( 2, authData.getAuthorizationData().size() );
-        
-        String[] expected = new String[]{ "abcdef", "ghijkl" };
+
+        String[] expected = new String[]
+            { "abcdef", "ghijkl" };
         int i = 0;
-        
+
         for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
         {
             assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
-            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) );
-            
+            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );
+
         }
 
         ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );
@@ -157,7 +222,7 @@ public class AdKdcIssuedDecoderTest
             // Check the length
             assertEquals( 0x60, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -178,31 +243,67 @@ public class AdKdcIssuedDecoderTest
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x3B );
-        
+
         stream.put( new byte[]
-            { 
-              0x30, 0x39,                               
-                (byte)0xA0, 0x11,
-                  0x30, 0x0F,
-                    (byte)0xA0, 0x03,                   // cksumtype
-                      0x02, 0x01, 0x02,
-                    (byte)0xA1, 0x08,                   // checksum
-                      0x04, 0x06, 'c', 'h', 'k', 's', 'u', 'm',
-                (byte)0xA3, 0x24,                     // enc-part
-                  0x30, 0x22,
-                    0x30, 0x0F,
-                      (byte)0xA0, 0x03,                 // ad-type
-                        0x02, 0x01, 0x02,
-                      (byte)0xA1, 0x08,                 // ad-data
-                        0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
-                    0x30, 0x0F,
-                      (byte)0xA0, 0x03,                 // ad-type
-                        0x02, 0x01, 0x02,
-                      (byte)0xA1, 0x08,                 // ad-data
-                        0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
-            } );
+            {
+                0x30, 0x39,
+                ( byte ) 0xA0, 0x11,
+                0x30, 0x0F,
+                ( byte ) 0xA0, 0x03, // cksumtype
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // checksum
+                0x04,
+                0x06,
+                'c',
+                'h',
+                'k',
+                's',
+                'u',
+                'm',
+                ( byte ) 0xA3,
+                0x24, // enc-part
+                0x30,
+                0x22,
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'g',
+                'h',
+                'i',
+                'j',
+                'k',
+                'l'
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         // Allocate a AdKdcIssued Container
@@ -220,34 +321,35 @@ public class AdKdcIssuedDecoderTest
         }
 
         // Check the decoded AdKdcIssued
-        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer).getAdKdcIssued();
+        AdKdcIssued adKdcIssued = ( ( AdKdcIssuedContainer ) adKdcIssuedContainer ).getAdKdcIssued();
 
         // The checksum
         Checksum checksum = adKdcIssued.getAdChecksum();
-        
+
         assertEquals( ChecksumType.getTypeByValue( 2 ), checksum.getChecksumType() );
-        assertTrue( Arrays.equals( Strings.getBytesUtf8("chksum"), checksum.getChecksumValue() ) );
+        assertTrue( Arrays.equals( Strings.getBytesUtf8( "chksum" ), checksum.getChecksumValue() ) );
 
         // The realm
         assertNull( adKdcIssued.getIRealm() );
-        
+
         // The sname
         assertNull( adKdcIssued.getISName() );
 
         // the elements
         AuthorizationData authData = adKdcIssued.getElements();
-        
+
         assertNotNull( authData.getAuthorizationData().size() );
         assertEquals( 2, authData.getAuthorizationData().size() );
-        
-        String[] expected = new String[]{ "abcdef", "ghijkl" };
+
+        String[] expected = new String[]
+            { "abcdef", "ghijkl" };
         int i = 0;
-        
+
         for ( AuthorizationDataEntry ad : authData.getAuthorizationData() )
         {
             assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
-            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) );
-            
+            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );
+
         }
 
         ByteBuffer bb = ByteBuffer.allocate( adKdcIssued.computeLength() );
@@ -260,7 +362,7 @@ public class AdKdcIssuedDecoderTest
             // Check the length
             assertEquals( 0x3B, bb.limit() );
 
-            String encodedPdu = Strings.dumpBytes(bb.array());
+            String encodedPdu = Strings.dumpBytes( bb.array() );
 
             assertEquals( encodedPdu, decodedPdu );
         }
@@ -275,15 +377,15 @@ public class AdKdcIssuedDecoderTest
     /**
      * Test the decoding of an empty AdKDCIssued message
      */
-    @Test( expected=DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testDecodeTicketEmpty() throws Exception
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x02 );
-        
+
         stream.put( new byte[]
-            { 0x30, 0x00 });
+            { 0x30, 0x00 } );
 
         stream.flip();
 

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdMandatoryForKdcDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdMandatoryForKdcDecoderTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdMandatoryForKdcDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/AdMandatoryForKdcDecoderTest.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.shared.kerberos.codec;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -38,6 +39,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 
+
 /**
  * Test cases for AD-MANDATORY-FOR-KDC decoder.
  *
@@ -52,27 +54,49 @@ public class AdMandatoryForKdcDecoderTes
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x24 );
-        
+
         stream.put( new byte[]
-            { 
-              0x30, 0x22,
-                0x30, 0x0F,
-                  (byte)0xA0, 0x03,                 // ad-type
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x08,                 // ad-data
-                    0x04, 0x06, 'a', 'b', 'c', 'd', 'e', 'f',
+            {
+                0x30, 0x22,
                 0x30, 0x0F,
-                  (byte)0xA0, 0x03,                 // ad-type
-                    0x02, 0x01, 0x02,
-                  (byte)0xA1, 0x08,                 // ad-data
-                    0x04, 0x06, 'g', 'h', 'i', 'j', 'k', 'l'
-            } );
+                ( byte ) 0xA0, 0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03, // ad-type
+                0x02,
+                0x01,
+                0x02,
+                ( byte ) 0xA1,
+                0x08, // ad-data
+                0x04,
+                0x06,
+                'g',
+                'h',
+                'i',
+                'j',
+                'k',
+                'l'
+        } );
 
-        String decodedPdu = Strings.dumpBytes(stream.array());
+        String decodedPdu = Strings.dumpBytes( stream.array() );
         stream.flip();
 
         AdMandatoryForKdcContainer adMandatoryForKdcContainer = new AdMandatoryForKdcContainer();
-        
+
         // Decode the AdMandatoryForKdc PDU
         try
         {
@@ -84,32 +108,33 @@ public class AdMandatoryForKdcDecoderTes
         }
 
         AdMandatoryForKdc adMandatoryForKdc = adMandatoryForKdcContainer.getAdMandatoryForKdc();
-        
+
         assertNotNull( adMandatoryForKdc.getAuthorizationData().size() );
         assertEquals( 2, adMandatoryForKdc.getAuthorizationData().size() );
-        
-        String[] expected = new String[]{ "abcdef", "ghijkl" };
+
+        String[] expected = new String[]
+            { "abcdef", "ghijkl" };
         int i = 0;
-        
+
         for ( AuthorizationDataEntry ad : adMandatoryForKdc.getAuthorizationData() )
         {
             assertEquals( AuthorizationType.AD_INTENDED_FOR_SERVER, ad.getAdType() );
-            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), ad.getAdData() ) );
-            
+            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), ad.getAdData() ) );
+
         }
 
         // Check the encoding
         ByteBuffer bb = ByteBuffer.allocate( adMandatoryForKdc.computeLength() );
-        
+
         try
         {
             bb = adMandatoryForKdc.encode( bb );
-    
+
             // Check the length
             assertEquals( 0x24, bb.limit() );
-    
-            String encodedPdu = Strings.dumpBytes(bb.array());
-    
+
+            String encodedPdu = Strings.dumpBytes( bb.array() );
+
             assertEquals( encodedPdu, decodedPdu );
         }
         catch ( EncoderException ee )

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApRepDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApRepDecoderTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApRepDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApRepDecoderTest.java Tue Jan 24 16:15:05 2012
@@ -54,29 +54,46 @@ public class ApRepDecoderTest
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x21 );
-        
+
         stream.put( new byte[]
-        {
-            0x6F, 0x1F,
-              0x30, 0x1D,
-                (byte)0xA0, 0x03,                 // pvno
-                  0x02, 0x01, 0x05,
-                (byte)0xA1, 0x03,                 // msg-type
-                  0x02, 0x01, 0x0F,
-                (byte)0xA2, 0x11,                 // enc-part
-                  0x30, 0x0F, 
-                    (byte)0xA0, 0x03, 
-                      0x02, 0x01, 0x11, 
-                    (byte)0xA2, 0x08, 
-                      0x04, 0x06, 
-                        'a', 'b', 'c', 'd', 'e', 'f', 
-        });
+            {
+                0x6F, 0x1F,
+                0x30, 0x1D,
+                ( byte ) 0xA0, 0x03, // pvno
+                0x02,
+                0x01,
+                0x05,
+                ( byte ) 0xA1,
+                0x03, // msg-type
+                0x02,
+                0x01,
+                0x0F,
+                ( byte ) 0xA2,
+                0x11, // enc-part
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x11,
+                ( byte ) 0xA2,
+                0x08,
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+        } );
 
         stream.flip();
 
         // Allocate a AsRep Container
         ApRepContainer apRepContainer = new ApRepContainer( stream );
-        
+
         // Decode the ApRep PDU
         try
         {
@@ -88,20 +105,20 @@ public class ApRepDecoderTest
         }
 
         ApRep apRep = apRepContainer.getApRep();
-        
+
         // Check the encoding
         int length = apRep.computeLength();
 
         // Check the length
         assertEquals( 0x21, length );
-        
+
         // Check the encoding
         ByteBuffer encodedPdu = ByteBuffer.allocate( length );
-        
+
         try
         {
             encodedPdu = apRep.encode( encodedPdu );
-            
+
             // Check the length
             assertEquals( 0x21, encodedPdu.limit() );
         }
@@ -110,54 +127,73 @@ public class ApRepDecoderTest
             fail();
         }
     }
+
+
     /**
      * Test the decoding of a AP-REP message with a wrong msg-type
      */
-    @Test( expected=DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testDecodeFullApRepWrongMsgType() throws Exception
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x21 );
-        
+
         stream.put( new byte[]
-        {
-            0x6F, 0x1F,
-              0x30, 0x1D,
-                (byte)0xA0, 0x03,                 // pvno
-                  0x02, 0x01, 0x05,
-                (byte)0xA1, 0x03,                 // msg-type
-                  0x02, 0x01, 0x0F,
-                (byte)0xA2, 0x11,                 // enc-part
-                  0x30, 0x0E, 
-                    (byte)0xA0, 0x03, 
-                      0x02, 0x01, 0x11, 
-                    (byte)0xA2, 0x08, 
-                      0x04, 0x06, 
-                        'a', 'b', 'c', 'd', 'e', 'f', 
-        });
+            {
+                0x6F, 0x1F,
+                0x30, 0x1D,
+                ( byte ) 0xA0, 0x03, // pvno
+                0x02,
+                0x01,
+                0x05,
+                ( byte ) 0xA1,
+                0x03, // msg-type
+                0x02,
+                0x01,
+                0x0F,
+                ( byte ) 0xA2,
+                0x11, // enc-part
+                0x30,
+                0x0E,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x11,
+                ( byte ) 0xA2,
+                0x08,
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+        } );
 
         stream.flip();
 
         // Allocate a AsRep Container
         ApRepContainer apRepContainer = new ApRepContainer( stream );
-        
+
         // Decode the ApRep PDU
         kerberosDecoder.decode( stream, apRepContainer );
         fail();
     }
-    
-    
+
+
     /**
      * Test the decoding of a AP-REP with nothing in it
      */
-    @Test( expected = DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testApRepEmpty() throws DecoderException
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x02 );
-        
+
         stream.put( new byte[]
             { 0x6F, 0x00 } );
 
@@ -170,23 +206,23 @@ public class ApRepDecoderTest
         kerberosDecoder.decode( stream, apRepContainer );
         fail();
     }
-    
-    
+
+
     /**
      * Test the decoding of a AP-REP with empty SEQ
      */
-    @Test( expected = DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testApRepEmptSEQ() throws DecoderException
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x04 );
-        
+
         stream.put( new byte[]
-            { 
+            {
                 0x6F, 0x02,
-                  0x30, 0x00,
-            } );
+                0x30, 0x00,
+        } );
 
         stream.flip();
 
@@ -197,24 +233,24 @@ public class ApRepDecoderTest
         kerberosDecoder.decode( stream, apRepContainer );
         fail();
     }
-    
-    
+
+
     /**
      * Test the decoding of a AP-REP with empty Pvno tag
      */
-    @Test( expected = DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testApRepEmptyPvnoTag() throws DecoderException
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x06 );
-        
+
         stream.put( new byte[]
-            { 
+            {
                 0x6F, 0x04,
-                  0x30, 0x02,
-                    (byte)0xA0, 0x00
-            } );
+                0x30, 0x02,
+                ( byte ) 0xA0, 0x00
+        } );
 
         stream.flip();
 
@@ -225,25 +261,25 @@ public class ApRepDecoderTest
         kerberosDecoder.decode( stream, apRepContainer );
         fail();
     }
-    
-    
+
+
     /**
      * Test the decoding of a AP-REP with empty Pvno value
      */
-    @Test( expected = DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testAsRepEmptyPvnoValue() throws DecoderException
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x08 );
-        
+
         stream.put( new byte[]
-            { 
+            {
                 0x6E, 0x06,
-                  0x30, 0x04,
-                    (byte)0xA0, 0x02,
-                      0x02, 0x00
-            } );
+                0x30, 0x04,
+                ( byte ) 0xA0, 0x02,
+                0x02, 0x00
+        } );
 
         stream.flip();
 

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApReqDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApReqDecoderTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApReqDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/ApReqDecoderTest.java Tue Jan 24 16:15:05 2012
@@ -55,54 +55,121 @@ public class ApReqDecoderTest
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x6C );
-        
+
         stream.put( new byte[]
-        {
-          0x6E, 0x6A,
-            0x30, 0x68,
-              (byte)0xA0, 0x03,                 // pvno
-                0x02, 0x01, 0x05,
-              (byte)0xA1, 0x03,                 // msg-type
-                0x02, 0x01, 0x0E,
-              (byte)0xA2, 0x07,                 // APOptions
-                0x03, 0x05, 0x00, 0x60, 0x00, 0x00, 0x00,
-              (byte)0xA3, 0x40,                 // Ticket
-                0x61, 0x3E, 
-                  0x30, 0x3C, 
-                    (byte)0xA0, 0x03, 
-                      0x02, 0x01, 0x05, 
-                    (byte)0xA1, 0x0D, 
-                      0x1B, 0x0B, 
-                        'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M', 
-                    (byte)0xA2, 0x13, 
-                      0x30, 0x11, 
-                        (byte)0xA0, 0x03, 
-                          0x02, 0x01, 0x01, 
-                        (byte)0xA1, 0x0A, 
-                          0x30, 0x08, 
-                            0x1B, 0x06, 
-                              'c', 'l', 'i', 'e', 'n', 't', 
-                    (byte)0xA3, 0x11, 
-                      0x30, 0x0F, 
-                        (byte)0xA0, 0x03, 
-                          0x02, 0x01, 0x11, 
-                        (byte)0xA2, 0x08, 
-                          0x04, 0x06, 
-                            'a', 'b', 'c', 'd', 'e', 'f', 
-              (byte)0xA4, 0x11,                 // Authenticator
-                0x30, 0x0F, 
-                  (byte)0xA0, 0x03, 
-                    0x02, 0x01, 0x11, 
-                  (byte)0xA2, 0x08, 
-                    0x04, 0x06, 
-                      'a', 'b', 'c', 'd', 'e', 'f', 
-        });
+            {
+                0x6E, 0x6A,
+                0x30, 0x68,
+                ( byte ) 0xA0, 0x03, // pvno
+                0x02,
+                0x01,
+                0x05,
+                ( byte ) 0xA1,
+                0x03, // msg-type
+                0x02,
+                0x01,
+                0x0E,
+                ( byte ) 0xA2,
+                0x07, // APOptions
+                0x03,
+                0x05,
+                0x00,
+                0x60,
+                0x00,
+                0x00,
+                0x00,
+                ( byte ) 0xA3,
+                0x40, // Ticket
+                0x61,
+                0x3E,
+                0x30,
+                0x3C,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x05,
+                ( byte ) 0xA1,
+                0x0D,
+                0x1B,
+                0x0B,
+                'E',
+                'X',
+                'A',
+                'M',
+                'P',
+                'L',
+                'E',
+                '.',
+                'C',
+                'O',
+                'M',
+                ( byte ) 0xA2,
+                0x13,
+                0x30,
+                0x11,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x01,
+                ( byte ) 0xA1,
+                0x0A,
+                0x30,
+                0x08,
+                0x1B,
+                0x06,
+                'c',
+                'l',
+                'i',
+                'e',
+                'n',
+                't',
+                ( byte ) 0xA3,
+                0x11,
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x11,
+                ( byte ) 0xA2,
+                0x08,
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                ( byte ) 0xA4,
+                0x11, // Authenticator
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x11,
+                ( byte ) 0xA2,
+                0x08,
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+        } );
 
         stream.flip();
 
         // Allocate a ApReq Container
         ApReqContainer apReqContainer = new ApReqContainer( stream );
-        
+
         // Decode the ApReq PDU
         try
         {
@@ -114,22 +181,22 @@ public class ApReqDecoderTest
         }
 
         ApReq apReq = apReqContainer.getApReq();
-        
+
         assertTrue( apReq instanceof ApReq );
-        
+
         // Check the encoding
         int length = apReq.computeLength();
 
         // Check the length
         assertEquals( 0x6C, length );
-        
+
         // Check the encoding
         ByteBuffer encodedPdu = ByteBuffer.allocate( length );
-        
+
         try
         {
             encodedPdu = apReq.encode( encodedPdu );
-    
+
             // Check the length
             assertEquals( 0x6C, encodedPdu.limit() );
         }
@@ -138,81 +205,148 @@ public class ApReqDecoderTest
             fail();
         }
     }
-    
-    
+
+
     /**
      * Test the decoding of a ApReq message with a bad MsgType
      */
-    @Test( expected = DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testDecodeFullApReqBadMsgType() throws Exception
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x193 );
-        
+
         stream.put( new byte[]
-        {
-            0x6E, 0x6A,
-            0x30, 0x68,
-              (byte)0xA0, 0x03,                 // pvno
-                0x02, 0x01, 0x05,
-              (byte)0xA1, 0x03,                 // msg-type (wrong...)
-                0x02, 0x01, 0x0D,
-              (byte)0xA2, 0x07,                 // APOptions
-                0x03, 0x05, 0x00, 0x60, 0x00, 0x00, 0x00,
-              (byte)0xA3, 0x40,                 // Ticket
-                0x61, 0x3E, 
-                  0x30, 0x3C, 
-                    (byte)0xA0, 0x03, 
-                      0x02, 0x01, 0x05, 
-                    (byte)0xA1, 0x0D, 
-                      0x1B, 0x0B, 
-                        'E', 'X', 'A', 'M', 'P', 'L', 'E', '.', 'C', 'O', 'M', 
-                    (byte)0xA2, 0x13, 
-                      0x30, 0x11, 
-                        (byte)0xA0, 0x03, 
-                          0x02, 0x01, 0x01, 
-                        (byte)0xA1, 0x0A, 
-                          0x30, 0x08, 
-                            0x1B, 0x06, 
-                              'c', 'l', 'i', 'e', 'n', 't', 
-                    (byte)0xA3, 0x11, 
-                      0x30, 0x0F, 
-                        (byte)0xA0, 0x03, 
-                          0x02, 0x01, 0x11, 
-                        (byte)0xA2, 0x08, 
-                          0x04, 0x06, 
-                            'a', 'b', 'c', 'd', 'e', 'f', 
-              (byte)0xA4, 0x11,                 // Authenticator
-                0x30, 0x0F, 
-                  (byte)0xA0, 0x03, 
-                    0x02, 0x01, 0x11, 
-                  (byte)0xA2, 0x08, 
-                    0x04, 0x06, 
-                      'a', 'b', 'c', 'd', 'e', 'f', 
-        });
+            {
+                0x6E, 0x6A,
+                0x30, 0x68,
+                ( byte ) 0xA0, 0x03, // pvno
+                0x02,
+                0x01,
+                0x05,
+                ( byte ) 0xA1,
+                0x03, // msg-type (wrong...)
+                0x02,
+                0x01,
+                0x0D,
+                ( byte ) 0xA2,
+                0x07, // APOptions
+                0x03,
+                0x05,
+                0x00,
+                0x60,
+                0x00,
+                0x00,
+                0x00,
+                ( byte ) 0xA3,
+                0x40, // Ticket
+                0x61,
+                0x3E,
+                0x30,
+                0x3C,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x05,
+                ( byte ) 0xA1,
+                0x0D,
+                0x1B,
+                0x0B,
+                'E',
+                'X',
+                'A',
+                'M',
+                'P',
+                'L',
+                'E',
+                '.',
+                'C',
+                'O',
+                'M',
+                ( byte ) 0xA2,
+                0x13,
+                0x30,
+                0x11,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x01,
+                ( byte ) 0xA1,
+                0x0A,
+                0x30,
+                0x08,
+                0x1B,
+                0x06,
+                'c',
+                'l',
+                'i',
+                'e',
+                'n',
+                't',
+                ( byte ) 0xA3,
+                0x11,
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x11,
+                ( byte ) 0xA2,
+                0x08,
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+                ( byte ) 0xA4,
+                0x11, // Authenticator
+                0x30,
+                0x0F,
+                ( byte ) 0xA0,
+                0x03,
+                0x02,
+                0x01,
+                0x11,
+                ( byte ) 0xA2,
+                0x08,
+                0x04,
+                0x06,
+                'a',
+                'b',
+                'c',
+                'd',
+                'e',
+                'f',
+        } );
 
         stream.flip();
 
         // Allocate a ApReq Container
         ApReqContainer apReqContainer = new ApReqContainer( stream );
-        
+
         // Decode the ApReq PDU
         kerberosDecoder.decode( stream, apReqContainer );
         fail();
     }
-    
-    
+
+
     /**
      * Test the decoding of a AP-REQ with nothing in it
      */
-    @Test( expected = DecoderException.class)
+    @Test(expected = DecoderException.class)
     public void testApReqEmpty() throws DecoderException
     {
         Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
         ByteBuffer stream = ByteBuffer.allocate( 0x02 );
-        
+
         stream.put( new byte[]
             { 0x6A, 0x00 } );
 



Mime
View raw message