directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1032813 - in /directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec: KdcReqBodyDecoderTest.java TicketDecoderTest.java
Date Tue, 09 Nov 2010 02:13:50 GMT
Author: elecharny
Date: Tue Nov  9 02:13:50 2010
New Revision: 1032813

URL: http://svn.apache.org/viewvc?rev=1032813&view=rev
Log:
o Almost completely implemented the KDC-REQ-BODY encode method
o Improved the test

Modified:
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KdcReqBodyDecoderTest.java
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/TicketDecoderTest.java

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KdcReqBodyDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KdcReqBodyDecoderTest.java?rev=1032813&r1=1032812&r2=1032813&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KdcReqBodyDecoderTest.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KdcReqBodyDecoderTest.java
Tue Nov  9 02:13:50 2010
@@ -21,9 +21,13 @@ package org.apache.directory.shared.kerb
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.nio.ByteBuffer;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.shared.asn1.codec.EncoderException;
 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.HostAddrType;
@@ -34,6 +38,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.KdcReqBody;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.messages.Ticket;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -98,5 +103,24 @@ public class KdcReqBodyDecoderTest
 
         // Check the length
         assertEquals( 0x15E, length );
+        
+        // Check the encoding
+        ByteBuffer bb = ByteBuffer.allocate( length );
+        
+        try
+        {
+            bb = body.encode( bb );
+    
+            // Check the length
+            assertEquals( 0x15E, bb.limit() );
+    
+            System.out.println( StringTools.dumpBytes( bb.array() ) );
+    
+            //assertEquals( encodedPdu, decodedPdu );
+        }
+        catch ( EncoderException ee )
+        {
+            fail();
+        }
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/TicketDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/TicketDecoderTest.java?rev=1032813&r1=1032812&r2=1032813&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/TicketDecoderTest.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/TicketDecoderTest.java
Tue Nov  9 02:13:50 2010
@@ -127,7 +127,7 @@ public class TicketDecoderTest
         // Check the encoding
         try
         {
-            ByteBuffer bb = ticket.encode();
+            ByteBuffer bb = ticket.encode( null );
 
             // Check the length
             assertEquals( 0x46, bb.limit() );



Mime
View raw message