本文整理汇总了Java中org.apache.directory.api.ldap.model.entry.Attribute.clone方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.clone方法的具体用法?Java Attribute.clone怎么用?Java Attribute.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.directory.api.ldap.model.entry.Attribute
的用法示例。
在下文中一共展示了Attribute.clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testClone
import org.apache.directory.api.ldap.model.entry.Attribute; //导入方法依赖的package包/类
/**
* Test method testClone()
*/
@Test
public void testClone() throws LdapException
{
Attribute attr = new DefaultAttribute( atDC );
Attribute clone = attr.clone();
assertEquals( attr, clone );
attr.setUpId( "DomainComponent" );
assertEquals( "0.9.2342.19200300.100.1.25", clone.getId() );
attr.add( "a", ( String ) null, "b" );
clone = attr.clone();
assertEquals( attr, clone );
attr.remove( "a" );
assertNotSame( attr, clone );
clone = attr.clone();
assertEquals( attr, clone );
}
示例2: testToClientAttribute
import org.apache.directory.api.ldap.model.entry.Attribute; //导入方法依赖的package包/类
/**
* Test the conversion method
*/
@Test
public void testToClientAttribute() throws LdapException
{
Attribute attribute = new DefaultAttribute( atCN, "test", "test2" );
Attribute clientAttribute = attribute.clone();
assertTrue( clientAttribute instanceof Attribute );
assertTrue( clientAttribute.contains( "test", "test2" ) );
assertEquals( "2.5.4.3", clientAttribute.getId() );
attribute.remove( "test", "test2" );
assertTrue( clientAttribute.contains( "test", "test2" ) );
}