directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328744 - /directory/shared/ldap/branches/shared-ldap-utf8/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java
Date Wed, 26 Oct 2005 21:36:02 GMT
Author: elecharny
Date: Wed Oct 26 14:35:57 2005
New Revision: 328744

URL: http://svn.apache.org/viewcvs?rev=328744&view=rev
Log:
Fixed comparizon by transforming byte[] to strings

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java?rev=328744&r1=328743&r2=328744&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java
Wed Oct 26 14:35:57 2005
@@ -20,6 +20,8 @@
 import java.io.IOException;
 import java.text.ParseException;
 
+import org.apache.asn1new.util.StringUtils;
+
 import junit.framework.TestCase;
 
 
@@ -50,7 +52,7 @@
     {
         SimpleNode node = ( SimpleNode ) parser.parse( "( ou ~= people )" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", node.getValue() );
+        assertEquals( "people", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( AbstractExprNode.APPROXIMATE, node.getAssertionType() );
     }
 
@@ -83,7 +85,7 @@
     {
         SimpleNode node = ( SimpleNode ) parser.parse( "( ou;lang-de >= \\23\\42asdl fkajsd
)" );
         assertEquals( "ou;lang-de", node.getAttribute() );
-        assertEquals( "\\23\\42asdl fkajsd", node.getValue() );
+        assertEquals( "\\23\\42asdl fkajsd", StringUtils.toUtf8( node.getValue() ) );
     }
 
 
@@ -91,7 +93,7 @@
     {
         SimpleNode node = ( SimpleNode ) parser.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", StringUtils.toUtf8( node.getValue() ) );
     }
 
 
@@ -99,7 +101,7 @@
     {
         SimpleNode node = ( SimpleNode ) parser.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", StringUtils.toUtf8( node.getValue() ) );
     }
 
 
@@ -159,7 +161,7 @@
     {
         SimpleNode node = ( SimpleNode ) parser.parse( "( ou = people )" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people", node.getValue() );
+        assertEquals( "people", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( AbstractExprNode.EQUALITY, node.getAssertionType() );
     }
 
@@ -168,7 +170,7 @@
     {
         SimpleNode node = ( SimpleNode ) parser.parse( "( ou = people/in/my/company )" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "people/in/my/company", node.getValue() );
+        assertEquals( "people/in/my/company", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( AbstractExprNode.EQUALITY, node.getAssertionType() );
     }
 
@@ -177,7 +179,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( ou :dn :stupidMatch :=
dummyAssertion\\23\\ac )" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertTrue( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -188,7 +190,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( 1.2.3.4 :dn :1.3434.23.2
:= dummyAssertion\\23\\ac )" );
         assertEquals( "1.2.3.4", node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertTrue( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -199,7 +201,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( ou :stupidMatch := dummyAssertion\\23\\ac
)" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -226,7 +228,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( ou := dummyAssertion\\23\\ac
)" );
         assertEquals( "ou", node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( null, node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -237,7 +239,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( 1.2.3.4 :1.3434.23.2 :=
dummyAssertion\\23\\ac )" );
         assertEquals( "1.2.3.4", node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -248,7 +250,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( :dn :stupidMatch := dummyAssertion\\23\\ac
)" );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertTrue( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -275,7 +277,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( :dn :1.3434.23.2 := dummyAssertion\\23\\ac
)" );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertTrue( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -286,7 +288,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( :stupidMatch := dummyAssertion\\23\\ac
)" );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "stupidMatch", node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -297,7 +299,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( :1.3434.23.2 := dummyAssertion\\23\\ac
)" );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( "1.3434.23.2", node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -308,7 +310,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( := dummyAssertion )" );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion", node.getValue() );
+        assertEquals( "dummyAssertion", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( null, node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );
@@ -319,7 +321,7 @@
     {
         ExtensibleNode node = ( ExtensibleNode ) parser.parse( "( := dummyAssertion\\23\\ac
)" );
         assertEquals( null, node.getAttribute() );
-        assertEquals( "dummyAssertion\\23\\ac", node.getValue() );
+        assertEquals( "dummyAssertion\\23\\ac", StringUtils.toUtf8( node.getValue() ) );
         assertEquals( null, node.getMatchingRuleId() );
         assertFalse( node.dnAttributes() );
         assertEquals( AbstractExprNode.EXTENSIBLE, node.getAssertionType() );



Mime
View raw message