本文整理汇总了Java中org.apache.directory.api.ldap.model.entry.DefaultAttribute.setUpId方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultAttribute.setUpId方法的具体用法?Java DefaultAttribute.setUpId怎么用?Java DefaultAttribute.setUpId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.directory.api.ldap.model.entry.DefaultAttribute
的用法示例。
在下文中一共展示了DefaultAttribute.setUpId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSerializeCompleteAttribute
import org.apache.directory.api.ldap.model.entry.DefaultAttribute; //导入方法依赖的package包/类
/**
* Test the serialization of a complete server attribute
*/
@Test
public void testSerializeCompleteAttribute() throws LdapException, IOException, ClassNotFoundException
{
DefaultAttribute dsa = new DefaultAttribute( atCN );
dsa.setUpId( "CommonName" );
dsa.add( "test1", "test2" );
DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atCN );
assertEquals( dsa.toString(), dsaSer.toString() );
assertEquals( "2.5.4.3", dsaSer.getId() );
assertEquals( "CommonName", dsaSer.getUpId() );
assertEquals( "test1", dsaSer.getString() );
assertTrue( dsaSer.contains( "test2", "test1" ) );
assertTrue( dsaSer.isHumanReadable() );
}
示例2: testSerializeAttributeNullValue
import org.apache.directory.api.ldap.model.entry.DefaultAttribute; //导入方法依赖的package包/类
/**
* Test the serialization of a server attribute with a null value
*/
@Test
public void testSerializeAttributeNullValue() throws LdapException, IOException, ClassNotFoundException
{
DefaultAttribute dsa = new DefaultAttribute( atDC );
dsa.setUpId( "DomainComponent" );
dsa.add( ( String ) null );
DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atDC );
assertEquals( dsa.toString(), dsaSer.toString() );
assertEquals( "0.9.2342.19200300.100.1.25", dsaSer.getId() );
assertEquals( "DomainComponent", dsaSer.getUpId() );
assertNull( dsaSer.getString() );
assertEquals( 1, dsaSer.size() );
assertTrue( dsaSer.contains( ( String ) null ) );
assertTrue( dsaSer.isHumanReadable() );
}
示例3: testSerializeAttributeWithNoValue
import org.apache.directory.api.ldap.model.entry.DefaultAttribute; //导入方法依赖的package包/类
/**
* Test the serialization of a server attribute with no value
*/
@Test
public void testSerializeAttributeWithNoValue() throws LdapException, IOException, ClassNotFoundException
{
DefaultAttribute dsa = new DefaultAttribute( atCN );
dsa.setUpId( "cn" );
DefaultAttribute dsaSer = deserializeValue( serializeValue( dsa ), atCN );
assertEquals( dsa.toString(), dsaSer.toString() );
assertEquals( "2.5.4.3", dsaSer.getId() );
assertEquals( "cn", dsaSer.getUpId() );
assertEquals( 0, dsaSer.size() );
assertTrue( dsaSer.isHumanReadable() );
}