本文整理汇总了Java中org.apache.directory.api.ldap.model.entry.Modification.clone方法的典型用法代码示例。如果您正苦于以下问题:Java Modification.clone方法的具体用法?Java Modification.clone怎么用?Java Modification.clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.directory.api.ldap.model.entry.Modification
的用法示例。
在下文中一共展示了Modification.clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateServerModification
import org.apache.directory.api.ldap.model.entry.Modification; //导入方法依赖的package包/类
@Test
public void testCreateServerModification() throws LdapException
{
Attribute attribute = new DefaultAttribute( "cn", cnAT );
attribute.add( "test1", "test2" );
Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
Modification clone = mod.clone();
attribute.remove( "test2" );
Attribute clonedAttribute = clone.getAttribute();
assertEquals( 1, mod.getAttribute().size() );
assertTrue( mod.getAttribute().contains( "TEST1" ) );
assertEquals( 2, clonedAttribute.size() );
assertTrue( clone.getAttribute().contains( "test1" ) );
assertTrue( clone.getAttribute().contains( "test2" ) );
}
示例2: testCreateServerModification
import org.apache.directory.api.ldap.model.entry.Modification; //导入方法依赖的package包/类
@Test
public void testCreateServerModification() throws LdapException
{
Attribute attribute = new DefaultAttribute( "cn" );
attribute.add( "test1", "test2" );
Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
Modification clone = mod.clone();
attribute.remove( "test2" );
Attribute clonedAttribute = clone.getAttribute();
assertEquals( 1, mod.getAttribute().size() );
assertTrue( mod.getAttribute().contains( "test1" ) );
assertEquals( 2, clonedAttribute.size() );
assertTrue( clone.getAttribute().contains( "test1" ) );
assertTrue( clone.getAttribute().contains( "test2" ) );
}