directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r201859 - /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java
Date Sun, 26 Jun 2005 14:51:20 GMT
Author: elecharny
Date: Sun Jun 26 07:51:20 2005
New Revision: 201859

URL: http://svn.apache.org/viewcvs?rev=201859&view=rev
Log:
Added a test case for NamespaceTools inferLdapName method

Added:
    directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java

Added: directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java?rev=201859&view=auto
==============================================================================
--- directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java
(added)
+++ directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java
Sun Jun 26 07:51:20 2005
@@ -0,0 +1,51 @@
+/*
+ *   Copyright 2005 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.ldap.common.util;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+/**
+ * Test the NameToolsTest class
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class NamespaceToolsTest extends TestCase {
+    public void testNullRealm()
+    {
+        Assert.assertEquals("", NamespaceTools.inferLdapName(null));
+    }
+
+    public void testEmptyRealm()
+    {
+        Assert.assertEquals("", NamespaceTools.inferLdapName(""));
+    }
+
+    public void testSingleElemRealm()
+    {
+        Assert.assertEquals("dc=test", NamespaceTools.inferLdapName("test"));
+    }
+
+    public void testTwoElemsRealm()
+    {
+        Assert.assertEquals("dc=test,dc=com", NamespaceTools.inferLdapName("test.com"));
+    }
+
+    public void testFullRealm()
+    {
+        Assert.assertEquals("dc=CS,dc=UCL,dc=AC,dc=UK", NamespaceTools.inferLdapName("CS.UCL.AC.UK"));
+    }
+}



Mime
View raw message