directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r655116 [2/2] - in /directory/sandbox/akarasulu/bigbang/shared: ./ asn1-codec/ asn1/ bouncycastle-reduced/ convert/ ldap-constants/ ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/ ldap-jndi/ ldap/ ldap/src/main/antl...
Date Sat, 10 May 2008 15:38:31 GMT
Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
Sat May 10 08:38:30 2008
@@ -449,15 +449,15 @@
     {
         ClientStringValue csv = new ClientStringValue();
         
-        assertEquals( "'null'", csv.toString() );
+        assertEquals( "null", csv.toString() );
 
         csv.set( "" );
-        assertEquals( "''", csv.toString() );
+        assertEquals( "", csv.toString() );
 
         csv.set( "Test" );
-        assertEquals( "'Test'", csv.toString() );
+        assertEquals( "Test", csv.toString() );
         
         csv.clear();
-        assertEquals( "'null'", csv.toString() );
+        assertEquals( "null", csv.toString() );
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
Sat May 10 08:38:30 2008
@@ -1299,10 +1299,10 @@
         assertEquals( "    test: (null)\n", attr1.toString() );
         
         attr1.add( "a" );
-        assertEquals( "    test: 'a'\n", attr1.toString() );
+        assertEquals( "    test: a\n", attr1.toString() );
         
         attr1.add( "b" );
-        assertEquals( "    test: 'a'\n    test: 'b'\n", attr1.toString() );
+        assertEquals( "    test: a\n    test: b\n", attr1.toString() );
 
         EntryAttribute attr2 = new DefaultClientAttribute( "test" );
 

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
Sat May 10 08:38:30 2008
@@ -1146,8 +1146,8 @@
         String expected = 
             "ClientEntry\n" +
             "    dn: dc=example,dc=com\n" +
-            "    ObjectClass: 'top'\n" +
-            "    ObjectClass: 'person'\n" +
+            "    ObjectClass: top\n" +
+            "    ObjectClass: person\n" +
             "    ObjectClass: ''\n" +
             "    UserPassword: '0x61 0x62 '\n" +
             "    UserPassword: '0x62 '\n" +

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java
Sat May 10 08:38:30 2008
@@ -20,6 +20,8 @@
 package org.apache.directory.shared.ldap.filter;
 
 
+import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+
 import junit.framework.TestCase;
 
 
@@ -29,99 +31,92 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 575783 $
  */
-public class FilterNodeEqualityTest extends TestCase 
+public class FilterNodeEqualityTest extends TestCase
 {
-	public void testEqualityEquals()
-	{
-		EqualityNode eqNode1 = new EqualityNode( "attr1", "test" ); 
-		EqualityNode eqNode2 = new EqualityNode( "attr1", "test" );
-		
-		assertEquals( "two exact nodes should be equal", eqNode1, eqNode2 );
-		
-		eqNode2 = new EqualityNode( "attr2", "test" );
-		assertFalse( "different attribute in node should return false on equals()", 
-				eqNode1.equals( eqNode2 ) );
-		
-		eqNode2 = new EqualityNode( "attr2", "foobar" );
-		assertFalse( "different value in node should return false on equals()", 
-				eqNode1.equals( eqNode2 ) );
-		
-		PresenceNode presenceNode = new PresenceNode( "attr1" );
-		assertFalse( "two different leaf nodes should not be equal", eqNode1.equals( presenceNode
) );
-		assertFalse( "two different leaf nodes should not be equal", presenceNode.equals( eqNode1
) );
-		
-		GreaterEqNode greaterEqNode = new GreaterEqNode ( "attr1", "test" );
-		assertFalse( "two different simple nodes should not be equal", eqNode1.equals( greaterEqNode
) );
-		assertFalse( "two different simple nodes should not be equal", greaterEqNode.equals( eqNode1
) );
-	}
-
-
-	public void testGreaterEqEquals()
-	{
-		GreaterEqNode greaterEqNode1 = new GreaterEqNode( "attr1", "test" ); 
-		GreaterEqNode greaterEqNode2 = new GreaterEqNode( "attr1", "test" );
-		
-		assertEquals( "two exact nodes should be equal", greaterEqNode1, greaterEqNode2 );
-		
-		greaterEqNode2 = new GreaterEqNode( "attr2", "test" );
-		assertFalse( "different attribute in node should return false on equals()", 
-				greaterEqNode1.equals( greaterEqNode2 ) );
-		
-		greaterEqNode2 = new GreaterEqNode( "attr2", "foobar" );
-		assertFalse( "different value in node should return false on equals()", 
-				greaterEqNode1.equals( greaterEqNode2 ) );
-	}
-
-
-	public void testLessEqEquals()
-	{
-		LessEqNode lessEqNode1 = new LessEqNode( "attr1", "test" ); 
-		LessEqNode lessEqNode2 = new LessEqNode( "attr1", "test" );
-		
-		assertEquals( "two exact nodes should be equal", lessEqNode1, lessEqNode2 );
-		
-		lessEqNode2 = new LessEqNode( "attr2", "test" );
-		assertFalse( "different attribute in node should return false on equals()", 
-				lessEqNode1.equals( lessEqNode2 ) );
-		
-		lessEqNode2 = new LessEqNode( "attr2", "foobar" );
-		assertFalse( "different value in node should return false on equals()", 
-				lessEqNode1.equals( lessEqNode2 ) );
-	}
-
-
-	public void testApproximateEqEquals()
-	{
-		ApproximateNode approximateNode1 = new ApproximateNode( "attr1", "test" ); 
-		ApproximateNode approximateNode2 = new ApproximateNode( "attr1", "test" );
-		
-		assertEquals( "two exact nodes should be equal", approximateNode1, approximateNode2 );
-		
-		approximateNode2 = new ApproximateNode( "attr2", "test" );
-		assertFalse( "different attribute in node should return false on equals()", 
-				approximateNode1.equals( approximateNode2 ) );
-		
-		approximateNode2 = new ApproximateNode( "attr2", "foobar" );
-		assertFalse( "different value in node should return false on equals()", 
-				approximateNode1.equals( approximateNode2 ) );
-	}
-	
-	
-	public void testPresenceEquals()
-	{
-		PresenceNode presenceNode1 = new PresenceNode( "attr1" );
-		PresenceNode presenceNode2 = new PresenceNode( "attr1" );
-		
-		assertEquals( "two exact presence nodes on same attribute should be equal", 
-				presenceNode1, presenceNode2 );
-		
-		presenceNode2 = new PresenceNode( "attr2" );
-		assertFalse( "presence nodes on different attributes should not be equal", 
-				presenceNode1.equals( presenceNode2 ) );
-	}
-	
-	
-	public void testSubstringEquals()
-	{
-	}
+    public void testEqualityEquals()
+    {
+        EqualityNode eqNode1 = new EqualityNode( "attr1", new ClientStringValue( "test" )
);
+        EqualityNode eqNode2 = new EqualityNode( "attr1", new ClientStringValue( "test" )
);
+
+        assertEquals( "two exact nodes should be equal", eqNode1, eqNode2 );
+
+        eqNode2 = new EqualityNode( "attr2", new ClientStringValue( "test" ) );
+        assertFalse( "different attribute in node should return false on equals()", eqNode1.equals(
eqNode2 ) );
+
+        eqNode2 = new EqualityNode( "attr2", new ClientStringValue( "foobar" ) );
+        assertFalse( "different value in node should return false on equals()", eqNode1.equals(
eqNode2 ) );
+
+        PresenceNode presenceNode = new PresenceNode( "attr1" );
+        assertFalse( "two different leaf nodes should not be equal", eqNode1.equals( presenceNode
) );
+        assertFalse( "two different leaf nodes should not be equal", presenceNode.equals(
eqNode1 ) );
+
+        GreaterEqNode greaterEqNode = new GreaterEqNode( "attr1", new ClientStringValue(
"test" ) );
+        assertFalse( "two different simple nodes should not be equal", eqNode1.equals( greaterEqNode
) );
+        assertFalse( "two different simple nodes should not be equal", greaterEqNode.equals(
eqNode1 ) );
+    }
+
+
+    public void testGreaterEqEquals()
+    {
+        GreaterEqNode greaterEqNode1 = new GreaterEqNode( "attr1", new ClientStringValue(
"test" ) );
+        GreaterEqNode greaterEqNode2 = new GreaterEqNode( "attr1", new ClientStringValue(
"test" ) );
+
+        assertEquals( "two exact nodes should be equal", greaterEqNode1, greaterEqNode2 );
+
+        greaterEqNode2 = new GreaterEqNode( "attr2", new ClientStringValue( "test" ) );
+        assertFalse( "different attribute in node should return false on equals()", greaterEqNode1
+            .equals( greaterEqNode2 ) );
+
+        greaterEqNode2 = new GreaterEqNode( "attr2", new ClientStringValue( "foobar" ) );
+        assertFalse( "different value in node should return false on equals()", greaterEqNode1.equals(
greaterEqNode2 ) );
+    }
+
+
+    public void testLessEqEquals()
+    {
+        LessEqNode lessEqNode1 = new LessEqNode( "attr1", new ClientStringValue( "test" )
);
+        LessEqNode lessEqNode2 = new LessEqNode( "attr1", new ClientStringValue( "test" )
);
+
+        assertEquals( "two exact nodes should be equal", lessEqNode1, lessEqNode2 );
+
+        lessEqNode2 = new LessEqNode( "attr2", new ClientStringValue( "test" ) );
+        assertFalse( "different attribute in node should return false on equals()", lessEqNode1.equals(
lessEqNode2 ) );
+
+        lessEqNode2 = new LessEqNode( "attr2", new ClientStringValue( "foobar" ) );
+        assertFalse( "different value in node should return false on equals()", lessEqNode1.equals(
lessEqNode2 ) );
+    }
+
+
+    public void testApproximateEqEquals()
+    {
+        ApproximateNode approximateNode1 = new ApproximateNode( "attr1", new ClientStringValue(
"test" ) );
+        ApproximateNode approximateNode2 = new ApproximateNode( "attr1", new ClientStringValue(
"test" ) );
+
+        assertEquals( "two exact nodes should be equal", approximateNode1, approximateNode2
);
+
+        approximateNode2 = new ApproximateNode( "attr2", new ClientStringValue( "test" )
);
+        assertFalse( "different attribute in node should return false on equals()", approximateNode1
+            .equals( approximateNode2 ) );
+
+        approximateNode2 = new ApproximateNode( "attr2", new ClientStringValue( "foobar"
) );
+        assertFalse( "different value in node should return false on equals()", approximateNode1
+            .equals( approximateNode2 ) );
+    }
+
+
+    public void testPresenceEquals()
+    {
+        PresenceNode presenceNode1 = new PresenceNode( "attr1" );
+        PresenceNode presenceNode2 = new PresenceNode( "attr1" );
+
+        assertEquals( "two exact presence nodes on same attribute should be equal", presenceNode1,
presenceNode2 );
+
+        presenceNode2 = new PresenceNode( "attr2" );
+        assertFalse( "presence nodes on different attributes should not be equal", presenceNode1.equals(
presenceNode2 ) );
+    }
+
+
+    public void testSubstringEquals()
+    {
+    }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
Sat May 10 08:38:30 2008
@@ -83,7 +83,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(ou~=people)" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", node.getValue() );
+        assertEquals( "people", node.getValue().get() );
         assertTrue( node instanceof ApproximateNode );
     }
 
@@ -138,7 +138,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(ou;lang-de>=\\23\\42asdl
fkajsd)" );
         assertEquals( "ou;lang-de", node.getAttribute() );
-        assertEquals( "\\23\\42asdl fkajsd", node.getValue() );
+        assertEquals( "\\23\\42asdl fkajsd", node.getValue().get() );
     }
 
 
@@ -147,7 +147,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(ou;lang-de;version-124>=\\23\\42asdl
fkajsd)" );
         assertEquals( "ou;lang-de;version-124", node.getAttribute() );
-        assertEquals( "\\23\\42asdl fkajsd", node.getValue() );
+        assertEquals( "\\23\\42asdl fkajsd", node.getValue().get() );
     }
 
 
@@ -156,7 +156,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(1.3.4.2;lang-de;version-124>=\\23\\42asdl
fkajsd)" );
         assertEquals( "1.3.4.2;lang-de;version-124", node.getAttribute() );
-        assertEquals( "\\23\\42asdl fkajsd", node.getValue() );
+        assertEquals( "\\23\\42asdl fkajsd", node.getValue().get() );
     }
 
 
@@ -183,7 +183,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(ou=people)" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", node.getValue() );
+        assertEquals( "people", node.getValue().get() );
         assertTrue( node instanceof EqualityNode );
     }
 
@@ -210,7 +210,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(ou=people/in/my/company)"
);
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people/in/my/company", node.getValue() );
+        assertEquals( "people/in/my/company", node.getValue().get() );
         assertTrue( node instanceof EqualityNode );
     }
 
@@ -638,7 +638,7 @@
     {
         SimpleNode node = ( SimpleNode ) FilterParser.parse( "(ou=)" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "", node.getValue() );
+        assertEquals( "", node.getValue().get() );
         assertTrue( node instanceof EqualityNode );
     }
 

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Sat May 10 08:38:30 2008
@@ -1271,7 +1271,7 @@
            dn.get( 4 );
            fail();
        }
-       catch ( ArrayIndexOutOfBoundsException aioob )
+       catch ( IndexOutOfBoundsException aioob )
        {
            assertTrue( true );
        }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
Sat May 10 08:38:30 2008
@@ -356,6 +356,29 @@
 
 
     /**
+     * Test for DIRSHARED-2.
+     * The first ATAV is equal, the second or following ATAV differs.
+     */
+    @Test
+    public void test_DIRSHARED_2() throws InvalidNameException
+    {
+        // the second ATAV differs
+        Rdn rdn1 = new Rdn( " a = b + c = d " );
+        Rdn rdn2 = new Rdn( " a = b + c = y " );
+        assertTrue( rdn1.compareTo( rdn2 ) != 0 );
+
+        // the third ATAV differs
+        Rdn rdn3 = new Rdn( " a = b + c = d + e = f " );
+        Rdn rdn4 = new Rdn( " a = b + c = d + e = y " );
+        assertTrue( rdn3.compareTo( rdn4 ) != 0 );
+
+        // the second ATAV differs in value only
+        Rdn rdn5 = new Rdn( " a = b + a = c " );
+        Rdn rdn6 = new Rdn( " a = b + a = y " );
+        assertTrue( rdn5.compareTo( rdn6 ) != 0 );
+    }
+    
+    /**
      * Compares with a null RDN.
      */
     @Test

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
Sat May 10 08:38:30 2008
@@ -27,6 +27,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.filter.AndNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -276,16 +277,16 @@
     {
         SubtreeSpecification ss = parser.parse( SPEC_WITH_REFINEMENT );
 
-        SimpleNode n1 = new EqualityNode( "objectClass", "1.2.3" );
-        SimpleNode n2 = new EqualityNode( "objectClass", "4.5.6" );
-        SimpleNode n3 = new EqualityNode( "objectClass", "person-7" );
+        SimpleNode n1 = new EqualityNode( "objectClass", new ClientStringValue( "1.2.3" )
);
+        SimpleNode n2 = new EqualityNode( "objectClass", new ClientStringValue( "4.5.6" )
);
+        SimpleNode n3 = new EqualityNode( "objectClass", new ClientStringValue( "person-7"
) );
         BranchNode n4 = new OrNode();
         n4.addNode( n2 );
         n4.addNode( n3 );
         BranchNode n5 = new AndNode();
         n5.addNode( n1 );
         n5.addNode( n4 );
-        SimpleNode n6 = new EqualityNode( "objectClass", "10.11.12" );
+        SimpleNode n6 = new EqualityNode( "objectClass", new ClientStringValue( "10.11.12"
) );
         BranchNode n7 = new NotNode();
         n7.addNode( n6 );
         BranchNode n8 = new AndNode();

Modified: directory/sandbox/akarasulu/bigbang/shared/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/pom.xml?rev=655116&r1=655115&r2=655116&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/pom.xml Sat May 10 08:38:30 2008
@@ -27,7 +27,7 @@
   <artifactId>shared-parent</artifactId>
   <name>Apache Directory Shared</name>
   <packaging>pom</packaging>
-  <version>0.9.11-SNAPSHOT</version>
+  <version>0.9.12-SNAPSHOT</version>
 
   <properties>
     <projectName>ApacheDS-Shared</projectName>



Mime
View raw message