directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1039010 - /directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/flags/TicketFlagsTest.java
Date Thu, 25 Nov 2010 11:57:45 GMT
Author: elecharny
Date: Thu Nov 25 11:57:45 2010
New Revision: 1039010

URL: http://svn.apache.org/viewvc?rev=1039010&view=rev
Log:
Added some more tests

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

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/flags/TicketFlagsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/flags/TicketFlagsTest.java?rev=1039010&r1=1039009&r2=1039010&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/flags/TicketFlagsTest.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/flags/TicketFlagsTest.java
Thu Nov 25 11:57:45 2010
@@ -19,8 +19,12 @@
  */
 package org.apache.directory.shared.kerberos.codec.flags;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import java.util.Arrays;
+
 import org.apache.directory.shared.kerberos.flags.TicketFlag;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
 import org.junit.Test;
@@ -38,8 +42,25 @@ public class TicketFlagsTest
     {
         TicketFlags flags = new TicketFlags();
         
+        assertFalse( flags.isForwardable() );
         flags.setFlag( TicketFlag.FORWARDABLE );
         
+        assertTrue( flags.isForwardable() );
         assertTrue( flags.toString().startsWith( TicketFlag.FORWARDABLE.toString() ) );
+        
+        assertFalse( flags.isRenewable() );
+        flags.setFlag( TicketFlag.RENEWABLE );
+        assertTrue( flags.isRenewable() );
+        assertTrue( flags.isForwardable() );
+
+        int flagValue = flags.getIntValue();
+        assertEquals( 0x40800000, flagValue );
+
+        flags.clearFlag( TicketFlag.FORWARDABLE );
+        assertTrue( flags.isRenewable() );
+        assertFalse( flags.isForwardable() );
+        
+        byte[] bytes = flags.getData();
+        assertTrue( Arrays.equals( new byte[]{ 0x00, 0x00, (byte)0x80, 0x00, 0x00}, bytes
) );
     }
 }



Mime
View raw message