directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r806827 - in /directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser: ComparatorDescriptionSchemaParserTest.java SyntaxCheckerDescriptionSchemaParserTest.java
Date Sat, 22 Aug 2009 09:58:53 GMT
Author: elecharny
Date: Sat Aug 22 09:58:53 2009
New Revision: 806827

URL: http://svn.apache.org/viewvc?rev=806827&view=rev
Log:
Fixed tests for C and SC

Modified:
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java?rev=806827&r1=806826&r2=806827&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
Sat Aug 22 09:58:53 2009
@@ -22,8 +22,8 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.parsers.ComparatorDescriptionSchemaParser;
+import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -74,13 +74,13 @@
     public void testFqcn() throws ParseException
     {
         String value = null;
-        LdapComparator<?> lc = null;
+        LdapComparatorDescription ldapComparatorDescription = null;
 
         // FQCN simple
         value = "( 1.1 FQCN org.apache.directory.SimpleComparator )";
-        lc = parser.parseComparatorDescription( value );
-        assertNotNull( lc.getFqcn() );
-        assertEquals( "org.apache.directory.SimpleComparator", lc.getFqcn() );
+        ldapComparatorDescription = parser.parseComparatorDescription( value );
+        assertNotNull( ldapComparatorDescription.getFqcn() );
+        assertEquals( "org.apache.directory.SimpleComparator", ldapComparatorDescription.getFqcn()
);
     }
 
 
@@ -88,25 +88,28 @@
     public void testBytecode() throws ParseException
     {
         String value = null;
-        LdapComparator<?> lc= null;
+        LdapComparatorDescription ldapComparatorDescription = null;
 
         // FQCN simple p
         value = "( 1.1 FQCN org.apache.directory.SimpleComparator BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====
)";
-        lc = parser.parseComparatorDescription( value );
-        assertNotNull( lc.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",
lc.getBytecode() );
+        ldapComparatorDescription = parser.parseComparatorDescription( value );
+        assertNotNull( ldapComparatorDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",

+        		ldapComparatorDescription.getBytecode() );
 
         // FQCN simple, no spaces
         value = "(1.1 FQCNorg.apache.directory.SimpleComparator BYTECODEABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====)";
-        lc = parser.parseComparatorDescription( value );
-        assertNotNull( lc.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",
lc.getBytecode() );
+        ldapComparatorDescription = parser.parseComparatorDescription( value );
+        assertNotNull( ldapComparatorDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",

+        		ldapComparatorDescription.getBytecode() );
 
         // FQCN simple, tabs
         value = "\t(\t1.1\tFQCN\torg.apache.directory.SimpleComparator\tBYTECODE\tABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====\t)\t";
-        lc = parser.parseComparatorDescription( value );
-        assertNotNull( lc.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",
lc.getBytecode() );
+        ldapComparatorDescription = parser.parseComparatorDescription( value );
+        assertNotNull( ldapComparatorDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",

+        		ldapComparatorDescription.getBytecode() );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java?rev=806827&r1=806826&r2=806827&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java
Sat Aug 22 09:58:53 2009
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.SyntaxChecker;
+import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -81,13 +81,13 @@
     public void testFqcn() throws ParseException
     {
         String value = null;
-        SyntaxChecker syntaxChecker = null;
+        SyntaxCheckerDescription syntaxCheckerDescription = null;
 
         // FQCN simple p
         value = "( 1.1 FQCN org.apache.directory.SimpleSyntaxChecker )";
-        syntaxChecker = parser.parseSyntaxCheckerDescription( value );
-        assertNotNull( syntaxChecker.getFqcn() );
-        assertEquals( "org.apache.directory.SimpleSyntaxChecker", syntaxChecker.getFqcn()
);
+        syntaxCheckerDescription = parser.parseSyntaxCheckerDescription( value );
+        assertNotNull( syntaxCheckerDescription.getFqcn() );
+        assertEquals( "org.apache.directory.SimpleSyntaxChecker", syntaxCheckerDescription.getFqcn()
);
     }
 
 
@@ -95,13 +95,14 @@
     public void testBytecode() throws ParseException
     {
         String value = null;
-        SyntaxChecker syntaxChecker = null;
+        SyntaxCheckerDescription syntaxCheckerDescription = null;
 
         // FQCN simple p
         value = "( 1.1 FQCN org.apache.directory.SimpleSyntaxChecker BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====
)";
-        syntaxChecker = parser.parseSyntaxCheckerDescription( value );
-        assertNotNull( syntaxChecker.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",
syntaxChecker.getBytecode() );
+        syntaxCheckerDescription = parser.parseSyntaxCheckerDescription( value );
+        assertNotNull( syntaxCheckerDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====",

+        		syntaxCheckerDescription.getBytecode() );
     }
 
 
@@ -147,12 +148,12 @@
     public void testSimpleSyntaxChecker() throws ParseException
     {
         String simple = "( " + OID + " FQCN " + FQCN + " )";
-        SyntaxChecker syntaxChecker = parser.parseSyntaxCheckerDescription( simple );
-        assertNotNull( syntaxChecker );
-        assertEquals( OID, syntaxChecker.getOid() );
-        assertEquals( FQCN, syntaxChecker.getFqcn() );
-        assertNull( syntaxChecker.getBytecode() );
-        assertNull( syntaxChecker.getDescription() );
+        SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(
simple );
+        assertNotNull( syntaxCheckerDescription );
+        assertEquals( OID, syntaxCheckerDescription.getOid() );
+        assertEquals( FQCN, syntaxCheckerDescription.getFqcn() );
+        assertNull( syntaxCheckerDescription.getBytecode() );
+        assertNull( syntaxCheckerDescription.getDescription() );
     }
 
 
@@ -160,12 +161,12 @@
     public void testSyntaxCheckerWithDesc() throws ParseException
     {
         String simple = "( " + OID + " DESC '" + DESC + "' FQCN " + FQCN + " )";
-        SyntaxChecker syntaxChecker = parser.parseSyntaxCheckerDescription( simple );
-        assertNotNull( syntaxChecker );
-        assertEquals( OID, syntaxChecker.getOid() );
-        assertEquals( FQCN, syntaxChecker.getFqcn() );
-        assertNull( syntaxChecker.getBytecode() );
-        assertEquals( DESC, syntaxChecker.getDescription() );
+        SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(
simple );
+        assertNotNull( syntaxCheckerDescription );
+        assertEquals( OID, syntaxCheckerDescription.getOid() );
+        assertEquals( FQCN, syntaxCheckerDescription.getFqcn() );
+        assertNull( syntaxCheckerDescription.getBytecode() );
+        assertEquals( DESC, syntaxCheckerDescription.getDescription() );
     }
 
 
@@ -173,12 +174,12 @@
     public void testSyntaxCheckerWithDescAndByteCode() throws ParseException
     {
         String simple = "( " + OID + " DESC '" + DESC + "' FQCN " + FQCN + " BYTECODE " +
BYTECODE + " )";
-        SyntaxChecker syntaxChecker = parser.parseSyntaxCheckerDescription( simple );
-        assertNotNull( syntaxChecker );
-        assertEquals( OID, syntaxChecker.getOid() );
-        assertEquals( FQCN, syntaxChecker.getFqcn() );
-        assertEquals( BYTECODE, syntaxChecker.getBytecode() );
-        assertEquals( DESC, syntaxChecker.getDescription() );
+        SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(
simple );
+        assertNotNull( syntaxCheckerDescription );
+        assertEquals( OID, syntaxCheckerDescription.getOid() );
+        assertEquals( FQCN, syntaxCheckerDescription.getFqcn() );
+        assertEquals( BYTECODE, syntaxCheckerDescription.getBytecode() );
+        assertEquals( DESC, syntaxCheckerDescription.getDescription() );
     }
 
 
@@ -186,8 +187,8 @@
     public void testSyntaxCheckerExample() throws ParseException
     {
         String simple = "( 1.3.6.1.4.1.18060.0.4.1.0.10000 DESC 'bogus desc' FQCN org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker
)";
-        SyntaxChecker syntaxChecker = parser.parseSyntaxCheckerDescription( simple );
-        assertNotNull( syntaxChecker );
+        SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(
simple );
+        assertNotNull( syntaxCheckerDescription );
     }
 
 
@@ -208,12 +209,12 @@
             + "gAPAAEACgAAAB0AAQABAAAABSq0AAKwAAAAAQALAAAABgABAAAAHQABABAAEQABAAoAAAAaAAEAAgAAAAIErAAA"
             + "AAEACwAAAAYAAQAAACMAAQASABMAAgAKAAAAGQAAAAIAAAABsQAAAAEACwAAAAYAAQAAACkAFAAAAAQAAQAVAAE"
             + "AFgAAAAIAFw== X-SCHEMA 'nis' )";
-        SyntaxChecker syntaxChecker = parser.parseSyntaxCheckerDescription( simple );
-        assertNotNull( syntaxChecker );
-        assertEquals( "1.3.6.1.4.1.18060.0.4.1.0.10002", syntaxChecker.getOid() );
-        assertEquals( "DummySyntaxChecker", syntaxChecker.getFqcn() );
-        assertNotNull( syntaxChecker.getBytecode() );
-        assertEquals( "bogus desc", syntaxChecker.getDescription() );
+        SyntaxCheckerDescription syntaxCheckerDescription = parser.parseSyntaxCheckerDescription(
simple );
+        assertNotNull( syntaxCheckerDescription );
+        assertEquals( "1.3.6.1.4.1.18060.0.4.1.0.10002", syntaxCheckerDescription.getOid()
);
+        assertEquals( "DummySyntaxChecker", syntaxCheckerDescription.getFqcn() );
+        assertNotNull( syntaxCheckerDescription.getBytecode() );
+        assertEquals( "bogus desc", syntaxCheckerDescription.getDescription() );
     }
 
 



Mime
View raw message