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 2011/04/01 01:29:27 UTC
svn commit: r1087506 [2/6] - in /directory/apacheds/trunk:
core-api/src/main/java/org/apache/directory/server/core/
core-api/src/main/java/org/apache/directory/server/core/changelog/
core-api/src/main/java/org/apache/directory/server/core/entry/ core-a...
Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java?rev=1087506&r1=1087505&r2=1087506&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java Thu Mar 31 23:29:24 2011
@@ -44,7 +44,7 @@ import javax.naming.directory.InvalidAtt
import org.apache.commons.io.FileUtils;
import org.apache.directory.shared.ldap.model.entry.BinaryValue;
import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.StringValue;
import org.apache.directory.shared.ldap.model.entry.Value;
import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -384,17 +384,17 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGetBytes() throws LdapInvalidAttributeValueException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atPwd );
+ Attribute attr1 = new DefaultEntryAttribute( atPwd );
attr1.add( ( byte[] ) null );
assertNull( attr1.getBytes() );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
attr2.add( BYTES1, BYTES2 );
assertTrue( Arrays.equals( BYTES1, attr2.getBytes() ) );
- EntryAttribute attr3 = new DefaultEntryAttribute( atCN );
+ Attribute attr3 = new DefaultEntryAttribute( atCN );
attr3.add( "a", "b" );
@@ -416,7 +416,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGetId()
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
assertEquals( "2.5.4.3", attr.getId() );
@@ -439,16 +439,16 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGetString() throws LdapInvalidAttributeValueException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
assertEquals( 1, attr1.add( ( String ) null ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atDC );
+ Attribute attr2 = new DefaultEntryAttribute( atDC );
attr2.add( "a" );
assertEquals( "a", attr2.getString() );
- EntryAttribute attr3 = new DefaultEntryAttribute( atPwd );
+ Attribute attr3 = new DefaultEntryAttribute( atPwd );
attr3.add( BYTES1, BYTES2 );
@@ -470,7 +470,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGetUpId()
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
assertNotNull( attr.getUpId() );
assertEquals( "cn", attr.getUpId() );
@@ -492,8 +492,8 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testHashCode() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
- EntryAttribute attr2 = new DefaultEntryAttribute( atSN );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr2 = new DefaultEntryAttribute( atSN );
assertNotSame( attr1.hashCode(), attr2.hashCode() );
attr2.apply( atDC );
@@ -516,8 +516,8 @@ public class SchemaAwareEntryAttributeTe
attr2.add( "b", "a" );
assertNotSame( attr1.hashCode(), attr2.hashCode() );
- EntryAttribute attr3 = new DefaultEntryAttribute( atPwd );
- EntryAttribute attr4 = new DefaultEntryAttribute( atPwd );
+ Attribute attr3 = new DefaultEntryAttribute( atPwd );
+ Attribute attr4 = new DefaultEntryAttribute( atPwd );
assertNotSame( attr3.hashCode(), attr4.hashCode() );
attr3.add( ( byte[] ) null );
@@ -551,7 +551,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testSetId()
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
attr.setUpId( "Cn" );
assertEquals( "2.5.4.3", attr.getId() );
@@ -599,7 +599,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testIsValid() throws Exception
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
// No value, this should not be valid
assertFalse( attr.isValid( atCN.getEquality().getSyntax().getSyntaxChecker() ) );
@@ -630,21 +630,21 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testAddValueArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
int nbAdded = attr1.add( (String)null );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHumanReadable() );
assertEquals( NULL_STRING_VALUE, attr1.get() );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
nbAdded = attr2.add( new BinaryValue( atPwd, null ) );
assertEquals( 1, nbAdded );
assertFalse( attr2.isHumanReadable() );
assertEquals( NULL_BINARY_VALUE, attr2.get() );
- EntryAttribute attr3 = new DefaultEntryAttribute( atCN );
+ Attribute attr3 = new DefaultEntryAttribute( atCN );
nbAdded = attr3.add( new StringValue( atCN, "a" ), new StringValue( atCN, "b" ) );
assertEquals( 2, nbAdded );
@@ -652,7 +652,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr3.contains( "a" ) );
assertTrue( attr3.contains( "b" ) );
- EntryAttribute attr4 = new DefaultEntryAttribute( atCN );
+ Attribute attr4 = new DefaultEntryAttribute( atCN );
nbAdded = attr4.add( new BinaryValue( atPwd, BYTES1 ), new BinaryValue( atPwd, BYTES2 ) );
assertEquals( 0, nbAdded );
@@ -660,7 +660,7 @@ public class SchemaAwareEntryAttributeTe
assertFalse( attr4.contains( BYTES1 ) );
assertFalse( attr4.contains( BYTES2 ) );
- EntryAttribute attr5 = new DefaultEntryAttribute( atCN );
+ Attribute attr5 = new DefaultEntryAttribute( atCN );
nbAdded = attr5.add( new StringValue( atCN, "c" ), new BinaryValue( atPwd, BYTES1 ) );
assertEquals( 1, nbAdded );
@@ -668,7 +668,7 @@ public class SchemaAwareEntryAttributeTe
assertFalse( attr5.contains( "ab" ) );
assertTrue( attr5.contains( "c" ) );
- EntryAttribute attr6 = new DefaultEntryAttribute( atPwd );
+ Attribute attr6 = new DefaultEntryAttribute( atPwd );
nbAdded = attr6.add( new BinaryValue( atPwd, BYTES1 ), new StringValue( atCN, "c" ) );
assertEquals( 1, nbAdded );
@@ -676,7 +676,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr6.contains( BYTES1 ) );
assertFalse( attr6.contains( BYTES3 ) );
- EntryAttribute attr7 = new DefaultEntryAttribute( atPwd );
+ Attribute attr7 = new DefaultEntryAttribute( atPwd );
nbAdded = attr7.add( new BinaryValue( atPwd, null ), new StringValue( atCN, "c" ) );
assertEquals( 1, nbAdded );
@@ -684,7 +684,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr7.contains( NULL_BINARY_VALUE ) );
assertFalse( attr7.contains( BYTES3 ) );
- EntryAttribute attr8 = new DefaultEntryAttribute( atDC );
+ Attribute attr8 = new DefaultEntryAttribute( atDC );
nbAdded = attr8.add( new StringValue( atDC, null ), new BinaryValue( atPwd, BYTES1 ) );
assertEquals( 1, nbAdded );
@@ -692,7 +692,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr8.contains( NULL_STRING_VALUE ) );
assertFalse( attr8.contains( "ab" ) );
- EntryAttribute attr9 = new DefaultEntryAttribute( atDC );
+ Attribute attr9 = new DefaultEntryAttribute( atDC );
nbAdded = attr9.add( new StringValue( ( String ) null ), new StringValue( "ab" ) );
assertEquals( 2, nbAdded );
@@ -700,7 +700,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr9.contains( NULL_STRING_VALUE ) );
assertTrue( attr9.contains( "ab" ) );
- EntryAttribute attr10 = new DefaultEntryAttribute( atPwd );
+ Attribute attr10 = new DefaultEntryAttribute( atPwd );
nbAdded = attr10.add( new BinaryValue( ( byte[] ) null ), new BinaryValue( BYTES1 ) );
assertEquals( 2, nbAdded );
@@ -716,28 +716,28 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testAddStringArray() throws LdapInvalidAttributeValueException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
int nbAdded = attr1.add( ( String ) null );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHumanReadable() );
assertEquals( NULL_STRING_VALUE, attr1.get() );
- EntryAttribute attr2 = new DefaultEntryAttribute( atDC );
+ Attribute attr2 = new DefaultEntryAttribute( atDC );
nbAdded = attr2.add( "" );
assertEquals( 1, nbAdded );
assertTrue( attr2.isHumanReadable() );
assertEquals( "", attr2.getString() );
- EntryAttribute attr3 = new DefaultEntryAttribute( atCN );
+ Attribute attr3 = new DefaultEntryAttribute( atCN );
nbAdded = attr3.add( "t" );
assertEquals( 1, nbAdded );
assertTrue( attr3.isHumanReadable() );
assertEquals( "t", attr3.getString() );
- EntryAttribute attr4 = new DefaultEntryAttribute( atCN );
+ Attribute attr4 = new DefaultEntryAttribute( atCN );
nbAdded = attr4.add( "a", "b", "c", "d" );
assertEquals( 4, nbAdded );
@@ -769,7 +769,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr4.contains( "e" ) );
assertFalse( attr4.contains( "ab" ) );
- EntryAttribute attr5 = new DefaultEntryAttribute( atEMail );
+ Attribute attr5 = new DefaultEntryAttribute( atEMail );
nbAdded = attr5.add( "a", "b", ( String ) null, "d" );
assertEquals( 4, nbAdded );
@@ -779,7 +779,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr5.contains( NULL_STRING_VALUE ) );
assertTrue( attr5.contains( "d" ) );
- EntryAttribute attr6 = new DefaultEntryAttribute( atPwd );
+ Attribute attr6 = new DefaultEntryAttribute( atPwd );
nbAdded = attr6.add( "a", ( String ) null );
assertEquals( 2, nbAdded );
@@ -793,28 +793,28 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testAddByteArray() throws LdapInvalidAttributeValueException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atPwd );
+ Attribute attr1 = new DefaultEntryAttribute( atPwd );
int nbAdded = attr1.add( ( byte[] ) null );
assertEquals( 1, nbAdded );
assertFalse( attr1.isHumanReadable() );
assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
nbAdded = attr2.add( StringConstants.EMPTY_BYTES );
assertEquals( 1, nbAdded );
assertFalse( attr2.isHumanReadable() );
assertTrue( Arrays.equals( StringConstants.EMPTY_BYTES, attr2.getBytes() ) );
- EntryAttribute attr3 = new DefaultEntryAttribute( atPwd );
+ Attribute attr3 = new DefaultEntryAttribute( atPwd );
nbAdded = attr3.add( BYTES1 );
assertEquals( 1, nbAdded );
assertFalse( attr3.isHumanReadable() );
assertTrue( Arrays.equals( BYTES1, attr3.getBytes() ) );
- EntryAttribute attr4 = new DefaultEntryAttribute( atPwd );
+ Attribute attr4 = new DefaultEntryAttribute( atPwd );
nbAdded = attr4.add( BYTES1, BYTES2, BYTES3, BYTES4 );
assertEquals( 4, nbAdded );
@@ -824,7 +824,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr4.contains( BYTES3 ) );
assertTrue( attr4.contains( BYTES4 ) );
- EntryAttribute attr5 = new DefaultEntryAttribute( atPwd );
+ Attribute attr5 = new DefaultEntryAttribute( atPwd );
nbAdded = attr5.add( BYTES1, BYTES2, ( byte[] ) null, BYTES3 );
assertEquals( 4, nbAdded );
@@ -834,7 +834,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr5.contains( ( byte[] ) null ) );
assertTrue( attr5.contains( BYTES3 ) );
- EntryAttribute attr6 = new DefaultEntryAttribute( atPwd );
+ Attribute attr6 = new DefaultEntryAttribute( atPwd );
nbAdded = attr6.add( "ab", ( String ) null );
assertEquals( 2, nbAdded );
@@ -848,7 +848,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testClear() throws LdapException
{
- EntryAttribute attr = new DefaultEntryAttribute( "email", atEMail );
+ Attribute attr = new DefaultEntryAttribute( "email", atEMail );
assertEquals( 0, attr.size() );
@@ -868,7 +868,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testContainsValueArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atEMail );
+ Attribute attr1 = new DefaultEntryAttribute( atEMail );
assertEquals( 0, attr1.size() );
assertFalse( attr1.contains( STR_VALUE1 ) );
@@ -891,7 +891,7 @@ public class SchemaAwareEntryAttributeTe
assertFalse( attr1.contains( STR_VALUE4 ) );
assertFalse( attr1.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
assertEquals( 0, attr2.size() );
assertFalse( attr2.contains( BYTES1 ) );
assertFalse( attr2.contains( NULL_BINARY_VALUE ) );
@@ -919,7 +919,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testContainsStringArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atEMail );
+ Attribute attr1 = new DefaultEntryAttribute( atEMail );
assertEquals( 0, attr1.size() );
assertFalse( attr1.contains( "a" ) );
@@ -949,7 +949,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testContainsByteArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atPwd );
+ Attribute attr1 = new DefaultEntryAttribute( atPwd );
assertEquals( 0, attr1.size() );
assertFalse( attr1.contains( BYTES1 ) );
@@ -979,11 +979,11 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testEquals() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atCN );
+ Attribute attr1 = new DefaultEntryAttribute( atCN );
assertFalse( attr1.equals( null ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atCN );
+ Attribute attr2 = new DefaultEntryAttribute( atCN );
assertTrue( attr1.equals( attr2 ) );
@@ -1002,30 +1002,30 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.equals( attr2 ) );
- EntryAttribute attr3 = new DefaultEntryAttribute( atPwd );
- EntryAttribute attr4 = new DefaultEntryAttribute( atPwd );
+ Attribute attr3 = new DefaultEntryAttribute( atPwd );
+ Attribute attr4 = new DefaultEntryAttribute( atPwd );
attr3.add( NULL_BINARY_VALUE );
attr4.add( NULL_BINARY_VALUE );
assertTrue( attr3.equals( attr4 ) );
- EntryAttribute attr5 = new DefaultEntryAttribute( atPwd );
- EntryAttribute attr6 = new DefaultEntryAttribute( atDC );
+ Attribute attr5 = new DefaultEntryAttribute( atPwd );
+ Attribute attr6 = new DefaultEntryAttribute( atDC );
assertFalse( attr5.equals( attr6 ) );
attr5.add( NULL_BINARY_VALUE );
attr6.add( NULL_STRING_VALUE );
assertFalse( attr5.equals( attr6 ) );
- EntryAttribute attr7 = new DefaultEntryAttribute( atCN );
- EntryAttribute attr8 = new DefaultEntryAttribute( atPwd );
+ Attribute attr7 = new DefaultEntryAttribute( atCN );
+ Attribute attr8 = new DefaultEntryAttribute( atPwd );
attr7.add( "a" );
attr8.add( BYTES2 );
assertFalse( attr7.equals( attr8 ) );
- EntryAttribute attr9 = new DefaultEntryAttribute( atCN );
- EntryAttribute attr10 = new DefaultEntryAttribute( atPwd );
+ Attribute attr9 = new DefaultEntryAttribute( atCN );
+ Attribute attr10 = new DefaultEntryAttribute( atPwd );
attr9.add( "a" );
attr9.add( BYTES2 );
@@ -1040,12 +1040,12 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGet() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( "dc", atDC );
+ Attribute attr1 = new DefaultEntryAttribute( "dc", atDC );
attr1.add( ( String ) null );
assertEquals( NULL_STRING_VALUE, attr1.get() );
- EntryAttribute attr2 = new DefaultEntryAttribute( "email", atEMail );
+ Attribute attr2 = new DefaultEntryAttribute( "email", atEMail );
attr2.add( "a", "b", "c" );
assertEquals( "a", attr2.get().getString() );
@@ -1059,7 +1059,7 @@ public class SchemaAwareEntryAttributeTe
attr2.remove( "c" );
assertNull( attr2.get() );
- EntryAttribute attr3 = new DefaultEntryAttribute( "userPassword", atPwd );
+ Attribute attr3 = new DefaultEntryAttribute( "userPassword", atPwd );
attr3.add( BYTES1, BYTES2, BYTES3 );
assertTrue( Arrays.equals( BYTES1, attr3.get().getBytes() ) );
@@ -1081,7 +1081,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGetAll() throws LdapException
{
- EntryAttribute attr = new DefaultEntryAttribute( atEMail );
+ Attribute attr = new DefaultEntryAttribute( atEMail );
Iterator<Value<?>> iterator = attr.getAll();
assertFalse( iterator.hasNext() );
@@ -1113,14 +1113,14 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testSize() throws Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
assertEquals( 0, attr1.size() );
attr1.add( ( String ) null );
assertEquals( 1, attr1.size() );
- EntryAttribute attr2 = new DefaultEntryAttribute( atCN );
+ Attribute attr2 = new DefaultEntryAttribute( atCN );
attr2.add( "a", "b" );
assertEquals( 2, attr2.size() );
@@ -1128,7 +1128,7 @@ public class SchemaAwareEntryAttributeTe
attr2.clear();
assertEquals( 0, attr2.size() );
- EntryAttribute attr3 = new DefaultEntryAttribute( atC );
+ Attribute attr3 = new DefaultEntryAttribute( atC );
attr3.add( "US" );
assertEquals( 1, attr3.size() );
@@ -1145,28 +1145,28 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testPutByteArray() throws InvalidAttributeValueException, Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atPwd );
+ Attribute attr1 = new DefaultEntryAttribute( atPwd );
int nbAdded = attr1.add( ( byte[] ) null );
assertEquals( 1, nbAdded );
assertFalse( attr1.isHumanReadable() );
assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
nbAdded = attr2.add( StringConstants.EMPTY_BYTES );
assertEquals( 1, nbAdded );
assertFalse( attr2.isHumanReadable() );
assertTrue( Arrays.equals( StringConstants.EMPTY_BYTES, attr2.getBytes() ) );
- EntryAttribute attr3 = new DefaultEntryAttribute( atPwd );
+ Attribute attr3 = new DefaultEntryAttribute( atPwd );
nbAdded = attr3.add( BYTES1 );
assertEquals( 1, nbAdded );
assertFalse( attr3.isHumanReadable() );
assertTrue( Arrays.equals( BYTES1, attr3.getBytes() ) );
- EntryAttribute attr4 = new DefaultEntryAttribute( atPwd );
+ Attribute attr4 = new DefaultEntryAttribute( atPwd );
nbAdded = attr4.add( BYTES1, BYTES2 );
assertEquals( 2, nbAdded );
@@ -1181,7 +1181,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr4.contains( BYTES3 ) );
assertTrue( attr4.contains( BYTES4 ) );
- EntryAttribute attr5 = new DefaultEntryAttribute( atPwd );
+ Attribute attr5 = new DefaultEntryAttribute( atPwd );
nbAdded = attr5.add( BYTES1, BYTES2, ( byte[] ) null, BYTES3 );
assertEquals( 4, nbAdded );
@@ -1191,7 +1191,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr5.contains( ( byte[] ) null ) );
assertTrue( attr5.contains( BYTES3 ) );
- EntryAttribute attr6 = new DefaultEntryAttribute( atPwd );
+ Attribute attr6 = new DefaultEntryAttribute( atPwd );
assertFalse( attr6.isHumanReadable() );
nbAdded = attr6.add( BYTES1, ( byte[] ) null );
@@ -1207,28 +1207,28 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testPutStringArray() throws LdapInvalidAttributeValueException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
int nbAdded = attr1.add( ( String ) null );
assertEquals( 1, nbAdded );
assertTrue( attr1.isHumanReadable() );
assertEquals( NULL_STRING_VALUE, attr1.get() );
- EntryAttribute attr2 = new DefaultEntryAttribute( atDC );
+ Attribute attr2 = new DefaultEntryAttribute( atDC );
nbAdded = attr2.add( "" );
assertEquals( 1, nbAdded );
assertTrue( attr2.isHumanReadable() );
assertEquals( "", attr2.getString() );
- EntryAttribute attr3 = new DefaultEntryAttribute( atDC );
+ Attribute attr3 = new DefaultEntryAttribute( atDC );
nbAdded = attr3.add( "t" );
assertEquals( 1, nbAdded );
assertTrue( attr3.isHumanReadable() );
assertEquals( "t", attr3.getString() );
- EntryAttribute attr4 = new DefaultEntryAttribute( atEMail );
+ Attribute attr4 = new DefaultEntryAttribute( atEMail );
nbAdded = attr4.add( "a", "b", "c", "d" );
assertEquals( 4, nbAdded );
@@ -1255,7 +1255,7 @@ public class SchemaAwareEntryAttributeTe
assertEquals( 0, nbAdded );
assertTrue( attr4.isHumanReadable() );
- EntryAttribute attr5 = new DefaultEntryAttribute( atEMail );
+ Attribute attr5 = new DefaultEntryAttribute( atEMail );
nbAdded = attr5.add( "a", "b", ( String ) null, "d" );
assertEquals( 4, nbAdded );
@@ -1265,7 +1265,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr5.contains( NULL_STRING_VALUE ) );
assertTrue( attr5.contains( "d" ) );
- EntryAttribute attr6 = new DefaultEntryAttribute( atPwd );
+ Attribute attr6 = new DefaultEntryAttribute( atPwd );
nbAdded = attr6.add( "a", ( String ) null );
assertEquals( 2, nbAdded );
@@ -1279,7 +1279,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testPutValueArray() throws Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC );
+ Attribute attr1 = new DefaultEntryAttribute( atDC );
assertEquals( 0, attr1.size() );
@@ -1308,7 +1308,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( NULL_STRING_VALUE ) );
assertFalse( attr1.contains( STR_VALUE3 ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
assertEquals( 0, attr2.size() );
attr2.add( NULL_BINARY_VALUE );
@@ -1337,7 +1337,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testRemoveValueArray() throws Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atEMail );
+ Attribute attr1 = new DefaultEntryAttribute( atEMail );
assertFalse( attr1.remove( STR_VALUE1 ) );
@@ -1366,7 +1366,7 @@ public class SchemaAwareEntryAttributeTe
assertFalse( attr1.remove( NULL_STRING_VALUE, STR_VALUE1, BIN_VALUE3 ) );
assertEquals( 1, attr1.size() );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd );
assertFalse( attr2.remove( BIN_VALUE1 ) );
@@ -1404,7 +1404,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testRemoveByteArray() throws Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atPwd );
+ Attribute attr1 = new DefaultEntryAttribute( atPwd );
assertFalse( attr1.remove( BYTES1 ) );
@@ -1435,7 +1435,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testRemoveStringArray() throws Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atEMail );
+ Attribute attr1 = new DefaultEntryAttribute( atEMail );
assertFalse( attr1.remove( "a" ) );
@@ -1458,7 +1458,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.remove( ( String ) null, "a" ) );
assertEquals( 1, attr1.size() );
- EntryAttribute attr2 = new DefaultEntryAttribute( "test" );
+ Attribute attr2 = new DefaultEntryAttribute( "test" );
attr2.add( BYTES1, BYTES2, BYTES3 );
@@ -1474,7 +1474,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testIterator() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atCN );
+ Attribute attr1 = new DefaultEntryAttribute( atCN );
attr1.add( "a", "b", "c" );
Iterator<Value<?>> iter = attr1.iterator();
@@ -1499,7 +1499,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testToString() throws LdapException
{
- EntryAttribute attr = new DefaultEntryAttribute( atEMail );
+ Attribute attr = new DefaultEntryAttribute( atEMail );
assertEquals( " email: (null)\n", attr.toString() );
@@ -1521,7 +1521,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testInstanceOf() throws Exception
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
assertTrue( attr.isInstanceOf( atCN ) );
assertTrue( attr.isInstanceOf( atName) );
@@ -1535,7 +1535,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testSetUpIdStringAttributeType() throws Exception
{
- EntryAttribute attr = new DefaultEntryAttribute( atSN );
+ Attribute attr = new DefaultEntryAttribute( atSN );
attr.setUpId( null, atCN );
assertEquals( "2.5.4.3", attr.getId() );
@@ -1591,7 +1591,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testSetUpIdString() throws Exception
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
attr.setUpId( "cn" );
assertEquals( "2.5.4.3", attr.getId() );
@@ -1680,7 +1680,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testSetAttributeType() throws Exception
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
try
{
@@ -1706,7 +1706,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testGetAttributeType() throws Exception
{
- EntryAttribute attr = new DefaultEntryAttribute( atSN );
+ Attribute attr = new DefaultEntryAttribute( atSN );
assertEquals( atSN, attr.getAttributeType() );
}
@@ -1717,7 +1717,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeAttributeType()
{
- EntryAttribute attr = new DefaultEntryAttribute( atCN );
+ Attribute attr = new DefaultEntryAttribute( atCN );
assertTrue( attr.isHumanReadable() );
assertEquals( 0, attr.size() );
@@ -1733,7 +1733,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeStringAttributeType()
{
- EntryAttribute attr1 = new DefaultEntryAttribute( "cn", atCN );
+ Attribute attr1 = new DefaultEntryAttribute( "cn", atCN );
assertTrue( attr1.isHumanReadable() );
assertEquals( 0, attr1.size() );
@@ -1741,7 +1741,7 @@ public class SchemaAwareEntryAttributeTe
assertEquals( "cn", attr1.getUpId() );
assertEquals( atCN, attr1.getAttributeType() );
- EntryAttribute attr2 = new DefaultEntryAttribute( " CommonName ", atCN );
+ Attribute attr2 = new DefaultEntryAttribute( " CommonName ", atCN );
assertTrue( attr2.isHumanReadable() );
assertEquals( 0, attr2.size() );
@@ -1749,7 +1749,7 @@ public class SchemaAwareEntryAttributeTe
assertEquals( " CommonName ", attr2.getUpId() );
assertEquals( atCN, attr2.getAttributeType() );
- EntryAttribute attr3 = new DefaultEntryAttribute( " ", atCN );
+ Attribute attr3 = new DefaultEntryAttribute( " ", atCN );
assertTrue( attr3.isHumanReadable() );
assertEquals( 0, attr3.size() );
@@ -1765,7 +1765,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeAttributeTypeValueArray() throws Exception
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atDC, STR_VALUE1, STR_VALUE2, NULL_STRING_VALUE );
+ Attribute attr1 = new DefaultEntryAttribute( atDC, STR_VALUE1, STR_VALUE2, NULL_STRING_VALUE );
assertTrue( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1775,7 +1775,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( "a", "b" ) );
assertTrue( attr1.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atDC, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
+ Attribute attr2 = new DefaultEntryAttribute( atDC, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
assertTrue( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1793,7 +1793,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeStringAttributeTypeValueArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( "dc", atDC, STR_VALUE1, STR_VALUE2, NULL_STRING_VALUE );
+ Attribute attr1 = new DefaultEntryAttribute( "dc", atDC, STR_VALUE1, STR_VALUE2, NULL_STRING_VALUE );
assertTrue( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1803,7 +1803,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( "a", "b" ) );
assertTrue( attr1.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atDC, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
+ Attribute attr2 = new DefaultEntryAttribute( atDC, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
assertTrue( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1813,7 +1813,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr2.contains( "a" ) );
assertTrue( attr2.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr3 = new DefaultEntryAttribute( "DomainComponent", atDC, STR_VALUE1, STR_VALUE2,
+ Attribute attr3 = new DefaultEntryAttribute( "DomainComponent", atDC, STR_VALUE1, STR_VALUE2,
NULL_STRING_VALUE );
assertTrue( attr3.isHumanReadable() );
@@ -1824,7 +1824,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr3.contains( "a", "b" ) );
assertTrue( attr3.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr4 = new DefaultEntryAttribute( " 0.9.2342.19200300.100.1.25 ", atDC, STR_VALUE1, STR_VALUE2,
+ Attribute attr4 = new DefaultEntryAttribute( " 0.9.2342.19200300.100.1.25 ", atDC, STR_VALUE1, STR_VALUE2,
NULL_STRING_VALUE );
assertTrue( attr4.isHumanReadable() );
@@ -1843,7 +1843,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeAttributeTypeStringArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atEMail, "a", "b", ( String ) null );
+ Attribute attr1 = new DefaultEntryAttribute( atEMail, "a", "b", ( String ) null );
assertTrue( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1853,7 +1853,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( "a", "b" ) );
assertTrue( attr1.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atEMail, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
+ Attribute attr2 = new DefaultEntryAttribute( atEMail, STR_VALUE1, BIN_VALUE2, NULL_STRING_VALUE );
assertTrue( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1871,7 +1871,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeStringAttributeTypeStringArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( "email", atEMail, "a", "b", ( String ) null );
+ Attribute attr1 = new DefaultEntryAttribute( "email", atEMail, "a", "b", ( String ) null );
assertTrue( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1881,7 +1881,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( "a", "b" ) );
assertTrue( attr1.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( "EMail", atEMail, "a", "b", ( String ) null );
+ Attribute attr2 = new DefaultEntryAttribute( "EMail", atEMail, "a", "b", ( String ) null );
assertTrue( attr2.isHumanReadable() );
assertEquals( 3, attr2.size() );
@@ -1891,7 +1891,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr2.contains( "a", "b" ) );
assertTrue( attr2.contains( NULL_STRING_VALUE ) );
- EntryAttribute attr3 = new DefaultEntryAttribute( " 1.2.840.113549.1.9.1 ", atEMail, "a", "b",
+ Attribute attr3 = new DefaultEntryAttribute( " 1.2.840.113549.1.9.1 ", atEMail, "a", "b",
( String ) null );
assertTrue( attr3.isHumanReadable() );
@@ -1910,7 +1910,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeAttributeTypeByteArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null );
+ Attribute attr1 = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null );
assertFalse( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1920,7 +1920,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( BYTES1, BYTES2 ) );
assertTrue( attr1.contains( NULL_BINARY_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( atPwd, STR_VALUE1, BIN_VALUE2, NULL_BINARY_VALUE );
+ Attribute attr2 = new DefaultEntryAttribute( atPwd, STR_VALUE1, BIN_VALUE2, NULL_BINARY_VALUE );
assertFalse( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1938,7 +1938,7 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testDefaultServerAttributeStringAttributeTypeByteArray() throws LdapException
{
- EntryAttribute attr1 = new DefaultEntryAttribute( "userPassword", atPwd, BYTES1, BYTES2, ( byte[] ) null );
+ Attribute attr1 = new DefaultEntryAttribute( "userPassword", atPwd, BYTES1, BYTES2, ( byte[] ) null );
assertFalse( attr1.isHumanReadable() );
assertEquals( 3, attr1.size() );
@@ -1948,7 +1948,7 @@ public class SchemaAwareEntryAttributeTe
assertTrue( attr1.contains( BYTES1, BYTES2 ) );
assertTrue( attr1.contains( NULL_BINARY_VALUE ) );
- EntryAttribute attr2 = new DefaultEntryAttribute( "2.5.4.35", atPwd, STR_VALUE1, BIN_VALUE2, NULL_BINARY_VALUE );
+ Attribute attr2 = new DefaultEntryAttribute( "2.5.4.35", atPwd, STR_VALUE1, BIN_VALUE2, NULL_BINARY_VALUE );
assertFalse( attr2.isHumanReadable() );
assertEquals( 2, attr2.size() );
@@ -1966,9 +1966,9 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testClone() throws LdapException
{
- EntryAttribute attr = new DefaultEntryAttribute( atDC );
+ Attribute attr = new DefaultEntryAttribute( atDC );
- EntryAttribute clone = attr.clone();
+ Attribute clone = attr.clone();
assertEquals( attr, clone );
attr.setUpId( "DomainComponent" );
@@ -1992,15 +1992,15 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testCopyConstructorServerAttribute() throws LdapException
{
- EntryAttribute attribute = new DefaultEntryAttribute( atCN );
+ Attribute attribute = new DefaultEntryAttribute( atCN );
- EntryAttribute copy = new DefaultEntryAttribute( atCN, attribute );
+ Attribute copy = new DefaultEntryAttribute( atCN, attribute );
assertEquals( copy, attribute );
- EntryAttribute attribute2 = new DefaultEntryAttribute( atCN, "test" );
+ Attribute attribute2 = new DefaultEntryAttribute( atCN, "test" );
- EntryAttribute copy2 = new DefaultEntryAttribute( atCN, attribute2 );
+ Attribute copy2 = new DefaultEntryAttribute( atCN, attribute2 );
assertEquals( copy2, attribute2 );
attribute2.add( "test2" );
@@ -2015,10 +2015,10 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testCopyConstructorClientAttribute() throws LdapException
{
- EntryAttribute attribute = new DefaultEntryAttribute( "commonName" );
+ Attribute attribute = new DefaultEntryAttribute( "commonName" );
attribute.add( "test" );
- EntryAttribute copy = new DefaultEntryAttribute( atCN, attribute );
+ Attribute copy = new DefaultEntryAttribute( atCN, attribute );
assertEquals( atCN, copy.getAttributeType() );
assertEquals( "test", copy.getString() );
@@ -2035,11 +2035,11 @@ public class SchemaAwareEntryAttributeTe
@Test
public void testToClientAttribute() throws LdapException
{
- EntryAttribute attribute = new DefaultEntryAttribute( atCN, "test", "test2" );
+ Attribute attribute = new DefaultEntryAttribute( atCN, "test", "test2" );
- EntryAttribute clientAttribute = attribute.clone();
+ Attribute clientAttribute = attribute.clone();
- assertTrue( clientAttribute instanceof EntryAttribute );
+ assertTrue( clientAttribute instanceof Attribute );
assertTrue( clientAttribute.contains( "test", "test2" ) );
assertEquals( "2.5.4.3", clientAttribute.getId() );
Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java?rev=1087506&r1=1087505&r2=1087506&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java Thu Mar 31 23:29:24 2011
@@ -45,7 +45,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.StringValue;
import org.apache.directory.shared.ldap.model.entry.Value;
import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -251,11 +251,11 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute oc = new DefaultEntryAttribute( atObjectClass, "top", "person" );
- EntryAttribute cn = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute sn = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute up = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
- EntryAttribute email = new DefaultEntryAttribute( atEMail, "FR", "US" );
+ Attribute oc = new DefaultEntryAttribute( atObjectClass, "top", "person" );
+ Attribute cn = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute sn = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute up = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute email = new DefaultEntryAttribute( atEMail, "FR", "US" );
entry.add( oc, cn, sn, email );
@@ -265,17 +265,17 @@ public class SchemaAwareEntryTest
assertTrue( entry.containsAttribute( " sn " ) );
assertTrue( entry.containsAttribute( " email " ) );
- EntryAttribute attr = entry.get( "objectclass" );
+ Attribute attr = entry.get( "objectclass" );
assertEquals( 2, attr.size() );
- EntryAttribute email2 = new DefaultEntryAttribute( atEMail, "UK", "DE" );
+ Attribute email2 = new DefaultEntryAttribute( atEMail, "UK", "DE" );
entry.add( email2, up );
assertEquals( 5, entry.size() );
assertTrue( entry.containsAttribute( "userPassword" ) );
assertTrue( entry.containsAttribute( " email " ) );
- EntryAttribute attrC = entry.get( "email" );
+ Attribute attrC = entry.get( "email" );
assertEquals( 4, attrC.size() );
entry.clear();
@@ -292,7 +292,7 @@ public class SchemaAwareEntryTest
entry.add( "userPassword", ( byte[] ) null );
assertEquals( 1, entry.size() );
- EntryAttribute attributePWD = entry.get( "userPassword" );
+ Attribute attributePWD = entry.get( "userPassword" );
assertEquals( 1, attributePWD.size() );
assertNotNull( attributePWD.get() );
assertNull( attributePWD.get().getValue() );
@@ -301,7 +301,7 @@ public class SchemaAwareEntryTest
entry.add( "userPassword", BYTES1, BYTES1, BYTES2 );
assertEquals( 1, entry.size() );
- EntryAttribute attributeJPG = entry.get( "userPassword" );
+ Attribute attributeJPG = entry.get( "userPassword" );
assertEquals( 2, attributeJPG.size() );
assertNotNull( attributeJPG.get() );
assertTrue( attributeJPG.contains( BYTES1 ) );
@@ -336,14 +336,14 @@ public class SchemaAwareEntryTest
entry.add( "dc", ( String ) null );
assertEquals( 1, entry.size() );
- EntryAttribute attributeDC = entry.get( "dc" );
+ Attribute attributeDC = entry.get( "dc" );
assertEquals( 1, attributeDC.size() );
assertNotNull( attributeDC.get() );
entry.add( "sn", "test", "test", "TEST" );
assertEquals( 2, entry.size() );
- EntryAttribute attributeSN = entry.get( "sn" );
+ Attribute attributeSN = entry.get( "sn" );
// 'TEST' and 'test' are the same value for 'sn' (this is a case insensitive attributeType)
assertEquals( 1, attributeSN.size() );
@@ -381,7 +381,7 @@ public class SchemaAwareEntryTest
entry.add( "dc", value );
assertEquals( 1, entry.size() );
- EntryAttribute attributeCN = entry.get( "dc" );
+ Attribute attributeCN = entry.get( "dc" );
assertEquals( 1, attributeCN.size() );
assertNotNull( attributeCN.get() );
assertNull( attributeCN.get().getValue() );
@@ -392,7 +392,7 @@ public class SchemaAwareEntryTest
entry.add( "sn", value1, value2, value3 );
assertEquals( 2, entry.size() );
- EntryAttribute attributeSN = entry.get( "sn" );
+ Attribute attributeSN = entry.get( "sn" );
assertEquals( 2, attributeSN.size() );
assertNotNull( attributeSN.get() );
assertTrue( attributeSN.contains( value1 ) );
@@ -401,7 +401,7 @@ public class SchemaAwareEntryTest
Value<byte[]> value4 = new BinaryValue( atPwd, BYTES1 );
entry.add( "l", value1, value4 );
assertEquals( 3, entry.size() );
- EntryAttribute attributeL = entry.get( "l" );
+ Attribute attributeL = entry.get( "l" );
// Cannot store a binary value in a String attribute
assertEquals( 1, attributeL.size() );
@@ -438,7 +438,7 @@ public class SchemaAwareEntryTest
entry.add( atPwd, ( byte[] ) null, BYTES1 );
assertEquals( 1, entry.size() );
- EntryAttribute attribute = entry.get( atPwd );
+ Attribute attribute = entry.get( atPwd );
assertEquals( 3, attribute.size() );
assertTrue( attribute.contains( BYTES1 ) );
assertTrue( attribute.contains( BYTES2 ) );
@@ -461,7 +461,7 @@ public class SchemaAwareEntryTest
entry.add( atC, "de", "fr" );
assertEquals( 1, entry.size() );
- EntryAttribute attribute = entry.get( atC );
+ Attribute attribute = entry.get( atC );
assertEquals( 0, attribute.size() );
assertFalse( attribute.contains( "de" ) );
assertFalse( attribute.contains( "fr" ) );
@@ -534,7 +534,7 @@ public class SchemaAwareEntryTest
entry.add( " UserPassword ", atPwd, ( byte[] ) null, BYTES1 );
assertEquals( 1, entry.size() );
- EntryAttribute attribute = entry.get( atPwd );
+ Attribute attribute = entry.get( atPwd );
assertEquals( 3, attribute.size() );
assertTrue( attribute.contains( BYTES1 ) );
assertTrue( attribute.contains( BYTES2 ) );
@@ -571,7 +571,7 @@ public class SchemaAwareEntryTest
entry.add( " EMAIL ", atEMail, ( String ) null, "test1" );
assertEquals( 1, entry.size() );
- EntryAttribute attribute = entry.get( atEMail );
+ Attribute attribute = entry.get( atEMail );
assertEquals( 3, attribute.size() );
assertTrue( attribute.contains( "test1" ) );
assertTrue( attribute.contains( ( String ) null ) );
@@ -1421,7 +1421,7 @@ public class SchemaAwareEntryTest
assertFalse( entry.contains( ( AttributeType ) null, BYTES1 ) );
assertFalse( entry.contains( atPwd, BYTES1 ) );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
assertFalse( entry.contains( attrPWD ) );
@@ -1444,7 +1444,7 @@ public class SchemaAwareEntryTest
assertFalse( entry.contains( ( AttributeType ) null, "test" ) );
assertFalse( entry.contains( atCN, "test" ) );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
assertFalse( entry.contains( attrCN ) );
@@ -1477,8 +1477,8 @@ public class SchemaAwareEntryTest
assertFalse( entry.contains( ( String ) null, strValue1 ) );
assertFalse( entry.contains( atDC, binValue1 ) );
- EntryAttribute attrCN = new DefaultEntryAttribute( atDC, strValue1, strValue2 );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, binValue1, binValue2, binNullValue );
+ Attribute attrCN = new DefaultEntryAttribute( atDC, strValue1, strValue2 );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, binValue1, binValue2, binNullValue );
entry.add( attrCN, attrPWD );
@@ -1499,10 +1499,10 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
assertFalse( entry.contains( attrOC, attrCN ) );
@@ -1515,9 +1515,9 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( attrSN, attrPWD ) );
- assertFalse( entry.contains( ( EntryAttribute ) null ) );
+ assertFalse( entry.contains( ( Attribute ) null ) );
entry.clear();
- assertTrue( entry.contains( ( EntryAttribute ) null ) );
+ assertTrue( entry.contains( ( Attribute ) null ) );
}
@@ -1532,7 +1532,7 @@ public class SchemaAwareEntryTest
assertFalse( entry.contains( ( String ) null, BYTES3 ) );
assertFalse( entry.containsAttribute( "objectClass" ) );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
entry.add( attrPWD );
@@ -1556,7 +1556,7 @@ public class SchemaAwareEntryTest
assertFalse( entry.contains( ( String ) null, "test" ) );
assertFalse( entry.containsAttribute( "objectClass" ) );
- EntryAttribute attrEMail = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
+ Attribute attrEMail = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
entry.add( attrEMail );
@@ -1580,8 +1580,8 @@ public class SchemaAwareEntryTest
assertFalse( entry.contains( ( String ) null, "test" ) );
assertFalse( entry.containsAttribute( "objectClass" ) );
- EntryAttribute attrEMail = new DefaultEntryAttribute( atEMail, "test1", "test2", ( String ) null );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null );
+ Attribute attrEMail = new DefaultEntryAttribute( atEMail, "test1", "test2", ( String ) null );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null );
entry.add( attrEMail, attrPWD );
@@ -1614,10 +1614,10 @@ public class SchemaAwareEntryTest
assertFalse( entry.containsAttribute( atOC ) );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.add( attrOC, attrCN, attrSN, attrPWD );
@@ -1645,10 +1645,10 @@ public class SchemaAwareEntryTest
assertFalse( entry.containsAttribute( "objectClass" ) );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.add( attrOC, attrCN, attrSN, attrPWD );
@@ -1681,10 +1681,10 @@ public class SchemaAwareEntryTest
entry2.setDn( EXAMPLE_DN );
assertEquals( entry1, entry2 );
- EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( "cn", atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( "sn", atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( "objectClass", atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( "cn", atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( "sn", atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( "userPassword", atPwd, BYTES1, BYTES2 );
entry1.put( attrOC, attrCN, attrSN, attrPWD );
entry2.put( attrOC, attrCN, attrSN );
@@ -1693,8 +1693,8 @@ public class SchemaAwareEntryTest
entry2.put( attrPWD );
assertEquals( entry1, entry2 );
- EntryAttribute attrL1 = new DefaultEntryAttribute( "l", atL, "Paris", "New-York" );
- EntryAttribute attrL2 = new DefaultEntryAttribute( "l", atL, "Paris", "Tokyo" );
+ Attribute attrL1 = new DefaultEntryAttribute( "l", atL, "Paris", "New-York" );
+ Attribute attrL2 = new DefaultEntryAttribute( "l", atL, "Paris", "Tokyo" );
entry1.put( attrL1 );
entry2.put( attrL1 );
@@ -1722,10 +1722,10 @@ public class SchemaAwareEntryTest
assertEquals( 0, entry.getAttributeTypes().size() );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.add( attrOC, attrCN, attrSN, attrPWD );
@@ -1751,10 +1751,10 @@ public class SchemaAwareEntryTest
assertNull( entry.get( atCN ) );
assertNull( entry.get( ( AttributeType ) null ) );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.add( attrOC, attrCN, attrSN, attrPWD );
@@ -1778,10 +1778,10 @@ public class SchemaAwareEntryTest
assertNull( entry.get( "cn" ) );
assertNull( entry.get( "badId" ) );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.add( attrOC, attrCN, attrSN, attrPWD );
@@ -1830,10 +1830,10 @@ public class SchemaAwareEntryTest
entry2.setDn( EXAMPLE_DN );
assertEquals( entry1.hashCode(), entry2.hashCode() );
- EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( "cn", atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( "sn", atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( "objectClass", atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( "cn", atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( "sn", atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( "userPassword", atPwd, BYTES1, BYTES2 );
entry1.add( attrOC, attrCN, attrSN, attrPWD );
entry2.add( attrOC, attrCN, attrSN, attrPWD );
@@ -1855,7 +1855,7 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
assertFalse( entry.contains( attrOC ) );
assertFalse( entry.hasObjectClass( attrOC ) );
@@ -1864,14 +1864,14 @@ public class SchemaAwareEntryTest
assertTrue( entry.hasObjectClass( attrOC ) );
- EntryAttribute attrOC2 = new DefaultEntryAttribute( atOC, "person" );
+ Attribute attrOC2 = new DefaultEntryAttribute( atOC, "person" );
assertTrue( entry.hasObjectClass( attrOC2 ) );
- EntryAttribute attrOC3 = new DefaultEntryAttribute( atOC, "inetOrgPerson" );
+ Attribute attrOC3 = new DefaultEntryAttribute( atOC, "inetOrgPerson" );
assertFalse( entry.hasObjectClass( attrOC3 ) );
- assertFalse( entry.hasObjectClass( ( EntryAttribute ) null ) );
+ assertFalse( entry.hasObjectClass( ( Attribute ) null ) );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "top" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "top" );
assertFalse( entry.hasObjectClass( attrCN ) );
}
@@ -1938,14 +1938,14 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.put( attrOC, attrCN, attrSN, attrPWD );
- Iterator<EntryAttribute> iterator = entry.iterator();
+ Iterator<Attribute> iterator = entry.iterator();
assertTrue( iterator.hasNext() );
@@ -1957,7 +1957,7 @@ public class SchemaAwareEntryTest
while ( iterator.hasNext() )
{
- EntryAttribute attribute = iterator.next();
+ Attribute attribute = iterator.next();
AttributeType attributeType = attribute.getAttributeType();
assertTrue( expectedIds.contains( attributeType ) );
@@ -1994,7 +1994,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.containsAttribute( atPwd ) );
assertTrue( entry.contains( atPwd, ( byte[] ) null ) );
- EntryAttribute replaced = entry.put( atPwd, BYTES1, BYTES2, BYTES1 );
+ Attribute replaced = entry.put( atPwd, BYTES1, BYTES2, BYTES1 );
assertNotNull( replaced );
assertEquals( atPwd, replaced.getAttributeType() );
assertTrue( replaced.contains( ( byte[] ) null ) );
@@ -2007,7 +2007,7 @@ public class SchemaAwareEntryTest
assertNotNull( replaced );
assertTrue( replaced.contains( BYTES1, BYTES2 ) );
- EntryAttribute attribute = entry.get( atPwd );
+ Attribute attribute = entry.get( atPwd );
assertEquals( 1, attribute.size() );
assertTrue( attribute.contains( "test".getBytes() ) );
}
@@ -2036,7 +2036,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.containsAttribute( atEMail ) );
assertTrue( entry.contains( atEMail, ( String ) null ) );
- EntryAttribute replaced = entry.put( atEMail, "test1", "test2", "test1" );
+ Attribute replaced = entry.put( atEMail, "test1", "test2", "test1" );
assertNotNull( replaced );
assertEquals( atEMail, replaced.getAttributeType() );
assertTrue( replaced.contains( ( String ) null ) );
@@ -2049,7 +2049,7 @@ public class SchemaAwareEntryTest
assertNotNull( replaced );
assertTrue( replaced.contains( "test1", "test2" ) );
- EntryAttribute attribute = entry.get( atEMail );
+ Attribute attribute = entry.get( atEMail );
assertEquals( 0, attribute.size() );
}
@@ -2084,7 +2084,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.containsAttribute( atDC ) );
assertTrue( entry.contains( atDC, ( String ) null ) );
- EntryAttribute replaced = entry.put( atDC, strValue1, strValue2, strValue1 );
+ Attribute replaced = entry.put( atDC, strValue1, strValue2, strValue1 );
assertNotNull( replaced );
assertEquals( atDC, replaced.getAttributeType() );
assertTrue( replaced.contains( ( String ) null ) );
@@ -2097,7 +2097,7 @@ public class SchemaAwareEntryTest
assertNotNull( replaced );
assertTrue( replaced.contains( strValue1, strValue2 ) );
- EntryAttribute attribute = entry.get( atDC );
+ Attribute attribute = entry.get( atDC );
assertEquals( 0, attribute.size() );
}
@@ -2110,13 +2110,13 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute oc = new DefaultEntryAttribute( atObjectClass, "top", "person" );
- EntryAttribute cn = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute sn = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute up = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
- EntryAttribute c = new DefaultEntryAttribute( atEMail, "FR", "US" );
+ Attribute oc = new DefaultEntryAttribute( atObjectClass, "top", "person" );
+ Attribute cn = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute sn = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute up = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute c = new DefaultEntryAttribute( atEMail, "FR", "US" );
- List<EntryAttribute> removed = entry.put( oc, cn, sn, c );
+ List<Attribute> removed = entry.put( oc, cn, sn, c );
assertEquals( 4, entry.size() );
assertEquals( 0, removed.size() );
@@ -2125,10 +2125,10 @@ public class SchemaAwareEntryTest
assertTrue( entry.containsAttribute( " sn " ) );
assertTrue( entry.containsAttribute( " email " ) );
- EntryAttribute attr = entry.get( "objectclass" );
+ Attribute attr = entry.get( "objectclass" );
assertEquals( 2, attr.size() );
- EntryAttribute c2 = new DefaultEntryAttribute( atEMail, "UK", "DE" );
+ Attribute c2 = new DefaultEntryAttribute( atEMail, "UK", "DE" );
removed = entry.put( c2, up );
assertEquals( 1, removed.size() );
assertEquals( c, removed.get( 0 ) );
@@ -2140,7 +2140,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.containsAttribute( "userPassword" ) );
assertTrue( entry.containsAttribute( " email " ) );
- EntryAttribute attrC = entry.get( "email" );
+ Attribute attrC = entry.get( "email" );
assertEquals( 2, attrC.size() );
assertTrue( attrC.contains( "UK", "DE" ) );
@@ -2207,7 +2207,7 @@ public class SchemaAwareEntryTest
assertEquals( "UserPassword", entry.get( atPwd ).getUpId() );
- EntryAttribute replaced = entry.put( "USERpassword ", atPwd, BYTES1, BYTES2, BYTES1 );
+ Attribute replaced = entry.put( "USERpassword ", atPwd, BYTES1, BYTES2, BYTES1 );
assertNotNull( replaced );
assertEquals( atPwd, replaced.getAttributeType() );
assertTrue( replaced.contains( ( byte[] ) null ) );
@@ -2222,7 +2222,7 @@ public class SchemaAwareEntryTest
assertTrue( replaced.contains( BYTES1, BYTES2 ) );
assertEquals( "userpassword", entry.get( atPwd ).getUpId() );
- EntryAttribute attribute = entry.get( atPwd );
+ Attribute attribute = entry.get( atPwd );
assertEquals( 1, attribute.size() );
}
@@ -2281,7 +2281,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( atEMail, ( String ) null ) );
assertEquals( "EMail", entry.get( atEMail ).getUpId() );
- EntryAttribute replaced = entry.put( "eMail", atEMail, "test1", "test2", "test1" );
+ Attribute replaced = entry.put( "eMail", atEMail, "test1", "test2", "test1" );
assertNotNull( replaced );
assertEquals( atEMail, replaced.getAttributeType() );
assertEquals( "eMail", entry.get( atEMail ).getUpId() );
@@ -2296,7 +2296,7 @@ public class SchemaAwareEntryTest
assertTrue( replaced.contains( "test1", "test2" ) );
assertEquals( "1.2.840.113549.1.9.1", entry.get( atEMail ).getUpId() );
- EntryAttribute attribute = entry.get( atEMail );
+ Attribute attribute = entry.get( atEMail );
assertEquals( 0, attribute.size() );
}
@@ -2362,7 +2362,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( atDC, ( String ) null ) );
assertEquals( "Dc", entry.get( atDC ).getUpId() );
- EntryAttribute replaced = entry.put( "domainComponent", atDC, strValue1, strValue2, strValue1 );
+ Attribute replaced = entry.put( "domainComponent", atDC, strValue1, strValue2, strValue1 );
assertNotNull( replaced );
assertEquals( atDC, replaced.getAttributeType() );
assertTrue( replaced.contains( ( String ) null ) );
@@ -2376,7 +2376,7 @@ public class SchemaAwareEntryTest
assertNotNull( replaced );
assertTrue( replaced.contains( strValue1, strValue2 ) );
- EntryAttribute attribute = entry.get( atDC );
+ Attribute attribute = entry.get( atDC );
assertEquals( 0, attribute.size() );
assertEquals( "0.9.2342.19200300.100.1.25", entry.get( atDC ).getUpId() );
}
@@ -2420,7 +2420,7 @@ public class SchemaAwareEntryTest
assertTrue( true );
}
- EntryAttribute replaced = entry.put( "userPassword", ( byte[] ) null );
+ Attribute replaced = entry.put( "userPassword", ( byte[] ) null );
assertNull( replaced );
assertEquals( 1, entry.size() );
assertNotNull( entry.get( "userPassword" ) );
@@ -2442,7 +2442,7 @@ public class SchemaAwareEntryTest
assertEquals( 1, entry.size() );
assertNotNull( entry.get( "userPassword" ) );
assertEquals( 2, entry.get( "USERPassword" ).size() );
- EntryAttribute attribute = entry.get( "userPassword" );
+ Attribute attribute = entry.get( "userPassword" );
assertTrue( attribute.contains( BYTES1 ) );
assertTrue( attribute.contains( BYTES2 ) );
assertEquals( "2.5.4.35", attribute.getId() );
@@ -2488,7 +2488,7 @@ public class SchemaAwareEntryTest
assertTrue( true );
}
- EntryAttribute replaced = entry.put( "dc", ( String ) null );
+ Attribute replaced = entry.put( "dc", ( String ) null );
assertNull( replaced );
assertEquals( 1, entry.size() );
assertNotNull( entry.get( "dc" ) );
@@ -2511,7 +2511,7 @@ public class SchemaAwareEntryTest
assertNotNull( entry.get( "cn" ) );
assertEquals( 2, entry.get( "CN" ).size() );
- EntryAttribute attribute = entry.get( "cn" );
+ Attribute attribute = entry.get( "cn" );
assertTrue( attribute.contains( "test1" ) );
assertTrue( attribute.contains( "test2" ) );
assertEquals( "2.5.4.3", attribute.getId() );
@@ -2564,7 +2564,7 @@ public class SchemaAwareEntryTest
assertTrue( true );
}
- EntryAttribute replaced = entry.put( "domainComponent", strNullValue );
+ Attribute replaced = entry.put( "domainComponent", strNullValue );
assertNull( replaced );
assertEquals( 1, entry.size() );
assertNotNull( entry.get( "domainComponent" ) );
@@ -2589,7 +2589,7 @@ public class SchemaAwareEntryTest
assertNotNull( entry.get( "dc" ) );
assertEquals( 2, entry.get( "DC" ).size() );
- EntryAttribute attribute = entry.get( "dc" );
+ Attribute attribute = entry.get( "dc" );
assertTrue( attribute.contains( strValue1 ) );
assertTrue( attribute.contains( strValue2 ) );
assertEquals( "0.9.2342.19200300.100.1.25", attribute.getId() );
@@ -2613,7 +2613,7 @@ public class SchemaAwareEntryTest
// first test a null SA addition. It should be allowed.
try
{
- entry.put( ( EntryAttribute ) null );
+ entry.put( ( Attribute ) null );
fail();
}
catch ( IllegalArgumentException iae )
@@ -2626,16 +2626,16 @@ public class SchemaAwareEntryTest
AttributeType atGN = schemaManager.lookupAttributeTypeRegistry( "givenname" );
AttributeType atStreet = schemaManager.lookupAttributeTypeRegistry( "2.5.4.9" );
- EntryAttribute sa = new DefaultEntryAttribute( atL, "france" );
+ Attribute sa = new DefaultEntryAttribute( atL, "france" );
entry.put( sa );
assertEquals( 1, entry.size() );
assertNotNull( entry.get( "l" ) );
assertEquals( "france", entry.get( "l" ).get().getString() );
- EntryAttribute sb = new DefaultEntryAttribute( atC, "countryTest" );
- EntryAttribute sc = new DefaultEntryAttribute( atGN, "test" );
- EntryAttribute sd = new DefaultEntryAttribute( atStreet, "testStreet" );
+ Attribute sb = new DefaultEntryAttribute( atC, "countryTest" );
+ Attribute sc = new DefaultEntryAttribute( atGN, "test" );
+ Attribute sd = new DefaultEntryAttribute( atStreet, "testStreet" );
entry.put( sb, sc, sd );
assertEquals( 4, entry.size() );
@@ -2647,9 +2647,9 @@ public class SchemaAwareEntryTest
assertEquals( "testStreet", entry.get( atStreet ).get().getString() );
// Test a replacement
- EntryAttribute sbb = new DefaultEntryAttribute( atC, "countryTestTest" );
- EntryAttribute scc = new DefaultEntryAttribute( atGN, "testtest" );
- List<EntryAttribute> result = entry.put( sbb, scc );
+ Attribute sbb = new DefaultEntryAttribute( atC, "countryTestTest" );
+ Attribute scc = new DefaultEntryAttribute( atGN, "testtest" );
+ List<Attribute> result = entry.put( sbb, scc );
assertEquals( 2, result.size() );
assertEquals( "countryTest", result.get( 0 ).get().getString() );
@@ -2664,15 +2664,15 @@ public class SchemaAwareEntryTest
// test an ObjectClass replacement
AttributeType OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
- EntryAttribute oc = new DefaultEntryAttribute( "OBJECTCLASS", OBJECT_CLASS_AT, "person", "inetorgperson" );
- List<EntryAttribute> oldOc = entry.put( oc );
+ Attribute oc = new DefaultEntryAttribute( "OBJECTCLASS", OBJECT_CLASS_AT, "person", "inetorgperson" );
+ List<Attribute> oldOc = entry.put( oc );
assertNotNull( oldOc );
assertEquals( 0, oldOc.size() );
assertNotNull( entry.get( "objectClass" ) );
- EntryAttribute newOc = entry.get( "objectClass" );
+ Attribute newOc = entry.get( "objectClass" );
assertNotNull( newOc );
assertEquals( OBJECT_CLASS_AT, newOc.getAttributeType() );
@@ -2727,7 +2727,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( "email", "test3" ) );
// Add twice the same value
- EntryAttribute sa = entry.put( atEMail, "test1", "test2", "test1" );
+ Attribute sa = entry.put( atEMail, "test1", "test2", "test1" );
assertEquals( 3, sa.size() );
assertTrue( sa.contains( "test1", "test2", "test3" ) );
@@ -2790,7 +2790,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( "userpassword", test3 ) );
// Add twice the same value
- EntryAttribute sa = entry.put( atPwd, test1, test2, test1 );
+ Attribute sa = entry.put( atPwd, test1, test2, test1 );
assertEquals( 3, sa.size() );
assertTrue( sa.contains( test1, test2, test3 ) );
@@ -2850,7 +2850,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( "cn", "test3" ) );
// Add twice the same value
- EntryAttribute sa = entry.put( atCN, new StringValue( atCN, "test1" ), new StringValue( atCN, "test2" ),
+ Attribute sa = entry.put( atCN, new StringValue( atCN, "test1" ), new StringValue( atCN, "test2" ),
new StringValue( atCN, "test1" ) );
assertEquals( 3, sa.size() );
@@ -2909,7 +2909,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( "email", "test3" ) );
// Add twice the same value
- EntryAttribute sa = entry.put( "email", "test1", "test2", "test1" );
+ Attribute sa = entry.put( "email", "test1", "test2", "test1" );
assertEquals( 3, sa.size() );
assertTrue( sa.contains( "test1", "test2", "test3" ) );
@@ -2977,7 +2977,7 @@ public class SchemaAwareEntryTest
assertTrue( entry.contains( "userPassword", test3 ) );
// Add twice the same value
- EntryAttribute sa = entry.put( "userPassword", test1, test2, test1 );
+ Attribute sa = entry.put( "userPassword", test1, test2, test1 );
assertEquals( 3, sa.size() );
assertTrue( sa.contains( test1, test2, test3 ) );
@@ -3041,7 +3041,7 @@ public class SchemaAwareEntryTest
}
// Test that we can add some new attributes with values
- EntryAttribute result = entry.put( "EMail", atEMail, "test1", "test2", "test3" );
+ Attribute result = entry.put( "EMail", atEMail, "test1", "test2", "test3" );
assertNotNull( result );
assertEquals( "email", result.getUpId() );
assertEquals( 1, entry.size() );
@@ -3115,7 +3115,7 @@ public class SchemaAwareEntryTest
byte[] test2 = Strings.getBytesUtf8("test2");
byte[] test3 = Strings.getBytesUtf8("test3");
- EntryAttribute result = entry.put( "UserPassword", atPassword, test1, test2, test3 );
+ Attribute result = entry.put( "UserPassword", atPassword, test1, test2, test3 );
assertNotNull( result );
assertEquals( "userPassword", result.getUpId() );
assertEquals( 1, entry.size() );
@@ -3187,7 +3187,7 @@ public class SchemaAwareEntryTest
Value<String> test2 = new StringValue( atDC, "test2" );
Value<String> test3 = new StringValue( atDC, "test3" );
- EntryAttribute result = entry.put( "DC", atDC, test1, test2, test3 );
+ Attribute result = entry.put( "DC", atDC, test1, test2, test3 );
assertNotNull( result );
assertEquals( "dc", result.getUpId() );
assertEquals( 1, entry.size() );
@@ -3231,7 +3231,7 @@ public class SchemaAwareEntryTest
Value<String> test2 = new StringValue( atDC, "test2" );
Value<String> test3 = new StringValue( atDC, "test3" );
- EntryAttribute result = entry.put( "DC", test1, test2, test3 );
+ Attribute result = entry.put( "DC", test1, test2, test3 );
assertNotNull( result );
assertEquals( "domainComponent", result.getUpId() );
assertEquals( 1, entry.size() );
@@ -3254,7 +3254,7 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
entry.put( attrPWD );
assertTrue( entry.remove( atPwd, ( byte[] ) null ) );
@@ -3284,7 +3284,7 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrCN = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
+ Attribute attrCN = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
entry.put( attrCN );
assertTrue( entry.remove( atEMail, ( String ) null ) );
@@ -3320,7 +3320,7 @@ public class SchemaAwareEntryTest
Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
entry.put( attrPWD );
assertTrue( entry.remove( atEMail, strNullValue ) );
@@ -3349,14 +3349,14 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.put( attrOC, attrCN, attrSN, attrPWD );
- List<EntryAttribute> removed = entry.remove( attrSN, attrPWD );
+ List<Attribute> removed = entry.remove( attrSN, attrPWD );
assertEquals( 2, removed.size() );
assertEquals( 2, entry.size() );
@@ -3381,10 +3381,10 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.put( attrOC, attrCN, attrSN, attrPWD );
@@ -3393,7 +3393,7 @@ public class SchemaAwareEntryTest
assertFalse( entry.containsAttribute( "cn", "sn" ) );
assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
- List<EntryAttribute> removed = entry.removeAttributes( ( AttributeType ) null );
+ List<Attribute> removed = entry.removeAttributes( ( AttributeType ) null );
assertNull( removed );
removed = entry.removeAttributes( atC );
@@ -3409,10 +3409,10 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
- EntryAttribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
- EntryAttribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
+ Attribute attrOC = new DefaultEntryAttribute( atOC, "top", "person" );
+ Attribute attrCN = new DefaultEntryAttribute( atCN, "test1", "test2" );
+ Attribute attrSN = new DefaultEntryAttribute( atSN, "Test1", "Test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, BYTES2 );
entry.put( attrOC, attrCN, attrSN, attrPWD );
@@ -3421,7 +3421,7 @@ public class SchemaAwareEntryTest
assertFalse( entry.containsAttribute( "cn", "sn" ) );
assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
- List<EntryAttribute> removed = entry.removeAttributes( "badId" );
+ List<Attribute> removed = entry.removeAttributes( "badId" );
assertNull( removed );
removed = entry.removeAttributes( "l" );
@@ -3440,7 +3440,7 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
+ Attribute attrPWD = new DefaultEntryAttribute( atPwd, BYTES1, ( byte[] ) null, BYTES2 );
assertFalse( entry.remove( ( String ) null, BYTES1 ) );
assertFalse( entry.remove( " ", BYTES1 ) );
@@ -3474,7 +3474,7 @@ public class SchemaAwareEntryTest
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
- EntryAttribute attrCN = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
+ Attribute attrCN = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
assertFalse( entry.remove( ( String ) null, "test1" ) );
assertFalse( entry.remove( " ", "test1" ) );
@@ -3514,7 +3514,7 @@ public class SchemaAwareEntryTest
Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );
- EntryAttribute attrPWD = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
+ Attribute attrPWD = new DefaultEntryAttribute( atEMail, "test1", ( String ) null, "test2" );
entry.put( attrPWD );
assertTrue( entry.remove( "EMail", strNullValue ) );
@@ -3556,7 +3556,7 @@ public class SchemaAwareEntryTest
Value<byte[]> testB2 = new BinaryValue( atPassword, b2 );
// test a removal of an non existing attribute
- List<EntryAttribute> removed = entry.removeAttributes( atCN );
+ List<Attribute> removed = entry.removeAttributes( atCN );
assertNull( removed );
// Test a simple removal
@@ -3604,7 +3604,7 @@ public class SchemaAwareEntryTest
Dn dn = new Dn( schemaManager, "cn=test" );
Entry entry = new DefaultEntry( schemaManager, dn );
- List<EntryAttribute> result = null;
+ List<Attribute> result = null;
// First check that this method fails if we pass an empty list of ATs
result = entry.set( ( AttributeType ) null );
@@ -3614,7 +3614,7 @@ public class SchemaAwareEntryTest
result = entry.set( atSN );
assertNull( result );
- EntryAttribute sa = entry.get( "sn" );
+ Attribute sa = entry.get( "sn" );
assertNotNull( sa );
assertEquals( atSN, sa.getAttributeType() );
assertEquals( "sn", sa.getAttributeType().getName() );
@@ -3668,7 +3668,7 @@ public class SchemaAwareEntryTest
assertNotNull( entry.get( "objectClass" ) );
- EntryAttribute oc = entry.get( "objectClass" );
+ Attribute oc = entry.get( "objectClass" );
assertEquals( OBJECT_CLASS_AT, oc.getAttributeType() );
assertNull( oc.get() );
@@ -3683,7 +3683,7 @@ public class SchemaAwareEntryTest
{
Dn dn = new Dn( schemaManager, "cn=test" );
DefaultEntry entry = new DefaultEntry( schemaManager, dn );
- List<EntryAttribute> result = null;
+ List<Attribute> result = null;
// First check that this method fails if we pass a null or empty ID
try
@@ -3708,7 +3708,7 @@ public class SchemaAwareEntryTest
assertNull( result );
- EntryAttribute sa = entry.get( "sn" );
+ Attribute sa = entry.get( "sn" );
assertNotNull( sa );
assertEquals( "2.5.4.4", sa.getId() );
@@ -3774,7 +3774,7 @@ public class SchemaAwareEntryTest
entry.add( "cn", "test1", "test2" );
entry.add( "sn", "Test" );
- List<EntryAttribute> removed = entry.set( atOC, atCN, atPwd );
+ List<Attribute> removed = entry.set( atOC, atCN, atPwd );
assertEquals( 4, entry.size() );
assertNotNull( entry.get( "objectclass" ) );
@@ -3804,7 +3804,7 @@ public class SchemaAwareEntryTest
entry.add( "cn", "test1", "test2" );
entry.add( "sn", "Test" );
- List<EntryAttribute> removed = entry.set( "objectClass", "CN", "givenName" );
+ List<Attribute> removed = entry.set( "objectClass", "CN", "givenName" );
assertEquals( 4, entry.size() );
assertNotNull( entry.get( "objectclass" ) );