本文整理汇总了Java中org.apache.directory.api.ldap.model.message.AddRequest.getEntry方法的典型用法代码示例。如果您正苦于以下问题:Java AddRequest.getEntry方法的具体用法?Java AddRequest.getEntry怎么用?Java AddRequest.getEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.directory.api.ldap.model.message.AddRequest
的用法示例。
在下文中一共展示了AddRequest.getEntry方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRequestWith1AttrWithoutValue
import org.apache.directory.api.ldap.model.message.AddRequest; //导入方法依赖的package包/类
/**
* Test parsing of a request with an Attr elements with value
*/
@Test
public void testRequestWith1AttrWithoutValue()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_without_value.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
Entry entry = addRequest.getEntry();
assertEquals( 1, entry.size() );
// Getting the Attribute
Iterator<Attribute> attributeIterator = entry.iterator();
Attribute attribute = attributeIterator.next();
assertEquals( "objectclass", attribute.getUpId() );
// Getting the Value
Iterator<Value> valueIterator = attribute.iterator();
assertFalse( valueIterator.hasNext() );
}
示例2: testRequestWith1AttrEmptyValue
import org.apache.directory.api.ldap.model.message.AddRequest; //导入方法依赖的package包/类
/**
* Test parsing of a request with an Attr elements with empty value
*/
@Test
public void testRequestWith1AttrEmptyValue()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_empty_value.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
Entry entry = addRequest.getEntry();
assertEquals( 1, entry.size() );
// Getting the Attribute
Iterator<Attribute> attributeIterator = entry.iterator();
Attribute attribute = attributeIterator.next();
assertEquals( "objectclass", attribute.getUpId() );
// Getting the Value
Iterator<Value> valueIterator = attribute.iterator();
assertFalse( valueIterator.hasNext() );
}
示例3: testRequestWith1AttrWithValue
import org.apache.directory.api.ldap.model.message.AddRequest; //导入方法依赖的package包/类
/**
* Test parsing of a request with an Attr elements with value
*/
@Test
public void testRequestWith1AttrWithValue()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_with_value.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
Entry entry = addRequest.getEntry();
assertEquals( 1, entry.size() );
// Getting the Attribute
Iterator<Attribute> attributeIterator = entry.iterator();
Attribute attribute = attributeIterator.next();
assertEquals( "objectclass", attribute.getUpId() );
// Getting the Value
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertEquals( "top", value.getValue() );
}
示例4: testRequestWith1AttrWithBase64Value
import org.apache.directory.api.ldap.model.message.AddRequest; //导入方法依赖的package包/类
/**
* Test parsing of a request with an Attr elements with value
*/
@Test
public void testRequestWith1AttrWithBase64Value()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_with_base64_value.xml" )
.openStream(), "UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
Entry entry = addRequest.getEntry();
assertEquals( 1, entry.size() );
// Getting the Attribute
Iterator<Attribute> attributeIterator = entry.iterator();
Attribute attribute = attributeIterator.next();
assertEquals( "objectclass", attribute.getUpId() );
// Getting the Value
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertFalse( value.isHumanReadable() );
assertEquals( "DSMLv2.0 rocks!!", value.getValue() );
}
示例5: testRequestWith2AttrWithValue
import org.apache.directory.api.ldap.model.message.AddRequest; //导入方法依赖的package包/类
/**
* Test parsing of a request with 2 Attr elements with value
*/
@Test
public void testRequestWith2AttrWithValue()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( AddRequestTest.class.getResource( "request_with_2_attr_with_value.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
Entry entry = addRequest.getEntry();
assertEquals( 1, entry.size() );
// Getting the Attribute
Iterator<Attribute> attributeIterator = entry.iterator();
Attribute attribute = attributeIterator.next();
assertEquals( "objectclass", attribute.getUpId() );
// Getting the Value
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertEquals( "top", value.getValue() );
assertTrue( valueIterator.hasNext() );
value = valueIterator.next();
assertEquals( "person", value.getValue() );
assertFalse( valueIterator.hasNext() );
}
示例6: testRequestWith1AttrWith2Values
import org.apache.directory.api.ldap.model.message.AddRequest; //导入方法依赖的package包/类
/**
* Test parsing of a request with 1 Attr element with 2 Values
*/
@Test
public void testRequestWith1AttrWith2Values()
{
Dsmlv2Parser parser = null;
try
{
parser = newParser();
parser.setInput( AddRequestTest.class.getResource( "request_with_1_attr_with_2_values.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
AddRequest addRequest = ( AddRequest ) parser.getBatchRequest().getCurrentRequest();
Entry entry = addRequest.getEntry();
assertEquals( 1, entry.size() );
// Getting the Attribute
Iterator<Attribute> attributeIterator = entry.iterator();
Attribute attribute = attributeIterator.next();
assertEquals( "objectclass", attribute.getUpId() );
// Getting the Value
Iterator<Value> valueIterator = attribute.iterator();
assertTrue( valueIterator.hasNext() );
Value value = valueIterator.next();
assertEquals( "top", value.getValue() );
assertTrue( valueIterator.hasNext() );
value = valueIterator.next();
assertEquals( "person", value.getValue() );
assertFalse( valueIterator.hasNext() );
}