You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/12/20 19:33:29 UTC

svn commit: r489167 - in /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax: SupplierAndConsumerSyntaxCheckerTest.java SupplierInformationSyntaxCheckerTest.java SupplierOrConsumerSyntaxCheckerTest.java

Author: elecharny
Date: Wed Dec 20 10:33:28 2006
New Revision: 489167

URL: http://svn.apache.org/viewvc?view=rev&rev=489167
Log:
Added SupplierXXX syntaxCheckers :
- SupplierInformation
- SupplierAndConsumer
- SupplierOrConsumer
Added the related tests

Added:
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierAndConsumerSyntaxCheckerTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierInformationSyntaxCheckerTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierOrConsumerSyntaxCheckerTest.java

Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierAndConsumerSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierAndConsumerSyntaxCheckerTest.java?view=auto&rev=489167
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierAndConsumerSyntaxCheckerTest.java (added)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierAndConsumerSyntaxCheckerTest.java Wed Dec 20 10:33:28 2006
@@ -0,0 +1,56 @@
+/*
+ *  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.syntax;
+
+import junit.framework.TestCase;
+
+/**
+ * Test cases for SupplierAndConsumerSyntaxChecker.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class SupplierAndConsumerSyntaxCheckerTest extends TestCase
+{
+    SupplierAndConsumerSyntaxChecker checker = new SupplierAndConsumerSyntaxChecker();
+
+
+    public void testNullString()
+    {
+        assertTrue( checker.isValidSyntax( null ) );
+    }
+
+
+    public void testEmptyString()
+    {
+        assertTrue( checker.isValidSyntax( "" ) );
+    }
+
+    public void testOid()
+    {
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.48", checker.getSyntaxOid() );
+    }
+
+    public void testCorrectCase()
+    {
+        assertTrue( checker.isValidSyntax( "FALSE" ) );
+        assertTrue( checker.isValidSyntax( new byte[]{0x01, (byte)0xFF} ) );
+    }
+}

Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierInformationSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierInformationSyntaxCheckerTest.java?view=auto&rev=489167
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierInformationSyntaxCheckerTest.java (added)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierInformationSyntaxCheckerTest.java Wed Dec 20 10:33:28 2006
@@ -0,0 +1,56 @@
+/*
+ *  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.syntax;
+
+import junit.framework.TestCase;
+
+/**
+ * Test cases for SupplierInformationSyntaxChecker.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class SupplierInformationSyntaxCheckerTest extends TestCase
+{
+    SupplierInformationSyntaxChecker checker = new SupplierInformationSyntaxChecker();
+
+
+    public void testNullString()
+    {
+        assertTrue( checker.isValidSyntax( null ) );
+    }
+
+
+    public void testEmptyString()
+    {
+        assertTrue( checker.isValidSyntax( "" ) );
+    }
+
+    public void testOid()
+    {
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.46", checker.getSyntaxOid() );
+    }
+
+    public void testCorrectCase()
+    {
+        assertTrue( checker.isValidSyntax( "FALSE" ) );
+        assertTrue( checker.isValidSyntax( new byte[]{0x01, (byte)0xFF} ) );
+    }
+}

Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierOrConsumerSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierOrConsumerSyntaxCheckerTest.java?view=auto&rev=489167
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierOrConsumerSyntaxCheckerTest.java (added)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SupplierOrConsumerSyntaxCheckerTest.java Wed Dec 20 10:33:28 2006
@@ -0,0 +1,56 @@
+/*
+ *  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.syntax;
+
+import junit.framework.TestCase;
+
+/**
+ * Test cases for SupplierOrConsumerSyntaxChecker.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class SupplierOrConsumerSyntaxCheckerTest extends TestCase
+{
+    SupplierOrConsumerSyntaxChecker checker = new SupplierOrConsumerSyntaxChecker();
+
+
+    public void testNullString()
+    {
+        assertTrue( checker.isValidSyntax( null ) );
+    }
+
+
+    public void testEmptyString()
+    {
+        assertTrue( checker.isValidSyntax( "" ) );
+    }
+
+    public void testOid()
+    {
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.47", checker.getSyntaxOid() );
+    }
+
+    public void testCorrectCase()
+    {
+        assertTrue( checker.isValidSyntax( "FALSE" ) );
+        assertTrue( checker.isValidSyntax( new byte[]{0x01, (byte)0xFF} ) );
+    }
+}