directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 57006 - in incubator/directory/kerberos/trunk/kerberos/src/test/org/apache/kerberos/messages: . value
Date Tue, 09 Nov 2004 09:00:29 GMT
Author: erodriguez
Date: Tue Nov  9 01:00:28 2004
New Revision: 57006

Added:
   incubator/directory/kerberos/trunk/kerberos/src/test/org/apache/kerberos/messages/
   incubator/directory/kerberos/trunk/kerberos/src/test/org/apache/kerberos/messages/value/
   incubator/directory/kerberos/trunk/kerberos/src/test/org/apache/kerberos/messages/value/OptionsTest.java
Log:
TestCase for options processing.

Added: incubator/directory/kerberos/trunk/kerberos/src/test/org/apache/kerberos/messages/value/OptionsTest.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/kerberos/src/test/org/apache/kerberos/messages/value/OptionsTest.java
Tue Nov  9 01:00:28 2004
@@ -0,0 +1,54 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.value;
+
+import junit.framework.TestCase;
+
+import java.util.Arrays;
+
+public class OptionsTest extends TestCase
+ {
+    private byte[] fpriOptions = {(byte) 0x50, (byte)0x00, (byte)0x00, (byte)0x10};
+
+    public void testToString()
+    {
+        TicketFlags flags = new TicketFlags();
+		flags.set(TicketFlags.FORWARDABLE);
+		flags.set(TicketFlags.PROXIABLE);
+		flags.set(TicketFlags.RENEWABLE);
+		flags.set(TicketFlags.INITIAL);
+        assertEquals(flags.toString(), "FORWARDABLE PROXIABLE RENEWABLE INITIAL");
+    }
+
+	public void testDuplicateSetting()
+    {
+		TicketFlags flags = new TicketFlags();
+        flags.set(TicketFlags.MAY_POSTDATE);
+		flags.set(TicketFlags.FORWARDABLE);
+		flags.set(TicketFlags.PROXIABLE);
+        flags.set(TicketFlags.MAY_POSTDATE);
+		flags.set(TicketFlags.RENEWABLE);
+        assertEquals(flags.toString(), "FORWARDABLE PROXIABLE MAY_POSTDATE RENEWABLE");
+	}
+
+    public void testConstruction()
+    {
+		KdcOptions options = new KdcOptions(fpriOptions);
+        assertTrue(Arrays.equals(options.getBytes(), fpriOptions));
+    }
+}
+

Mime
View raw message