Removes the attribute with the specified AttributeTypes.
The removed attribute are returned by this method.
If there is no attribute with the specified AttributeTypes, the return value is null.
null
33463347334833493350335133523353335433553356
Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); entry.removeAttributes( atCN, atSN ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); }
25292530253125322533253425352536253725382539
assertEquals( 1, entry.size() ); assertNotNull( entry.get( "domainComponent" ) ); assertEquals( 1, entry.get( "domainComponent" ).size() ); assertNotNull( entry.get( "domainComponent" ).get() ); assertNull( entry.get( "domainComponent" ).get().getValue() ); entry.removeAttributes( "dc" ); replaced = entry.put( "DC", strValue3 ); assertNull( replaced ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( "dc" ) );
33683369337033713372337333743375337633773378
Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" ); Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 ); entry.put( attrOC, attrCN, attrSN, attrPWD ); entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" );
33733374337533763377337833793380338133823383
entry.removeAttributes( "CN", "SN" ); assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); }
33743375337633773378337933803381338233833384
assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); } /**
33753376337733783379338033813382338333843385
assertFalse( entry.containsAttribute( "cn", "sn" ) ); assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) ); entry.removeAttributes( "badId" ); entry.removeAttributes( "l" ); entry.removeAttributes( ( String ) null ); } /** * Test method for remove( String, byte[]... )
35033504350535063507350835093510351135123513
Value<byte[]> testB1 = new BinaryValue( atPassword, b1 ); Value<byte[]> testB2 = new BinaryValue( atPassword, b2 ); // test a removal of an non existing attribute entry.removeAttributes( atCN ); // Test a simple removal entry.add( "cN", atCN, test1 ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( atCN ) );
35093510351135123513351435153516351735183519
// Test a simple removal entry.add( "cN", atCN, test1 ); assertEquals( 1, entry.size() ); assertNotNull( entry.get( atCN ) ); entry.removeAttributes( "CN" ); assertEquals( 0, entry.size() ); assertNull( entry.get( atCN ) ); // Test a removal of many elements entry.put( "CN", test1, test2 );
35223523352435253526352735283529353035313532
assertNotNull( entry.get( atCN ) ); assertNotNull( entry.get( atPassword ) ); AttributeType OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT ); entry.removeAttributes( "cN", "UsErPaSsWoRd" ); assertEquals( 0, entry.size() ); assertNull( entry.get( atCN ) ); assertNull( entry.get( atPassword ) ); assertFalse( entry.contains( OBJECT_CLASS_AT, "top" ) );
35353536353735383539354035413542354335443545
entry.put( "userPassword", testB1, testB2 ); assertEquals( 2, entry.size() ); assertNotNull( entry.get( atCN ) ); assertNotNull( entry.get( atPassword ) ); entry.removeAttributes( "badAttribute" ); } /** * Test method for setDN( Dn )