directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r485959 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/UsageEnumTest.java
Date Tue, 12 Dec 2006 00:04:04 GMT
Author: elecharny
Date: Mon Dec 11 16:04:04 2006
New Revision: 485959

URL: http://svn.apache.org/viewvc?view=rev&rev=485959
Log:
Added a Unit test class for UsageEnum

Added:
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/UsageEnumTest.java

Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/UsageEnumTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/UsageEnumTest.java?view=auto&rev=485959
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/UsageEnumTest.java
(added)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/UsageEnumTest.java
Mon Dec 11 16:04:04 2006
@@ -0,0 +1,57 @@
+/*
+ *  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.shared.ldap.schema;
+
+import junit.framework.TestCase;
+
+/**
+ * The unit tests for methods on UsageEnum.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 485048 $
+ */
+public class UsageEnumTest extends TestCase
+{
+    public void testGetValue()
+    {
+        assertEquals( 0, UsageEnum.USER_APPLICATIONS.getValue() );
+        assertEquals( 1, UsageEnum.DIRECTORY_OPERATION.getValue() );
+        assertEquals( 2, UsageEnum.DISTRIBUTED_OPERATION.getValue() );
+        assertEquals( 3, UsageEnum.DSA_OPERATION.getValue() );
+    }
+    
+    public void testGetUsage()
+    {
+        assertEquals( UsageEnum.DIRECTORY_OPERATION, UsageEnum.getUsage( "directoryOperation"
) );
+        assertEquals( UsageEnum.USER_APPLICATIONS, UsageEnum.getUsage( "userApplications"
) );
+        assertEquals( UsageEnum.DISTRIBUTED_OPERATION, UsageEnum.getUsage( "distributedOperation"
) );
+        assertEquals( UsageEnum.DSA_OPERATION, UsageEnum.getUsage( "dsaOperation" ) );
+        assertEquals( null, UsageEnum.getUsage( "azerty" ) );
+    }
+    
+    public void testRenderer()
+    {
+        assertEquals( "directoryOperation", UsageEnum.render( UsageEnum.DIRECTORY_OPERATION
) );
+        assertEquals( "userApplications", UsageEnum.render( UsageEnum.USER_APPLICATIONS )
);
+        assertEquals( "distributedOperation", UsageEnum.render( UsageEnum.DISTRIBUTED_OPERATION
) );
+        assertEquals( "dsaOperation", UsageEnum.render( UsageEnum.DSA_OPERATION ) );
+        assertEquals( "", UsageEnum.render( null ) );
+    }
+}



Mime
View raw message