directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1037242 - /directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
Date Sat, 20 Nov 2010 15:28:20 GMT
Author: felixk
Date: Sat Nov 20 15:28:19 2010
New Revision: 1037242

URL: http://svn.apache.org/viewvc?rev=1037242&view=rev
Log:
Simple test for TicketFlag construction

Added:
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
  (with props)

Added: 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=1037242&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
(added)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
Sat Nov 20 15:28:19 2010
@@ -0,0 +1,82 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.server.kerberos.shared.messages.value.flags;
+
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+
+/**
+ * Test for TicketFlags
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TicketFlagsTest
+{
+
+    @Test
+    public void constructorsTest() throws Exception
+    {
+        // Empty c'tor -> no flags set
+        TicketFlags tf = new TicketFlags();
+        for ( TicketFlag t : TicketFlag.values() )
+        {
+            if ( !t.equals( TicketFlags.MAX_SIZE ) )
+            {
+                assertFalse( tf.isFlagSet( t ) );
+            }
+        }
+        assertFalse( tf.isForwardable() );
+        assertFalse( tf.isForwarded() );
+        assertFalse( tf.isHwAuthent() );
+        assertFalse( tf.isInitial() );
+        assertFalse( tf.isInvalid() );
+        assertFalse( tf.isMayPosdate() );
+        assertFalse( tf.isOkAsDelegate() );
+        assertFalse( tf.isPostdated() );
+        assertFalse( tf.isPreAuth() );
+        assertFalse( tf.isProxiable() );
+        assertFalse( tf.isProxy() );
+        assertFalse( tf.isRenewable() );
+        assertFalse( tf.isReserved() );
+        assertFalse( tf.isTransitedPolicyChecked() );
+
+        // Flags 1, 2, 4, 8 set
+        tf = new TicketFlags( 278 );
+        assertFalse( tf.isReserved() ); // 0
+        assertTrue( tf.isForwardable() ); // 1
+        assertTrue( tf.isForwarded() ); // 2
+        assertFalse( tf.isProxiable() ); // 3
+        assertTrue( tf.isProxy() ); // 4
+        assertFalse( tf.isMayPosdate() ); // 5
+        assertFalse( tf.isPostdated() ); // 6
+        assertFalse( tf.isInvalid() ); // 7
+        assertTrue( tf.isRenewable() ); // 8
+        assertFalse( tf.isInitial() ); // 9
+        assertFalse( tf.isPreAuth() ); // 10
+        assertFalse( tf.isHwAuthent() ); // 11
+        assertFalse( tf.isTransitedPolicyChecked() ); // 12
+        assertFalse( tf.isOkAsDelegate() ); // 13
+    }
+
+}

Propchange: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/flags/TicketFlagsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message