directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1037652 - /directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeDecoderTest.java
Date Mon, 22 Nov 2010 09:52:00 GMT
Author: kayyagari
Date: Mon Nov 22 09:52:00 2010
New Revision: 1037652

URL: http://svn.apache.org/viewvc?rev=1037652&view=rev
Log:
o fixed a test and added another

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

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeDecoderTest.java?rev=1037652&r1=1037651&r2=1037652&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeDecoderTest.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeDecoderTest.java
Mon Nov 22 09:52:00 2010
@@ -99,7 +99,7 @@ public class KrbSafeDecoderTest
         assertNotNull( krbSafe.getSafeBody() );
         
         int encodedLen = krbSafe.computeLength();
-        assertEquals( streamLen + 2, encodedLen );
+        assertEquals( streamLen, encodedLen );
         
         try
         {
@@ -114,4 +114,28 @@ public class KrbSafeDecoderTest
             fail();
         }
     }
+    
+    
+    @Test( expected = DecoderException.class)
+    public void testDecodeKrbSafeWithIncorrectPdu() throws DecoderException
+    {
+        byte[] data = new byte[]{
+            0x74, 0xC,
+              0x30, 0xA,
+               (byte)0xA0, 0x03,        // pvno
+                 0x02, 0x01, 0x05,
+               (byte)0xA1, 0x03,        // msg-type
+                 0x02, 0x01, 0x14,
+        };
+        
+        ByteBuffer stream = ByteBuffer.wrap( data );
+        
+        Asn1Decoder decoder = new Asn1Decoder();
+        
+        KrbSafeContainer container = new  KrbSafeContainer();
+        container.setStream( stream );
+        
+        decoder.decode( stream, container );
+    }
+    
 }



Mime
View raw message