directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r798550 [5/5] - in /directory: apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-jndi/src/main/java/org/apache...
Date Tue, 28 Jul 2009 14:54:05 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
Tue Jul 28 14:54:01 2009
@@ -162,7 +162,7 @@
         ClientStringValue csv = new ClientStringValue( "" );
         
         assertNotNull( csv.get() );
-        assertEquals( "", csv.get() );
+        assertEquals( "", csv.getString() );
         assertFalse( csv.isNormalized() );
         assertTrue( csv.isValid( new Ia5StringSyntaxChecker() ) );
         assertFalse( csv.isNull() );
@@ -482,10 +482,10 @@
         
         assertNotSame( csv, csv1 );
         assertNull( csv1.get() );
-        assertEquals( "", csv.get() );
+        assertEquals( "", csv.getString() );
         
         csv.set(  "  This is    a   TEST  " );
-        csv1 = (ClientStringValue)csv.clone();
+        csv1 = csv.clone();
         
         assertEquals( csv, csv1 );
         

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
Tue Jul 28 14:54:01 2009
@@ -277,7 +277,7 @@
         EntryAttribute attr1 = new DefaultClientAttribute( "test" );
         
         attr1.add( (String)null );
-        assertNull( attr1.getString() );
+        assertEquals( "", attr1.getString() );
 
         EntryAttribute attr2 = new DefaultClientAttribute( "test" );
         
@@ -466,7 +466,7 @@
         for ( Value<?> val:attr )
         {
             assertTrue( val instanceof ClientStringValue );
-            assertEquals( values[pos++], val.get() );
+            assertEquals( values[pos++], val.getString() );
         }
     }
 
@@ -641,7 +641,7 @@
         int nbAdded = attr1.add( (byte[])null );
         assertEquals( 1, nbAdded );
         assertFalse( attr1.isHR() );
-        assertTrue( Arrays.equals( NULL_BINARY_VALUE.get(), attr1.getBytes() ) );
+        assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
         
         EntryAttribute attr2 = new DefaultClientAttribute( "test" );
         
@@ -882,13 +882,13 @@
         EntryAttribute attr2 = new DefaultClientAttribute( "test" );
         
         attr2.add( "a", "b", "c" );
-        assertEquals( "a", attr2.get().get() );
+        assertEquals( "a", attr2.get().getString() );
         
         attr2.remove( "a" );
-        assertEquals( "b", attr2.get().get() );
+        assertEquals( "b", attr2.get().getString() );
 
         attr2.remove( "b" );
-        assertEquals( "c", attr2.get().get() );
+        assertEquals( "c", attr2.get().getString() );
 
         attr2.remove( "c" );
         assertNull( attr2.get() );
@@ -896,13 +896,13 @@
         EntryAttribute attr3 = new DefaultClientAttribute( "test" );
         
         attr3.add( BYTES1, BYTES2, BYTES3 );
-        assertTrue( Arrays.equals( BYTES1, (byte[])attr3.get().get() ) );
+        assertTrue( Arrays.equals( BYTES1, attr3.get().getBytes() ) );
         
         attr3.remove( BYTES1 );
-        assertTrue( Arrays.equals( BYTES2, (byte[])attr3.get().get() ) );
+        assertTrue( Arrays.equals( BYTES2, attr3.get().getBytes() ) );
 
         attr3.remove( BYTES2 );
-        assertTrue( Arrays.equals( BYTES3, (byte[])attr3.get().get() ) );
+        assertTrue( Arrays.equals( BYTES3, attr3.get().getBytes() ) );
 
         attr3.remove( BYTES3 );
         assertNull( attr2.get() );
@@ -934,9 +934,9 @@
         attr.add(  "a", "b", "c" );
         iterator = attr.getAll(); 
         assertTrue( iterator.hasNext() );
-        assertEquals( "a", iterator.next().get() );
-        assertEquals( "b", iterator.next().get() );
-        assertEquals( "c", iterator.next().get() );
+        assertEquals( "a", iterator.next().getString() );
+        assertEquals( "b", iterator.next().getString() );
+        assertEquals( "c", iterator.next().getString() );
         assertFalse( iterator.hasNext() );
     }
 
@@ -1185,7 +1185,7 @@
         int nbAdded = attr1.put( (byte[])null );
         assertEquals( 1, nbAdded );
         assertFalse( attr1.isHR() );
-        assertTrue( Arrays.equals( NULL_BINARY_VALUE.get(), attr1.getBytes() ) );
+        assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
         
         EntryAttribute attr2 = new DefaultClientAttribute( "test" );
         
@@ -1602,7 +1602,7 @@
         assertEquals( dca.toString(), dcaSer.toString() );
         assertEquals( "commonname", dcaSer.getId() );
         assertEquals( "CommonName", dcaSer.getUpId() );
-        assertNull( dcaSer.getString() );
+        assertEquals( "", dcaSer.getString() );
         assertEquals( 1, dcaSer.size() );
         assertTrue( dcaSer.contains( (String)null ) );
         assertTrue( dcaSer.isHR() );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
Tue Jul 28 14:54:01 2009
@@ -1107,7 +1107,7 @@
         assertEquals( 2, entry.get( "cn" ).size() );
         assertTrue( entry.remove( "cn", "test1", "test3" ) );
         assertEquals( 1, entry.get( "cn" ).size() );
-        assertEquals( "test2", entry.get( "cn" ).get().get() );
+        assertEquals( "test2", entry.get( "cn" ).get().getString() );
         
         assertFalse( entry.remove( "cn", "test3" ) );
         assertFalse( entry.remove( "void", "whatever" ) );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterCloneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterCloneTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterCloneTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterCloneTest.java
Tue Jul 28 14:54:01 2009
@@ -48,7 +48,7 @@
         // just check that it doesnt throw for now
         node = (SimpleNode)node.clone();
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", StringTools.utf8ToString( (byte[])node.getValue().get() )
);
+        assertEquals( "people", node.getValue().getString() );
         assertTrue( node instanceof ApproximateNode );
     }
 
@@ -116,7 +116,7 @@
         // just check that it doesnt throw for now
         node = (SimpleNode)node.clone();
         assertEquals( "ou;lang-de", node.getAttribute() );
-        assertEquals( "#Basdl fkajsd", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "#Basdl fkajsd", node.getValue().getString() );
     }
 
 
@@ -128,7 +128,7 @@
         // just check that it doesnt throw for now
         node = (SimpleNode)node.clone();
         assertEquals( "ou;lang-de;version-124", node.getAttribute() );
-        assertEquals( "#Basdl fkajsd", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "#Basdl fkajsd", node.getValue().getString() );
     }
 
 
@@ -140,7 +140,7 @@
         // just check that it doesnt throw for now
         node = (SimpleNode)node.clone();
         assertEquals( "1.3.4.2;lang-de;version-124", node.getAttribute() );
-        assertEquals( "#Basdl fkajsd", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "#Basdl fkajsd", node.getValue().getString() );
     }
 
 
@@ -174,7 +174,7 @@
         // just check that it doesnt throw for now
         node = ( SimpleNode) node.clone();
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", StringTools.utf8ToString( (byte[])node.getValue().get() )
);
+        assertEquals( "people", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
     }
 
@@ -187,7 +187,7 @@
         // just check that it doesnt throw for now
         node = (SimpleNode) node.clone();
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people/in/my/company", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "people/in/my/company", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
     }
 
@@ -199,7 +199,7 @@
         // just check that it doesnt throw for now
         node = ( ExtensibleNode ) node.clone();
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -213,7 +213,7 @@
         // just check that it doesnt throw for now
         node = ( ExtensibleNode )node.clone();
         assertEquals( "1.2.3.4", node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -227,7 +227,7 @@
         // just check that it doesnt throw for now
         node = ( ExtensibleNode ) node.clone();
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -242,7 +242,7 @@
         // just check that it doesnt throw for now
         node = (ExtensibleNode) node.clone();
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( null, node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -256,7 +256,7 @@
         // just check that it doesnt throw for now
         node = ( ExtensibleNode ) node.clone();
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -268,7 +268,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( "(:dn:1.3434.23.2:=dummyAssertion\\23\\2A)"
);
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -282,7 +282,7 @@
         // just check that it doesnt throw for now
         ExtensibleNode node = ( ExtensibleNode )node1.clone();
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -296,7 +296,7 @@
         // just check that it doesnt throw for now
         node = ( ExtensibleNode) node.clone();
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#*", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#*", node.getValue().getString() );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -505,7 +505,7 @@
         node = ( SimpleNode )node.clone();
         
         assertEquals( "ou", node.getAttribute() );
-        assertNull( node.getValue().get() );
+        assertEquals( "", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
     }
 
@@ -521,7 +521,7 @@
         // just check that it doesnt throw for now
         node = ( SimpleNode ) node.clone();
         assertEquals( "uid", node.getAttribute() );
-        assertEquals( "#f1", StringTools.utf8ToString( (byte[])node.getValue().get() ) );
+        assertEquals( "#f1", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
     }
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
Tue Jul 28 14:54:01 2009
@@ -89,7 +89,7 @@
 
         SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", StringTools.utf8ToString( (byte[])node.getValue().get() )
);
+        assertEquals( "people", node.getValue().getString() );
         assertTrue( node instanceof ApproximateNode );
         String str2 = node.toString();
         assertEquals( str, str2 );
@@ -163,7 +163,7 @@
         String str = "(ou;lang-de>=\\23\\42asdl fkajsd)";     // \23 = '#'
         SimpleNode node = ( SimpleNode ) FilterParser.parse( str );
         assertEquals( "ou;lang-de", node.getAttribute() );
-        assertEquals( "#Basdl fkajsd", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "#Basdl fkajsd", node.getValue().getString() );
         String  str2 = node.toString();
         assertEquals( "(ou;lang-de>=#Basdl fkajsd)", str2 );
     }
@@ -176,7 +176,7 @@
         String str = "(ou;lang-de;version-124>=\\23\\42asdl fkajsd)";
         SimpleNode node = ( SimpleNode ) FilterParser.parse( str );
         assertEquals( "ou;lang-de;version-124", node.getAttribute() );
-        assertEquals( "#Basdl fkajsd", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "#Basdl fkajsd", node.getValue().getString() );
         String  str2 = node.toString();
         assertEquals( "(ou;lang-de;version-124>=#Basdl fkajsd)", str2 );
     }
@@ -189,7 +189,7 @@
         String str = "(1.3.4.2;lang-de;version-124>=\\23\\42afdl fkajsd)";
         SimpleNode node = ( SimpleNode ) FilterParser.parse( str );
         assertEquals( "1.3.4.2;lang-de;version-124", node.getAttribute() );
-        assertEquals( "#Bafdl fkajsd", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "#Bafdl fkajsd", node.getValue().getString() );
         String  str2 = node.toString();
         assertEquals( "(1.3.4.2;lang-de;version-124>=#Bafdl fkajsd)", str2 );
     }
@@ -226,7 +226,7 @@
         String str = "(ou=people)";
         SimpleNode node = ( SimpleNode ) FilterParser.parse( str );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", StringTools.utf8ToString( (byte[])node.getValue().get() )
);
+        assertEquals( "people", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
         String  str2 = node.toString();
         assertEquals( str, str2 );
@@ -257,7 +257,7 @@
         String str = "(ou=people/in/my/company)";
         SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people/in/my/company", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "people/in/my/company", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
         String str2 = node.toString();
         assertEquals( str, str2 );
@@ -270,7 +270,7 @@
         String str = "(ou:dn:stupidMatch:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -283,7 +283,7 @@
         String str = "(1.2.3.4:dn:1.3434.23.2:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( "1.2.3.4", node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -296,7 +296,7 @@
         String str = "(ou:stupidMatch:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -324,7 +324,7 @@
         String str = "(ou:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( null, node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -337,7 +337,7 @@
         String str = "(:dn:stupidMatch:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -365,7 +365,7 @@
         String str = "(:dn:1.3434.23.2:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertTrue( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -378,7 +378,7 @@
         String str = "(:stupidMatch:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -391,7 +391,7 @@
         String str = "(:1.3434.23.2:=dummyAssertion\\23\\c4\\8d)";
         ExtensibleNode node = ( ExtensibleNode ) FilterParser.parse( str );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion#\u010D", StringTools.utf8ToString( (byte[])node.getValue().get()
) );
+        assertEquals( "dummyAssertion#\u010D", node.getValue().getString() );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertFalse( node.hasDnAttributes() );
         assertTrue( node instanceof ExtensibleNode );
@@ -737,7 +737,7 @@
             SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
 
             assertEquals( "cn", node.getAttribute() );
-            String val = StringTools.utf8ToString( (byte[])node.getValue().get() );
+            String val = node.getValue().getString();
             assertEquals( "a2", Integer.toHexString( ( int ) val.charAt( 0 ) ) ); // char
is U+00A2
             String str2 = node.toString();
             assertEquals( str, str2 );
@@ -764,7 +764,7 @@
             SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
 
             assertEquals( "cn", node.getAttribute() );
-            String val = StringTools.utf8ToString( (byte[])node.getValue().get() );
+            String val = node.getValue().getString();
             assertEquals( "a2", Integer.toHexString( ( int ) val.charAt( 0 ) ) ); // char
is U+00A2
             String str2 = node.toString();
             assertEquals( str, str2 );
@@ -790,7 +790,7 @@
             SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
 
             assertEquals( "cn", node.getAttribute() );
-            String val = StringTools.utf8ToString( (byte[])node.getValue().get() );
+            String val = node.getValue().getString();
             assertEquals( "2260", Integer.toHexString( ( int ) val.charAt( 0 ) ) );
             String str2 = node.toString();
             assertEquals( str, str2 );
@@ -817,7 +817,7 @@
             SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
 
             assertEquals( "cn", node.getAttribute() );
-            String val = StringTools.utf8ToString( (byte[])node.getValue().get() );
+            String val = node.getValue().getString();
             assertEquals( "2260", Integer.toHexString( ( int ) val.charAt( 0 ) ) );
             String str2 = node.toString();
             assertEquals( str, str2 );
@@ -843,7 +843,7 @@
             SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
 
             assertEquals( "cn", node.getAttribute() );
-            String val = StringTools.utf8ToString( (byte[])node.getValue().get() );
+            String val = node.getValue().getString();
             assertEquals( "3059", Integer.toHexString( ( int ) val.charAt( 0 ) ) );
             String str2 = node.toString();
             assertEquals( str, str2 );
@@ -869,7 +869,7 @@
 
             SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
             assertEquals( "cn", node.getAttribute() );
-            String val = StringTools.utf8ToString( (byte[])node.getValue().get() );
+            String val = node.getValue().getString();
             assertEquals( "3059", Integer.toHexString( val.charAt( 0 ) ) );
             String str2 = node.toString();
             assertEquals( str, str2 );
@@ -891,7 +891,7 @@
         String str = "(uid=#f1)";
         SimpleNode<?> node = ( SimpleNode<?> ) FilterParser.parse( str );
         assertEquals( "uid", node.getAttribute() );
-        assertEquals( "#f1", StringTools.utf8ToString( (byte[])node.getValue().get() ) );
+        assertEquals( "#f1", node.getValue().getString() );
         assertTrue( node instanceof EqualityNode );
         assertEquals( str, node.toString() );
     }
@@ -934,7 +934,7 @@
             ExprNode aEqb = node.getFirstChild();
             assertTrue( aEqb instanceof EqualityNode );
             assertEquals( "objectClass", ((EqualityNode<?>)aEqb).getAttribute() );
-            assertEquals( "nisNetgroup", StringTools.utf8ToString((byte[])((EqualityNode<?>)aEqb).getValue().get()
) );
+            assertEquals( "nisNetgroup", ((EqualityNode<?>)aEqb).getValue().getString()
);
             
             // Check the or node
             ExprNode orNode = node.getChildren().get( 1 );
@@ -985,7 +985,7 @@
         String str = "(cn='~%\\28'$'\\5C)"; // note \28='(' and \5c='\'
         ExprNode node = FilterParser.parse( str );
         assertTrue( node instanceof EqualityNode );
-        assertEquals( "'~%('$'\\", StringTools.utf8ToString( (byte[]) ( ( EqualityNode<?>
) node ).getValue().get() ) );
+        assertEquals( "'~%('$'\\", ( ( EqualityNode<?> ) node ).getValue().getString()
);
         String str2 = node.toString();
         assertEquals( str, str2 );
     }
@@ -998,7 +998,7 @@
         String str = "(cn='~%\\28'$'\\5Cac)"; // note \28='(' and \5c='\'
         ExprNode node = FilterParser.parse( str );
         assertTrue( node instanceof EqualityNode );
-        assertEquals( "'~%('$'\\ac", StringTools.utf8ToString( (byte[])( ( EqualityNode<?>
) node ).getValue().get() ) );
+        assertEquals( "'~%('$'\\ac", (( EqualityNode<?> )node).getValue().getString()
);
         String str2 = node.toString();
         assertEquals( str.toUpperCase(), str2.toUpperCase() );
     }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java
Tue Jul 28 14:54:01 2009
@@ -69,7 +69,7 @@
     {
         try
         {
-            new AttributeTypeAndValue( null, null, null, null );
+            new AttributeTypeAndValue( null, null, (String)null, (String)null );
             fail();
         }
         catch ( InvalidNameException ine )
@@ -87,7 +87,7 @@
     {
         try
         {
-            new AttributeTypeAndValue( "  ", " ", null, null );
+            new AttributeTypeAndValue( "  ", " ", (String)null, (String)null );
             fail();
         }
         catch ( InvalidNameException ine )
@@ -103,19 +103,19 @@
     @Test
     public void testAttributeTypeAndValueValidType() throws InvalidNameException
     {
-        AttributeTypeAndValue atav = new AttributeTypeAndValue( "A", "a", null, null );
+        AttributeTypeAndValue atav = new AttributeTypeAndValue( "A", "a", (String)null, (String)null
);
         assertEquals( "a=", atav.toString() );
         assertEquals( "A=", atav.getUpName() );
         
-        atav = new AttributeTypeAndValue( "  A  ", "a", null, null );
+        atav = new AttributeTypeAndValue( "  A  ", "a", (String)null, (String)null );
         assertEquals( "a=", atav.toString() );
         assertEquals( "  A  =", atav.getUpName() );
         
-        atav = new AttributeTypeAndValue( "  A  ", null, null, null );
+        atav = new AttributeTypeAndValue( "  A  ", null, (String)null, (String)null );
         assertEquals( "a=", atav.toString() );
         assertEquals( "  A  =", atav.getUpName() );
         
-        atav = new AttributeTypeAndValue( null, "a", null, null );
+        atav = new AttributeTypeAndValue( null, "a", (String)null, (String)null );
         assertEquals( "a=", atav.toString() );
         assertEquals( "a=", atav.getUpName() );
         
@@ -159,8 +159,8 @@
     @Test
     public void testCompareToEquals() throws InvalidNameException
     {
-        AttributeTypeAndValue atav1 = new AttributeTypeAndValue( "a", "a", "b", "b" );
-        AttributeTypeAndValue atav2 = new AttributeTypeAndValue( "a", "a", "b", "b" );
+        AttributeTypeAndValue atav1 = new AttributeTypeAndValue( "a", "a","b", "b" );
+        AttributeTypeAndValue atav2 = new AttributeTypeAndValue( "a", "a","b", "b" );
 
         assertEquals( 0, atav1.compareTo( atav2 ) );
     }
@@ -187,6 +187,7 @@
     public void testCompareAtav1TypeSuperior() throws InvalidNameException
     {
         AttributeTypeAndValue atav1 = new AttributeTypeAndValue( "b", "b", "b", "b" );
+            
         AttributeTypeAndValue atav2 = new AttributeTypeAndValue( "a", "a", "b", "b" );
 
         assertEquals( 1, atav1.compareTo( atav2 ) );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Tue Jul 28 14:54:01 2009
@@ -3235,37 +3235,37 @@
         assertEquals( " cn = Amos\\,Tori ", dn1.getRdn().getUpName() );
         AttributeTypeAndValue atav1 = dn1.getRdn().getAtav();
         assertEquals( "cn", atav1.getUpType() );
-        assertEquals( "Amos\\,Tori", ( String ) atav1.getUpValue() );
+        assertEquals( "Amos\\,Tori", atav1.getUpValue().getString() );
 
         // antlr parser: hexstring with trailing spaces
         LdapDN dn3 = new LdapDN( " cn = #414243 , ou=system " );
         assertEquals( " cn = #414243 ", dn3.getRdn().getUpName() );
         AttributeTypeAndValue atav3 = dn3.getRdn().getAtav();
         assertEquals( "cn", atav3.getUpType() );
-        assertEquals( "#414243", ( String ) atav3.getUpValue() );
-        assertTrue( Arrays.equals( StringTools.getBytesUtf8( "ABC" ), ( byte[] ) atav3.getNormValue()
) );
+        assertEquals( "#414243", atav3.getUpValue().getString() );
+        assertTrue( Arrays.equals( StringTools.getBytesUtf8( "ABC" ),atav3.getNormValue().getBytes()
) );
 
         // antlr parser: 
         LdapDN dn4 = new LdapDN( " cn = \\41\\42\\43 , ou=system " );
         assertEquals( " cn = \\41\\42\\43 ", dn4.getRdn().getUpName() );
         AttributeTypeAndValue atav4 = dn4.getRdn().getAtav();
         assertEquals( "cn", atav4.getUpType() );
-        assertEquals( "\\41\\42\\43", ( String ) atav4.getUpValue() );
-        assertEquals( "ABC", ( String ) atav4.getNormValue() );
+        assertEquals( "\\41\\42\\43", atav4.getUpValue().getString() );
+        assertEquals( "ABC", atav4.getNormValue().getString() );
 
         // antlr parser: quotestring with trailing spaces
         LdapDN dn5 = new LdapDN( " cn = \"ABC\" , ou=system " );
         assertEquals( " cn = \"ABC\" ", dn5.getRdn().getUpName() );
         AttributeTypeAndValue atav5 = dn5.getRdn().getAtav();
         assertEquals( "cn", atav5.getUpType() );
-        assertEquals( "\"ABC\"", ( String ) atav5.getUpValue() );
-        assertEquals( "ABC", ( String ) atav5.getNormValue() );
+        assertEquals( "\"ABC\"", atav5.getUpValue().getString() );
+        assertEquals( "ABC", atav5.getNormValue().getString() );
 
         // fast parser: string value with trailing spaces 
         LdapDN dn2 = new LdapDN( " cn = Amos Tori , ou=system " );
         assertEquals( " cn = Amos Tori ", dn2.getRdn().getUpName() );
         AttributeTypeAndValue atav2 = dn2.getRdn().getAtav();
         assertEquals( "cn", atav2.getUpType() );
-        assertEquals( "Amos Tori", ( String ) atav2.getUpValue() );
+        assertEquals( "Amos Tori", atav2.getUpValue().getString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/BooleanNormalizerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/BooleanNormalizerTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/BooleanNormalizerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/BooleanNormalizerTest.java
Tue Jul 28 14:54:01 2009
@@ -20,6 +20,8 @@
 package org.apache.directory.shared.ldap.schema;
 
 
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
 import org.apache.directory.shared.ldap.schema.normalizers.BooleanNormalizer;
 import org.junit.Test;
 import static org.junit.Assert.*;
@@ -40,7 +42,7 @@
     @Test
     public void testNormalizeNullValue() throws Exception
     {
-        assertNull( normalizer.normalize( null ) );
+        assertNull( normalizer.normalize( (Value<?>)null ) );
     }
 
 
@@ -63,8 +65,8 @@
     @Test
     public void testNormalizeByteValue() throws Exception
     {
-        assertEquals( "TRUE", normalizer.normalize( "tRuE".getBytes() ) );
-        assertEquals( "TRUE", normalizer.normalize( "true".getBytes() ) );
+        assertEquals( "TRUE", normalizer.normalize( new ClientBinaryValue( "tRuE".getBytes()
) ).getString() );
+        assertEquals( "TRUE", normalizer.normalize( new ClientBinaryValue( "true".getBytes()
) ).getString() );
     }
 
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/AttributeUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/AttributeUtilsTest.java?rev=798550&r1=798549&r2=798550&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/AttributeUtilsTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/AttributeUtilsTest.java
Tue Jul 28 14:54:01 2009
@@ -110,7 +110,7 @@
         
         for ( Value<?> value:attribute )
         {
-            String valueStr = (String)value.get();
+            String valueStr = value.getString();
             
             assertTrue( expectedValues.contains( valueStr ) );
             
@@ -148,7 +148,7 @@
         
         for ( Value<?> value:cnAttr )
         {
-            String valueStr = (String)value.get();
+            String valueStr = value.getString();
             
             assertTrue( expectedValues.contains( valueStr ) );
             
@@ -278,7 +278,7 @@
             assertTrue( isFirst );
             
             isFirst = false;
-            assertEquals( "apache", value.get() );
+            assertEquals( "apache", value.getString() );
         }
     }
     
@@ -360,7 +360,7 @@
 
         for ( Value<?> value:modifiedAttr )
         {
-            String valueStr = (String)value.get();
+            String valueStr = value.getString();
             
             assertTrue( expectedValues.contains( valueStr ) );
             



Mime
View raw message