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 2010/03/30 01:59:51 UTC
svn commit: r928945 [3/3] - in /directory:
apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/
apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/
apacheds/trunk/core-entry/src/main/java...
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java Mon Mar 29 23:59:49 2010
@@ -22,7 +22,7 @@ package org.apache.directory.shared.ldap
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapOtherException;
@@ -77,7 +77,7 @@ public class NameOrNumericIdNormalizer e
if ( strValue.length() == 0 )
{
- return new ClientStringValue( "" );
+ return new StringValue( "" );
}
// if value is a numeric id then return it as is
@@ -91,7 +91,7 @@ public class NameOrNumericIdNormalizer e
if ( oid != null )
{
- return new ClientStringValue( oid );
+ return new StringValue( oid );
}
// if all else fails
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java Mon Mar 29 23:59:49 2010
@@ -24,7 +24,7 @@ import java.io.IOException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
@@ -61,7 +61,7 @@ public class NumericNormalizer extends N
String normalized = PrepareString.normalize( value.getString(),
PrepareString.StringType.NUMERIC_STRING );
- return new ClientStringValue( normalized );
+ return new StringValue( normalized );
}
catch ( IOException ioe )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java Mon Mar 29 23:59:49 2010
@@ -21,7 +21,7 @@ package org.apache.directory.shared.ldap
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -61,16 +61,16 @@ public class ObjectIdentifierNormalizer
if ( str.length() == 0 )
{
- return new ClientStringValue( "" );
+ return new StringValue( "" );
}
else if ( Character.isDigit( str.charAt( 0 ) ) )
{
// We do this test to avoid a lowerCasing which cost time
- return new ClientStringValue( str );
+ return new StringValue( str );
}
else
{
- return new ClientStringValue( str.toLowerCase() );
+ return new StringValue( str.toLowerCase() );
}
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/RegexNormalizer.java Mon Mar 29 23:59:49 2010
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -95,7 +95,7 @@ public class RegexNormalizer extends Nor
str = matchers[i].replaceAll( str );
}
- return new ClientStringValue( str );
+ return new StringValue( str );
}
return value;
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java Mon Mar 29 23:59:49 2010
@@ -24,7 +24,7 @@ import java.io.IOException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
@@ -62,7 +62,7 @@ public class TelephoneNumberNormalizer e
String normalized = PrepareString.normalize( value.getString(),
PrepareString.StringType.TELEPHONE_NUMBER );
- return new ClientStringValue( normalized );
+ return new StringValue( normalized );
}
catch ( IOException ioe )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java Mon Mar 29 23:59:49 2010
@@ -22,7 +22,7 @@ package org.apache.directory.shared.ldap
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.name.DN;
@@ -85,7 +85,7 @@ public class UniqueMemberNormalizer exte
dn.normalize( schemaManager.getNormalizerMapping() );
- return new ClientStringValue( dn.getNormName() + '#' + uid );
+ return new StringValue( dn.getNormName() + '#' + uid );
}
else
{
@@ -96,7 +96,7 @@ public class UniqueMemberNormalizer exte
{
// No UID, the strValue is a DN
// Return the normalized DN
- return new ClientStringValue( new DN( nameAndUid ).getNormName() );
+ return new StringValue( new DN( nameAndUid ).getNormName() );
}
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java Mon Mar 29 23:59:49 2010
@@ -39,7 +39,7 @@ import javax.naming.InvalidNameException
import org.apache.directory.shared.asn1.codec.binary.Hex;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.entry.BinaryValue;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.schema.syntaxCheckers.UuidSyntaxChecker;
@@ -1054,9 +1054,9 @@ public class StringTools
{
return dumpBytes( ( byte[] ) object );
}
- else if ( object instanceof ClientStringValue )
+ else if ( object instanceof StringValue )
{
- return ( ( ClientStringValue ) object ).get();
+ return ( ( StringValue ) object ).get();
}
else if ( object instanceof BinaryValue )
{
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java Mon Mar 29 23:59:49 2010
@@ -329,7 +329,7 @@ public class BinaryValueAttributeTypeTes
BinaryValue value4 = new BinaryValue( at1, new byte[]{0x01} );
BinaryValue value5 = new BinaryValue( at1, null );
BinaryValue value6 = new BinaryValue( at, new byte[]{0x01, 0x02} );
- ClientStringValue value7 = new ClientStringValue( EntryUtils.getIA5StringAttributeType(),
+ StringValue value7 = new StringValue( EntryUtils.getIA5StringAttributeType(),
"test" );
assertTrue( value1.equals( value1 ) );
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryUtils.java Mon Mar 29 23:59:49 2010
@@ -166,7 +166,7 @@ public class EntryUtils
{
if ( !value.isBinary() )
{
- return new ClientStringValue( value.getString().toLowerCase() );
+ return new StringValue( value.getString().toLowerCase() );
}
throw new IllegalStateException( I18n.err( I18n.ERR_04474 ) );
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueAttributeTypeTest.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueAttributeTypeTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueAttributeTypeTest.java Mon Mar 29 23:59:49 2010
@@ -53,7 +53,7 @@ import org.junit.Test;
/**
- * Tests that the ClientStringValue class works properly as expected.
+ * Tests that the StringValue class works properly as expected.
*
* Some notes while conducting tests:
*
@@ -93,9 +93,9 @@ public class StringValueAttributeTypeTes
/**
- * Serialize a ClientStringValue
+ * Serialize a StringValue
*/
- private ByteArrayOutputStream serializeValue( ClientStringValue value ) throws IOException
+ private ByteArrayOutputStream serializeValue( StringValue value ) throws IOException
{
ObjectOutputStream oOut = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -130,9 +130,9 @@ public class StringValueAttributeTypeTes
/**
- * Deserialize a ClientStringValue
+ * Deserialize a StringValue
*/
- private ClientStringValue deserializeValue( ByteArrayOutputStream out, AttributeType at ) throws IOException, ClassNotFoundException
+ private StringValue deserializeValue( ByteArrayOutputStream out, AttributeType at ) throws IOException, ClassNotFoundException
{
ObjectInputStream oIn = null;
ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() );
@@ -141,7 +141,7 @@ public class StringValueAttributeTypeTes
{
oIn = new ObjectInputStream( in );
- ClientStringValue value = new ClientStringValue( at );
+ StringValue value = new StringValue( at );
value.deserialize( oIn );
return value;
@@ -175,7 +175,7 @@ public class StringValueAttributeTypeTes
{
AttributeType attribute = EntryUtils.getIA5StringAttributeType();
- ClientStringValue value = new ClientStringValue( attribute, null );
+ StringValue value = new StringValue( attribute, null );
assertNull( value.get() );
assertTrue( value.isNull() );
@@ -189,7 +189,7 @@ public class StringValueAttributeTypeTes
{
AttributeType attribute = EntryUtils.getIA5StringAttributeType();
- ClientStringValue value = new ClientStringValue( attribute, null );
+ StringValue value = new StringValue( attribute, null );
assertFalse( value.isNormalized() );
assertNull( value.getNormalizedValue() );
@@ -216,7 +216,7 @@ public class StringValueAttributeTypeTes
{
AttributeType attribute = EntryUtils.getIA5StringAttributeType();
- ClientStringValue value = new ClientStringValue( attribute, null );
+ StringValue value = new StringValue( attribute, null );
assertTrue( value.isValid() );
value.set( "" );
@@ -237,7 +237,7 @@ public class StringValueAttributeTypeTes
public void testNormalize() throws LdapException
{
AttributeType attribute = EntryUtils.getIA5StringAttributeType();
- ClientStringValue ssv = new ClientStringValue( attribute );
+ StringValue ssv = new StringValue( attribute );
ssv.normalize();
assertEquals( null, ssv.getNormalizedValue() );
@@ -259,7 +259,7 @@ public class StringValueAttributeTypeTes
public void testInstanceOf() throws LdapException
{
AttributeType attribute = EntryUtils.getIA5StringAttributeType();
- ClientStringValue ssv = new ClientStringValue( attribute );
+ StringValue ssv = new StringValue( attribute );
assertTrue( ssv.instanceOf( attribute ) );
@@ -276,7 +276,7 @@ public class StringValueAttributeTypeTes
public void testgetAttributeType()
{
AttributeType attribute = EntryUtils.getIA5StringAttributeType();
- ClientStringValue ssv = new ClientStringValue( attribute );
+ StringValue ssv = new StringValue( attribute );
assertEquals( attribute, ssv.getAttributeType() );
}
@@ -290,13 +290,13 @@ public class StringValueAttributeTypeTes
AttributeType at1 = EntryUtils.getIA5StringAttributeType();
AttributeType at2 = EntryUtils.getBytesAttributeType();
- ClientStringValue value1 = new ClientStringValue( at1, "test" );
- ClientStringValue value2 = new ClientStringValue( at1, "test" );
- ClientStringValue value3 = new ClientStringValue( at1, "TEST" );
- ClientStringValue value4 = new ClientStringValue( at1, "tes" );
- ClientStringValue value5 = new ClientStringValue( at1, null );
+ StringValue value1 = new StringValue( at1, "test" );
+ StringValue value2 = new StringValue( at1, "test" );
+ StringValue value3 = new StringValue( at1, "TEST" );
+ StringValue value4 = new StringValue( at1, "tes" );
+ StringValue value5 = new StringValue( at1, null );
BinaryValue valueBytes = new BinaryValue( at2, new byte[]{0x01} );
- ClientStringValue valueString = new ClientStringValue( at, "test" );
+ StringValue valueString = new StringValue( at, "test" );
assertTrue( value1.equals( value1 ) );
assertTrue( value1.equals( value2 ) );
@@ -326,7 +326,7 @@ public class StringValueAttributeTypeTes
{
try
{
- new ClientStringValue( null, null );
+ new StringValue( null, null );
fail();
}
catch ( IllegalArgumentException iae )
@@ -339,7 +339,7 @@ public class StringValueAttributeTypeTes
try
{
- new ClientStringValue( attribute );
+ new StringValue( attribute );
fail();
}
catch ( IllegalArgumentException iae )
@@ -356,9 +356,9 @@ public class StringValueAttributeTypeTes
@Test public void testHashCode()
{
AttributeType at1 = EntryUtils.getCaseIgnoringAttributeNoNumbersType();
- ClientStringValue v0 = new ClientStringValue( at1, "Alex" );
- ClientStringValue v1 = new ClientStringValue( at1, "ALEX" );
- ClientStringValue v2 = new ClientStringValue( at1, "alex" );
+ StringValue v0 = new StringValue( at1, "Alex" );
+ StringValue v1 = new StringValue( at1, "ALEX" );
+ StringValue v2 = new StringValue( at1, "alex" );
assertEquals( v0.hashCode(), v1.hashCode() );
assertEquals( v0.hashCode(), v2.hashCode() );
@@ -372,12 +372,12 @@ public class StringValueAttributeTypeTes
assertTrue( v1.isValid() );
assertTrue( v2.isValid() );
- ClientStringValue v3 = new ClientStringValue( at1, "Timber" );
+ StringValue v3 = new StringValue( at1, "Timber" );
assertTrue( v3.isValid() );
assertNotSame( v0.hashCode(), v3.hashCode() );
- ClientStringValue v4 = new ClientStringValue( at, "Alex" );
+ StringValue v4 = new StringValue( at, "Alex" );
assertNotSame( v0.hashCode(), v4.hashCode() );
}
@@ -390,13 +390,13 @@ public class StringValueAttributeTypeTes
public void testCompareTo()
{
AttributeType at1 = EntryUtils.getCaseIgnoringAttributeNoNumbersType();
- ClientStringValue v0 = new ClientStringValue( at1, "Alex" );
- ClientStringValue v1 = new ClientStringValue( at1, "ALEX" );
+ StringValue v0 = new StringValue( at1, "Alex" );
+ StringValue v1 = new StringValue( at1, "ALEX" );
assertEquals( 0, v0.compareTo( v1 ) );
assertEquals( 0, v1.compareTo( v0 ) );
- ClientStringValue v2 = new ClientStringValue( at1, null );
+ StringValue v2 = new StringValue( at1, null );
assertEquals( 1, v0.compareTo( v2 ) );
assertEquals( -1, v2.compareTo( v0 ) );
@@ -410,9 +410,9 @@ public class StringValueAttributeTypeTes
public void testClone() throws LdapException
{
AttributeType at1 = EntryUtils.getCaseIgnoringAttributeNoNumbersType();
- ClientStringValue ssv = new ClientStringValue( at1, "Test" );
+ StringValue ssv = new StringValue( at1, "Test" );
- ClientStringValue ssv1 = ssv.clone();
+ StringValue ssv1 = ssv.clone();
assertEquals( ssv, ssv1 );
@@ -502,24 +502,24 @@ public class StringValueAttributeTypeTes
at.setSyntax( s );
// check that normalization and syntax checks work as expected
- ClientStringValue value = new ClientStringValue( at, "HIGH" );
+ StringValue value = new StringValue( at, "HIGH" );
assertEquals( value.get(), value.get() );
assertTrue( value.isValid() );
- value = new ClientStringValue( at, "high" );
+ value = new StringValue( at, "high" );
assertFalse( value.isValid() );
// create a bunch to best tested for equals and in containers
- ClientStringValue v0 = new ClientStringValue( at, "LOW" );
+ StringValue v0 = new StringValue( at, "LOW" );
assertTrue( v0.isValid() );
- ClientStringValue v1 = new ClientStringValue( at, "LOW" );
+ StringValue v1 = new StringValue( at, "LOW" );
assertTrue( v1.isValid() );
- ClientStringValue v2 = new ClientStringValue( at, "MEDIUM" );
+ StringValue v2 = new StringValue( at, "MEDIUM" );
assertTrue( v2.isValid() );
- ClientStringValue v3 = new ClientStringValue( at, "HIGH" );
+ StringValue v3 = new StringValue( at, "HIGH" );
assertTrue( v3.isValid() );
- ClientStringValue v4 = new ClientStringValue( at );
+ StringValue v4 = new StringValue( at );
assertFalse( v4.isValid() );
- ClientStringValue v5 = new ClientStringValue( at );
+ StringValue v5 = new StringValue( at );
assertFalse( v5.isValid() );
// check equals
@@ -537,7 +537,7 @@ public class StringValueAttributeTypeTes
assertTrue( v3.compareTo( v2 ) > 0 );
// add all except v1 and v5 to a set
- HashSet<ClientStringValue> set = new HashSet<ClientStringValue>();
+ HashSet<StringValue> set = new HashSet<StringValue>();
set.add( v0 );
set.add( v2 );
set.add( v3 );
@@ -589,17 +589,17 @@ public class StringValueAttributeTypeTes
@Test public void testAcceptAllNoNormalization()
{
// check that normalization and syntax checks work as expected
- ClientStringValue value = new ClientStringValue( at, "hello" );
+ StringValue value = new StringValue( at, "hello" );
assertEquals( value.get(), value.get() );
assertTrue( value.isValid() );
// create a bunch to best tested for equals and in containers
- ClientStringValue v0 = new ClientStringValue( at, "hello" );
- ClientStringValue v1 = new ClientStringValue( at, "hello" );
- ClientStringValue v2 = new ClientStringValue( at, "next0" );
- ClientStringValue v3 = new ClientStringValue( at, "next1" );
- ClientStringValue v4 = new ClientStringValue( at );
- ClientStringValue v5 = new ClientStringValue( at );
+ StringValue v0 = new StringValue( at, "hello" );
+ StringValue v1 = new StringValue( at, "hello" );
+ StringValue v2 = new StringValue( at, "next0" );
+ StringValue v3 = new StringValue( at, "next1" );
+ StringValue v4 = new StringValue( at );
+ StringValue v5 = new StringValue( at );
// check equals
assertTrue( v0.equals( v1 ) );
@@ -610,7 +610,7 @@ public class StringValueAttributeTypeTes
assertFalse( v3.equals( v2 ) );
// add all except v1 and v5 to a set
- HashSet<ClientStringValue> set = new HashSet<ClientStringValue>();
+ HashSet<StringValue> set = new HashSet<StringValue>();
set.add( v0 );
set.add( v2 );
set.add( v3 );
@@ -621,7 +621,7 @@ public class StringValueAttributeTypeTes
assertTrue( "since v4.equals( v5 ) and v4 was added then this should be true", set.contains( v5 ) );
// check ordering based on the comparator
- ArrayList<ClientStringValue> list = new ArrayList<ClientStringValue>();
+ ArrayList<StringValue> list = new ArrayList<StringValue>();
list.add( v1 );
list.add( v3 );
list.add( v5 );
@@ -629,9 +629,9 @@ public class StringValueAttributeTypeTes
list.add( v2 );
list.add( v4 );
- Comparator<ClientStringValue> c = new Comparator<ClientStringValue>()
+ Comparator<StringValue> c = new Comparator<StringValue>()
{
- public int compare( ClientStringValue o1, ClientStringValue o2 )
+ public int compare( StringValue o1, StringValue o2 )
{
String n1 = null;
String n2 = null;
@@ -684,7 +684,7 @@ public class StringValueAttributeTypeTes
@Test public void testNormalizedStringValueSerialization() throws LdapException, IOException, ClassNotFoundException
{
// First check with a value which will be normalized
- ClientStringValue ssv = new ClientStringValue( at, " Test Test " );
+ StringValue ssv = new StringValue( at, " Test Test " );
ssv.normalize();
String normalized = ssv.getNormalizedValue();
@@ -692,7 +692,7 @@ public class StringValueAttributeTypeTes
assertEquals( "test test", normalized );
assertEquals( " Test Test ", ssv.getString() );
- ClientStringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+ StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
assertEquals( ssv, ssvSer );
}
@@ -704,7 +704,7 @@ public class StringValueAttributeTypeTes
@Test public void testNoNormalizedStringValueSerialization() throws LdapException, IOException, ClassNotFoundException
{
// First check with a value which will be normalized
- ClientStringValue ssv = new ClientStringValue( at, "test" );
+ StringValue ssv = new StringValue( at, "test" );
ssv.normalize();
String normalized = ssv.getNormalizedValue();
@@ -712,7 +712,7 @@ public class StringValueAttributeTypeTes
assertEquals( "test", normalized );
assertEquals( "test", ssv.getString() );
- ClientStringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+ StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
assertEquals( ssv, ssvSer );
}
@@ -724,7 +724,7 @@ public class StringValueAttributeTypeTes
@Test public void testNullStringValueSerialization() throws LdapException, IOException, ClassNotFoundException
{
// First check with a value which will be normalized
- ClientStringValue ssv = new ClientStringValue( at );
+ StringValue ssv = new StringValue( at );
ssv.normalize();
String normalized = ssv.getNormalizedValue();
@@ -732,7 +732,7 @@ public class StringValueAttributeTypeTes
assertNull( normalized );
assertNull( ssv.get() );
- ClientStringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+ StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
assertEquals( ssv, ssvSer );
}
@@ -744,7 +744,7 @@ public class StringValueAttributeTypeTes
@Test public void testEmptyStringValueSerialization() throws LdapException, IOException, ClassNotFoundException
{
// First check with a value which will be normalized
- ClientStringValue ssv = new ClientStringValue( at, "" );
+ StringValue ssv = new StringValue( at, "" );
ssv.normalize();
String normalized = ssv.getNormalizedValue();
@@ -752,7 +752,7 @@ public class StringValueAttributeTypeTes
assertEquals( "", normalized );
assertEquals( "", ssv.getString() );
- ClientStringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+ StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
assertEquals( ssv, ssvSer );
}
@@ -764,11 +764,11 @@ public class StringValueAttributeTypeTes
@Test public void testStringValueEmptyNormalizedSerialization() throws LdapException, IOException, ClassNotFoundException
{
// First check with a value which will be normalized
- ClientStringValue ssv = new ClientStringValue( at, " " );
+ StringValue ssv = new StringValue( at, " " );
assertEquals( " ", ssv.getString() );
- ClientStringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+ StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
assertEquals( ssv, ssvSer );
}
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueTest.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/StringValueTest.java Mon Mar 29 23:59:49 2010
@@ -38,7 +38,7 @@ import org.junit.Test;
/**
*
- * Test the ClientStringValue class
+ * Test the StringValue class
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
@@ -46,9 +46,9 @@ import org.junit.Test;
public class StringValueTest
{
/**
- * Serialize a ClientStringValue
+ * Serialize a StringValue
*/
- private ByteArrayOutputStream serializeValue( ClientStringValue value ) throws IOException
+ private ByteArrayOutputStream serializeValue( StringValue value ) throws IOException
{
ObjectOutputStream oOut = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -83,9 +83,9 @@ public class StringValueTest
/**
- * Deserialize a ClientStringValue
+ * Deserialize a StringValue
*/
- private ClientStringValue deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException
+ private StringValue deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException
{
ObjectInputStream oIn = null;
ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() );
@@ -94,7 +94,7 @@ public class StringValueTest
{
oIn = new ObjectInputStream( in );
- ClientStringValue value = ( ClientStringValue ) oIn.readObject();
+ StringValue value = ( StringValue ) oIn.readObject();
return value;
}
@@ -120,29 +120,29 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#hashCode()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#hashCode()}.
*/
@Test
public void testHashCode()
{
- ClientStringValue csv = new ClientStringValue( "test" );
+ StringValue csv = new StringValue( "test" );
int hash = "test".hashCode();
assertEquals( hash, csv.hashCode() );
- csv = new ClientStringValue();
+ csv = new StringValue();
hash = "".hashCode();
assertEquals( hash, csv.hashCode() );
}
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#ClientStringValue()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#ClientStringValue()}.
*/
@Test
public void testClientStringValueNull() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
assertNull( csv.get() );
assertFalse( csv.isNormalized() );
@@ -153,12 +153,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#ClientStringValue(java.lang.String)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#ClientStringValue(java.lang.String)}.
*/
@Test
public void testClientStringValueEmpty() throws LdapException
{
- ClientStringValue csv = new ClientStringValue( "" );
+ StringValue csv = new StringValue( "" );
assertNotNull( csv.get() );
assertEquals( "", csv.getString() );
@@ -171,12 +171,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#ClientStringValue(java.lang.String)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#ClientStringValue(java.lang.String)}.
*/
@Test
public void testClientStringValueString() throws LdapException
{
- ClientStringValue csv = new ClientStringValue( "test" );
+ StringValue csv = new StringValue( "test" );
assertEquals( "test", csv.get() );
assertFalse( csv.isNormalized() );
@@ -188,12 +188,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#get()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#get()}.
*/
@Test
public void testGet()
{
- ClientStringValue csv = new ClientStringValue( "test" );
+ StringValue csv = new StringValue( "test" );
assertEquals( "test", csv.get() );
@@ -206,12 +206,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#getCopy()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#getCopy()}.
*/
@Test
public void testGetCopy()
{
- ClientStringValue csv = new ClientStringValue( "test" );
+ StringValue csv = new StringValue( "test" );
assertEquals( "test", csv.getCopy() );
@@ -224,12 +224,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#set(java.lang.String)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#set(java.lang.String)}.
*/
@Test
public void testSet() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
csv.set( null );
assertNull( csv.get() );
@@ -254,12 +254,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#isNull()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#isNull()}.
*/
@Test
public void testIsNull()
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
csv.set( null );
assertTrue( csv.isNull() );
@@ -273,12 +273,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#clear()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#clear()}.
*/
@Test
public void testClear() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
csv.clear();
assertTrue( csv.isNull() );
@@ -293,12 +293,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#isNormalized()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#isNormalized()}.
*/
@Test
public void testIsNormalized() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
assertFalse( csv.isNormalized() );
@@ -316,12 +316,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#setNormalized(boolean)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#setNormalized(boolean)}.
*/
@Test
public void testSetNormalized() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
assertFalse( csv.isNormalized() );
@@ -347,12 +347,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#getNormalizedValue()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#getNormalizedValue()}.
*/
@Test
public void testGetNormalizedValue() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
assertEquals( null, csv.getNormalizedValue() );
@@ -370,12 +370,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#getNormalizedValueCopy()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#getNormalizedValueCopy()}.
*/
@Test
public void getNormalizedValueCopy() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
assertEquals( null, csv.getNormalizedValueCopy() );
@@ -393,12 +393,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#normalize(org.apache.directory.shared.ldap.schema.Normalizer)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#normalize(org.apache.directory.shared.ldap.schema.Normalizer)}.
*/
@Test
public void testNormalize() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
assertEquals( null, csv.getNormalizedValue() );
@@ -417,12 +417,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#isValid(org.apache.directory.shared.ldap.schema.SyntaxChecker)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#isValid(org.apache.directory.shared.ldap.schema.SyntaxChecker)}.
*/
@Test
public void testIsValid() throws LdapException
{
- ClientStringValue csv = new ClientStringValue( "Test" );
+ StringValue csv = new StringValue( "Test" );
assertTrue( csv.isValid( new Ia5StringSyntaxChecker() ) );
@@ -432,13 +432,13 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#compareTo(org.apache.directory.shared.ldap.entry.Value)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#compareTo(org.apache.directory.shared.ldap.entry.Value)}.
*/
@Test
public void testCompareTo() throws LdapException
{
- ClientStringValue csv1 = new ClientStringValue();
- ClientStringValue csv2 = new ClientStringValue();
+ StringValue csv1 = new StringValue();
+ StringValue csv2 = new StringValue();
assertEquals( 0, csv1.compareTo( csv2 ) );
@@ -466,14 +466,14 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#clone()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#clone()}.
*/
@Test
public void testClone() throws LdapException
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
- ClientStringValue csv1 = (ClientStringValue)csv.clone();
+ StringValue csv1 = (StringValue)csv.clone();
assertEquals( csv, csv1 );
@@ -495,13 +495,13 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#equals(java.lang.Object)}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#equals(java.lang.Object)}.
*/
@Test
public void testEquals() throws LdapException
{
- ClientStringValue csv1 = new ClientStringValue();
- ClientStringValue csv2 = new ClientStringValue();
+ StringValue csv1 = new StringValue();
+ StringValue csv2 = new StringValue();
assertEquals( csv1, csv2 );
@@ -520,12 +520,12 @@ public class StringValueTest
/**
- * Test method for {@link org.apache.directory.shared.ldap.entry.ClientStringValue#toString()}.
+ * Test method for {@link org.apache.directory.shared.ldap.entry.StringValue#toString()}.
*/
@Test
public void testToString()
{
- ClientStringValue csv = new ClientStringValue();
+ StringValue csv = new StringValue();
assertEquals( "null", csv.toString() );
@@ -546,12 +546,12 @@ public class StringValueTest
@Test
public void testSerializeStandard() throws LdapException, IOException, ClassNotFoundException
{
- ClientStringValue csv = new ClientStringValue( "TEST");
+ StringValue csv = new StringValue( "TEST");
csv.setNormalized( true );
csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
csv.isValid( new Ia5StringSyntaxChecker() );
- ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
+ StringValue csvSer = deserializeValue( serializeValue( csv ) );
assertNotSame( csv, csvSer );
assertEquals( csv.get(), csvSer.get() );
assertEquals( csv.getNormalizedValue(), csvSer.getNormalizedValue() );
@@ -566,11 +566,11 @@ public class StringValueTest
@Test
public void testSerializeNotNormalized() throws LdapException, IOException, ClassNotFoundException
{
- ClientStringValue csv = new ClientStringValue( "Test" );
+ StringValue csv = new StringValue( "Test" );
csv.setNormalized( false );
csv.isValid( new Ia5StringSyntaxChecker() );
- ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
+ StringValue csvSer = deserializeValue( serializeValue( csv ) );
assertNotSame( csv, csvSer );
assertEquals( csv.get(), csvSer.get() );
assertEquals( csv.get(), csvSer.getNormalizedValue() );
@@ -585,12 +585,12 @@ public class StringValueTest
@Test
public void testSerializeEmptyNormalized() throws LdapException, IOException, ClassNotFoundException
{
- ClientStringValue csv = new ClientStringValue( " " );
+ StringValue csv = new StringValue( " " );
csv.setNormalized( true );
csv.isValid( new Ia5StringSyntaxChecker() );
csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
- ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
+ StringValue csvSer = deserializeValue( serializeValue( csv ) );
assertNotSame( csv, csvSer );
assertEquals( csv.get(), csvSer.get() );
assertEquals( csv.getNormalizedValue(), csvSer.getNormalizedValue() );
@@ -605,12 +605,12 @@ public class StringValueTest
@Test
public void testSerializeNullValue() throws LdapException, IOException, ClassNotFoundException
{
- ClientStringValue csv = new ClientStringValue( (String)null );
+ StringValue csv = new StringValue( (String)null );
csv.setNormalized( true );
csv.isValid( new Ia5StringSyntaxChecker() );
csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
- ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
+ StringValue csvSer = deserializeValue( serializeValue( csv ) );
assertNotSame( csv, csvSer );
assertEquals( csv.get(), csvSer.get() );
assertEquals( csv.getNormalizedValue(), csvSer.getNormalizedValue() );
@@ -625,12 +625,12 @@ public class StringValueTest
@Test
public void testSerializeEmptyValue() throws LdapException, IOException, ClassNotFoundException
{
- ClientStringValue csv = new ClientStringValue( "" );
+ StringValue csv = new StringValue( "" );
csv.setNormalized( true );
csv.isValid( new Ia5StringSyntaxChecker() );
csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
- ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
+ StringValue csvSer = deserializeValue( serializeValue( csv ) );
assertNotSame( csv, csvSer );
assertEquals( csv.get(), csvSer.get() );
assertEquals( csv.getNormalizedValue(), csvSer.getNormalizedValue() );
@@ -645,11 +645,11 @@ public class StringValueTest
@Test
public void testSerializeEmptyValueNotNormalized() throws LdapException, IOException, ClassNotFoundException
{
- ClientStringValue csv = new ClientStringValue( "" );
+ StringValue csv = new StringValue( "" );
csv.setNormalized( false );
csv.isValid( new Ia5StringSyntaxChecker() );
- ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
+ StringValue csvSer = deserializeValue( serializeValue( csv ) );
assertNotSame( csv, csvSer );
assertEquals( csv.get(), csvSer.get() );
assertEquals( csv.getNormalizedValue(), csvSer.getNormalizedValue() );
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=928945&r1=928944&r2=928945&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 Mon Mar 29 23:59:49 2010
@@ -38,7 +38,7 @@ import java.util.List;
import javax.naming.directory.InvalidAttributeValueException;
import org.apache.directory.shared.ldap.entry.BinaryValue;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapException;
@@ -56,17 +56,17 @@ import org.junit.Test;
*/
public class DefaultClientAttributeTest
{
- private static final Value<String> NULL_STRING_VALUE = new ClientStringValue( (String)null );
+ private static final Value<String> NULL_STRING_VALUE = new StringValue( (String)null );
private static final Value<byte[]> NULL_BINARY_VALUE = new BinaryValue( (byte[])null );
private static final byte[] BYTES1 = new byte[]{ 'a', 'b' };
private static final byte[] BYTES2 = new byte[]{ 'b' };
private static final byte[] BYTES3 = new byte[]{ 'c' };
private static final byte[] BYTES4 = new byte[]{ 'd' };
- private static final ClientStringValue STR_VALUE1 = new ClientStringValue( "a" );
- private static final ClientStringValue STR_VALUE2 = new ClientStringValue( "b" );
- private static final ClientStringValue STR_VALUE3 = new ClientStringValue( "c" );
- private static final ClientStringValue STR_VALUE4 = new ClientStringValue( "d" );
+ private static final StringValue STR_VALUE1 = new StringValue( "a" );
+ private static final StringValue STR_VALUE2 = new StringValue( "b" );
+ private static final StringValue STR_VALUE3 = new StringValue( "c" );
+ private static final StringValue STR_VALUE4 = new StringValue( "d" );
private static final BinaryValue BIN_VALUE1 = new BinaryValue( BYTES1 );
private static final BinaryValue BIN_VALUE2 = new BinaryValue( BYTES2 );
@@ -468,7 +468,7 @@ public class DefaultClientAttributeTest
for ( Value<?> val:attr )
{
- assertTrue( val instanceof ClientStringValue );
+ assertTrue( val instanceof StringValue );
assertEquals( values[pos++], val.getString() );
}
}
@@ -482,7 +482,7 @@ public class DefaultClientAttributeTest
{
EntryAttribute attr1 = new DefaultClientAttribute( "test" );
- int nbAdded = attr1.add( new ClientStringValue( (String)null ) );
+ int nbAdded = attr1.add( new StringValue( (String)null ) );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHR() );
assertEquals( NULL_STRING_VALUE, attr1.get() );
@@ -496,7 +496,7 @@ public class DefaultClientAttributeTest
EntryAttribute attr3 = new DefaultClientAttribute( "test" );
- nbAdded = attr3.add( new ClientStringValue( "a" ), new ClientStringValue( "b" ) );
+ nbAdded = attr3.add( new StringValue( "a" ), new StringValue( "b" ) );
assertEquals( 2, nbAdded );
assertTrue( attr3.isHR() );
assertTrue( attr3.contains( "a" ) );
@@ -512,7 +512,7 @@ public class DefaultClientAttributeTest
EntryAttribute attr5 = new DefaultClientAttribute( "test" );
- nbAdded = attr5.add( new ClientStringValue( "c" ), new BinaryValue( BYTES1 ) );
+ nbAdded = attr5.add( new StringValue( "c" ), new BinaryValue( BYTES1 ) );
assertEquals( 2, nbAdded );
assertTrue( attr5.isHR() );
assertTrue( attr5.contains( "ab" ) );
@@ -520,7 +520,7 @@ public class DefaultClientAttributeTest
EntryAttribute attr6 = new DefaultClientAttribute( "test" );
- nbAdded = attr6.add( new BinaryValue( BYTES1 ), new ClientStringValue( "c" ) );
+ nbAdded = attr6.add( new BinaryValue( BYTES1 ), new StringValue( "c" ) );
assertEquals( 2, nbAdded );
assertFalse( attr6.isHR() );
assertTrue( attr6.contains( BYTES1 ) );
@@ -528,7 +528,7 @@ public class DefaultClientAttributeTest
EntryAttribute attr7 = new DefaultClientAttribute( "test" );
- nbAdded = attr7.add( new BinaryValue( (byte[])null ), new ClientStringValue( "c" ) );
+ nbAdded = attr7.add( new BinaryValue( (byte[])null ), new StringValue( "c" ) );
assertEquals( 2, nbAdded );
assertFalse( attr7.isHR() );
assertTrue( attr7.contains( NULL_BINARY_VALUE ) );
@@ -536,7 +536,7 @@ public class DefaultClientAttributeTest
EntryAttribute attr8 = new DefaultClientAttribute( "test" );
- nbAdded = attr8.add( new ClientStringValue( (String)null ), new BinaryValue( BYTES1 ) );
+ nbAdded = attr8.add( new StringValue( (String)null ), new BinaryValue( BYTES1 ) );
assertEquals( 2, nbAdded );
assertTrue( attr8.isHR() );
assertTrue( attr8.contains( NULL_STRING_VALUE ) );
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=928945&r1=928944&r2=928945&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 Mon Mar 29 23:59:49 2010
@@ -41,7 +41,7 @@ import java.util.Set;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.BinaryValue;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.entry.Entry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
@@ -392,7 +392,7 @@ public class DefaultClientEntryTest
{
Entry entry = new DefaultClientEntry();
- Value<String> value = new ClientStringValue( (String)null );
+ Value<String> value = new StringValue( (String)null );
entry.add( "cn", value );
assertEquals( 1, entry.size() );
@@ -401,9 +401,9 @@ public class DefaultClientEntryTest
assertNotNull( attributeCN.get() );
assertNull( attributeCN.get().get() );
- Value<String> value1 = new ClientStringValue( "test1" );
- Value<String> value2 = new ClientStringValue( "test2" );
- Value<String> value3 = new ClientStringValue( "test1" );
+ Value<String> value1 = new StringValue( "test1" );
+ Value<String> value2 = new StringValue( "test2" );
+ Value<String> value3 = new StringValue( "test1" );
entry.add( "sn", value1, value2, value3 );
assertEquals( 2, entry.size() );
@@ -580,10 +580,10 @@ public class DefaultClientEntryTest
entry.add( attrCN, attrPWD );
- Value<String> strValue1 = new ClientStringValue( "test1" );
- Value<String> strValue2 = new ClientStringValue( "test2" );
- Value<String> strValue3 = new ClientStringValue( "test3" );
- Value<String> strNullValue = new ClientStringValue( (String)null);
+ Value<String> strValue1 = new StringValue( "test1" );
+ Value<String> strValue2 = new StringValue( "test2" );
+ Value<String> strValue3 = new StringValue( "test3" );
+ Value<String> strNullValue = new StringValue( (String)null);
Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
@@ -940,10 +940,10 @@ public class DefaultClientEntryTest
{
Entry entry = new DefaultClientEntry( EXAMPLE_DN );
- Value<String> strValueTop = new ClientStringValue( "top" );
- Value<String> strValuePerson = new ClientStringValue( "person" );
- Value<String> strValueTop2 = new ClientStringValue( "top" );
- Value<String> strNullValue = new ClientStringValue( (String)null );
+ Value<String> strValueTop = new StringValue( "top" );
+ Value<String> strValuePerson = new StringValue( "person" );
+ Value<String> strValueTop2 = new StringValue( "top" );
+ Value<String> strNullValue = new StringValue( (String)null );
Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
@@ -1136,10 +1136,10 @@ public class DefaultClientEntryTest
entry.add( attrCN, attrPWD );
- Value<String> strValue1 = new ClientStringValue( "test1" );
- Value<String> strValue2 = new ClientStringValue( "test2" );
- Value<String> strValue3 = new ClientStringValue( "test3" );
- Value<String> strNullValue = new ClientStringValue( (String)null );
+ Value<String> strValue1 = new StringValue( "test1" );
+ Value<String> strValue2 = new StringValue( "test2" );
+ Value<String> strValue3 = new StringValue( "test3" );
+ Value<String> strNullValue = new StringValue( (String)null );
Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
@@ -1237,9 +1237,9 @@ public class DefaultClientEntryTest
assertEquals( "ClientEntry\n dn: dc=example,dc=com\n", entry.toString() );
- Value<String> strValueTop = new ClientStringValue( "top" );
- Value<String> strValuePerson = new ClientStringValue( "person" );
- Value<String> strNullValue = new ClientStringValue( (String)null );
+ Value<String> strValueTop = new StringValue( "top" );
+ Value<String> strValuePerson = new StringValue( "person" );
+ Value<String> strNullValue = new StringValue( (String)null );
Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterNodeEqualityTest.java Mon Mar 29 23:59:49 2010
@@ -20,7 +20,7 @@
package org.apache.directory.shared.ldap.filter;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -37,22 +37,22 @@ public class FilterNodeEqualityTest
@Test
public void testEqualityEquals()
{
- EqualityNode<String> eqNode1 = new EqualityNode<String>( "attr1", new ClientStringValue( "test" ) );
- EqualityNode<String> eqNode2 = new EqualityNode<String>( "attr1", new ClientStringValue( "test" ) );
+ EqualityNode<String> eqNode1 = new EqualityNode<String>( "attr1", new StringValue( "test" ) );
+ EqualityNode<String> eqNode2 = new EqualityNode<String>( "attr1", new StringValue( "test" ) );
assertEquals( "two exact nodes should be equal", eqNode1, eqNode2 );
- eqNode2 = new EqualityNode<String>( "attr2", new ClientStringValue( "test" ) );
+ eqNode2 = new EqualityNode<String>( "attr2", new StringValue( "test" ) );
assertFalse( "different attribute in node should return false on equals()", eqNode1.equals( eqNode2 ) );
- eqNode2 = new EqualityNode<String>( "attr2", new ClientStringValue( "foobar" ) );
+ eqNode2 = new EqualityNode<String>( "attr2", new StringValue( "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<String> greaterEqNode = new GreaterEqNode<String>( "attr1", new ClientStringValue( "test" ) );
+ GreaterEqNode<String> greaterEqNode = new GreaterEqNode<String>( "attr1", new StringValue( "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 ) );
}
@@ -61,16 +61,16 @@ public class FilterNodeEqualityTest
@Test
public void testGreaterEqEquals()
{
- GreaterEqNode<String> greaterEqNode1 = new GreaterEqNode<String>( "attr1", new ClientStringValue( "test" ) );
- GreaterEqNode<String> greaterEqNode2 = new GreaterEqNode<String>( "attr1", new ClientStringValue( "test" ) );
+ GreaterEqNode<String> greaterEqNode1 = new GreaterEqNode<String>( "attr1", new StringValue( "test" ) );
+ GreaterEqNode<String> greaterEqNode2 = new GreaterEqNode<String>( "attr1", new StringValue( "test" ) );
assertEquals( "two exact nodes should be equal", greaterEqNode1, greaterEqNode2 );
- greaterEqNode2 = new GreaterEqNode<String>( "attr2", new ClientStringValue( "test" ) );
+ greaterEqNode2 = new GreaterEqNode<String>( "attr2", new StringValue( "test" ) );
assertFalse( "different attribute in node should return false on equals()", greaterEqNode1
.equals( greaterEqNode2 ) );
- greaterEqNode2 = new GreaterEqNode<String>( "attr2", new ClientStringValue( "foobar" ) );
+ greaterEqNode2 = new GreaterEqNode<String>( "attr2", new StringValue( "foobar" ) );
assertFalse( "different value in node should return false on equals()", greaterEqNode1.equals( greaterEqNode2 ) );
}
@@ -78,15 +78,15 @@ public class FilterNodeEqualityTest
@Test
public void testLessEqEquals()
{
- LessEqNode<String> lessEqNode1 = new LessEqNode<String>( "attr1", new ClientStringValue( "test" ) );
- LessEqNode<String> lessEqNode2 = new LessEqNode<String>( "attr1", new ClientStringValue( "test" ) );
+ LessEqNode<String> lessEqNode1 = new LessEqNode<String>( "attr1", new StringValue( "test" ) );
+ LessEqNode<String> lessEqNode2 = new LessEqNode<String>( "attr1", new StringValue( "test" ) );
assertEquals( "two exact nodes should be equal", lessEqNode1, lessEqNode2 );
- lessEqNode2 = new LessEqNode<String>( "attr2", new ClientStringValue( "test" ) );
+ lessEqNode2 = new LessEqNode<String>( "attr2", new StringValue( "test" ) );
assertFalse( "different attribute in node should return false on equals()", lessEqNode1.equals( lessEqNode2 ) );
- lessEqNode2 = new LessEqNode<String>( "attr2", new ClientStringValue( "foobar" ) );
+ lessEqNode2 = new LessEqNode<String>( "attr2", new StringValue( "foobar" ) );
assertFalse( "different value in node should return false on equals()", lessEqNode1.equals( lessEqNode2 ) );
}
@@ -94,16 +94,16 @@ public class FilterNodeEqualityTest
@Test
public void testApproximateEqEquals()
{
- ApproximateNode<String> approximateNode1 = new ApproximateNode<String>( "attr1", new ClientStringValue( "test" ) );
- ApproximateNode<String> approximateNode2 = new ApproximateNode<String>( "attr1", new ClientStringValue( "test" ) );
+ ApproximateNode<String> approximateNode1 = new ApproximateNode<String>( "attr1", new StringValue( "test" ) );
+ ApproximateNode<String> approximateNode2 = new ApproximateNode<String>( "attr1", new StringValue( "test" ) );
assertEquals( "two exact nodes should be equal", approximateNode1, approximateNode2 );
- approximateNode2 = new ApproximateNode<String>( "attr2", new ClientStringValue( "test" ) );
+ approximateNode2 = new ApproximateNode<String>( "attr2", new StringValue( "test" ) );
assertFalse( "different attribute in node should return false on equals()", approximateNode1
.equals( approximateNode2 ) );
- approximateNode2 = new ApproximateNode<String>( "attr2", new ClientStringValue( "foobar" ) );
+ approximateNode2 = new ApproximateNode<String>( "attr2", new StringValue( "foobar" ) );
assertFalse( "different value in node should return false on equals()", approximateNode1
.equals( approximateNode2 ) );
}
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=928945&r1=928944&r2=928945&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 Mon Mar 29 23:59:49 2010
@@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.junit.Test;
@@ -605,7 +605,7 @@ public class FilterParserTest
assertTrue( node instanceof SubstringNode );
assertEquals( 4, node.getAny().size() );
- assertFalse( node.getAny().contains( new ClientStringValue( "" ) ) );
+ assertFalse( node.getAny().contains( new StringValue( "" ) ) );
assertTrue( node.getAny().contains( "e" ) );
assertTrue( node.getAny().contains( "b" ) );
assertTrue( node.getAny().contains( "c" ) );
@@ -647,7 +647,7 @@ public class FilterParserTest
assertTrue( node instanceof SubstringNode );
assertEquals( 4, node.getAny().size() );
- assertFalse( node.getAny().contains( new ClientStringValue( "" ) ) );
+ assertFalse( node.getAny().contains( new StringValue( "" ) ) );
assertTrue( node.getAny().contains( "e" ) );
assertTrue( node.getAny().contains( "b" ) );
assertTrue( node.getAny().contains( "c" ) );
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java?rev=928945&r1=928944&r2=928945&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java Mon Mar 29 23:59:49 2010
@@ -25,7 +25,7 @@ import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.directory.shared.ldap.entry.ClientStringValue;
+import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.filter.AndNode;
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -280,16 +280,16 @@ public class SubtreeSpecificationParserT
{
SubtreeSpecification ss = parser.parse( SPEC_WITH_REFINEMENT );
- SimpleNode<String> n1 = new EqualityNode<String>( "objectClass", new ClientStringValue( "1.2.3" ) );
- SimpleNode<String> n2 = new EqualityNode<String>( "objectClass", new ClientStringValue( "4.5.6" ) );
- SimpleNode<String> n3 = new EqualityNode<String>( "objectClass", new ClientStringValue( "person-7" ) );
+ SimpleNode<String> n1 = new EqualityNode<String>( "objectClass", new StringValue( "1.2.3" ) );
+ SimpleNode<String> n2 = new EqualityNode<String>( "objectClass", new StringValue( "4.5.6" ) );
+ SimpleNode<String> n3 = new EqualityNode<String>( "objectClass", new StringValue( "person-7" ) );
BranchNode n4 = new OrNode();
n4.addNode( n2 );
n4.addNode( n3 );
BranchNode n5 = new AndNode();
n5.addNode( n1 );
n5.addNode( n4 );
- SimpleNode<String> n6 = new EqualityNode<String>( "objectClass", new ClientStringValue( "10.11.12" ) );
+ SimpleNode<String> n6 = new EqualityNode<String>( "objectClass", new StringValue( "10.11.12" ) );
BranchNode n7 = new NotNode();
n7.addNode( n6 );
BranchNode n8 = new AndNode();