directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1037537 - in /directory/apacheds/trunk: kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/ protocol-kerb...
Date Sun, 21 Nov 2010 19:43:38 GMT
Author: felixk
Date: Sun Nov 21 19:43:38 2010
New Revision: 1037537

URL: http://svn.apache.org/viewvc?rev=1037537&view=rev
Log:
Move test case to where it belongs and cleanup

Added:
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java
      - copied, changed from r1037475, directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java
Removed:
    directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/
Modified:
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java

Copied: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java
(from r1037475, directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java?p2=directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java&p1=directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java&r1=1037475&r2=1037537&rev=1037537&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/KdcOptionsTest.java
Sun Nov 21 19:43:38 2010
@@ -17,65 +17,30 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.server.kerberos.messages.value;
+package org.apache.directory.server.kerberos.shared.messages.value;
 
 
+import static org.junit.Assert.assertTrue;
+
 import java.util.Arrays;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.kerberos.shared.messages.value.KdcOptions;
-import org.apache.directory.server.kerberos.shared.messages.value.flags.TicketFlag;
-import org.apache.directory.server.kerberos.shared.messages.value.flags.TicketFlags;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrent()
-public class OptionsTest
+public class KdcOptionsTest
 {
     private static final byte[] fpriOptions =
         { ( byte ) 0x50, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x10 };
 
 
     /**
-     * Tests converting the ticket flags to a descriptive String.
-     */
-    @Test
-    public void testToString()
-    {
-        TicketFlags flags = new TicketFlags();
-        flags.setFlag( TicketFlag.FORWARDABLE );
-        flags.setFlag( TicketFlag.PROXIABLE );
-        flags.setFlag( TicketFlag.RENEWABLE );
-        flags.setFlag( TicketFlag.INITIAL );
-        assertEquals( flags.toString(), "FORWARDABLE(1) PROXIABLE(3) RENEWABLE(8) INITIAL(9)"
);
-    }
-
-
-    /**
-     * Tests that setting flags is idempotent.
-     */
-    @Test
-    public void testDuplicateSetting()
-    {
-        TicketFlags flags = new TicketFlags();
-        flags.setFlag( TicketFlag.MAY_POSTDATE );
-        flags.setFlag( TicketFlag.FORWARDABLE );
-        flags.setFlag( TicketFlag.PROXIABLE );
-        flags.setFlag( TicketFlag.MAY_POSTDATE );
-        flags.setFlag( TicketFlag.RENEWABLE );
-        assertEquals( flags.toString(), "FORWARDABLE(1) PROXIABLE(3) MAY_POSTDATE(5) RENEWABLE(8)"
);
-    }
-
-
-    /**
      * Tests the basic construction of the {@link KdcOptions}.
      */
     @Test

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java?rev=1037537&r1=1037536&r2=1037537&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
Sun Nov 21 19:43:38 2010
@@ -144,17 +144,15 @@ public class TicketFlagsTest
     }
 
 
+    /**
+     * Tests converting the ticket flags to a descriptive String.
+     */
     @Test
-    public void testNoFlagsToString() throws Exception
+    public void testToString() throws Exception
     {
         TicketFlags tf = new TicketFlags();
         assertEquals( "toString()", "", tf.toString() );
-    }
-
 
-    @Test
-    public void testAllFlagsToString() throws Exception
-    {
         int i = 0;
         for ( TicketFlag t : TicketFlag.values() )
         {
@@ -164,7 +162,7 @@ public class TicketFlagsTest
             }
         }
 
-        TicketFlags tf = new TicketFlags( i );
+        tf = new TicketFlags( i );
         assertEquals( "toString()", "RESERVED(0) FORWARDABLE(1) FORWARDED(2) PROXIABLE(3)
PROXY(4) "
             + "MAY_POSTDATE(5) POSTDATED(6) INVALID(7) RENEWABLE(8) INITIAL(9) PRE_AUTHENT(10)
"
             + "HW_AUTHENT(11) TRANSITED_POLICY_CHECKED(12) OK_AS_DELEGATE(13)", tf.toString()
);
@@ -172,6 +170,22 @@ public class TicketFlagsTest
 
 
     /**
+     * Tests that setting flags is idempotent.
+     */
+    @Test
+    public void testDuplicateSetting()
+    {
+        TicketFlags flags = new TicketFlags();
+        flags.setFlag( TicketFlag.MAY_POSTDATE );
+        flags.setFlag( TicketFlag.FORWARDABLE );
+        flags.setFlag( TicketFlag.PROXIABLE );
+        flags.setFlag( TicketFlag.MAY_POSTDATE );
+        flags.setFlag( TicketFlag.RENEWABLE );
+        assertEquals( flags.toString(), "FORWARDABLE(1) PROXIABLE(3) MAY_POSTDATE(5) RENEWABLE(8)"
);
+    }
+
+
+    /**
      * 
      * Get the byte array representation of an int
      *



Mime
View raw message