当前位置: 首页>>代码示例>>Java>>正文


Java SearchResultDone.getLdapResult方法代码示例

本文整理汇总了Java中org.apache.directory.api.ldap.model.message.SearchResultDone.getLdapResult方法的典型用法代码示例。如果您正苦于以下问题:Java SearchResultDone.getLdapResult方法的具体用法?Java SearchResultDone.getLdapResult怎么用?Java SearchResultDone.getLdapResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.directory.api.ldap.model.message.SearchResultDone的用法示例。


在下文中一共展示了SearchResultDone.getLdapResult方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testResponseWithResultCode

import org.apache.directory.api.ldap.model.message.SearchResultDone; //导入方法依赖的package包/类
/**
 * Test parsing of a response with Result Code
 */
@Test
public void testResponseWithResultCode()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultDoneTest.class.getResource( "response_with_result_code.xml" ).openStream(),
            "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultDone searchResultDone = ( ( SearchResponse )
        parser.getBatchResponse().getCurrentResponse().getDecorated() )
            .getSearchResultDone();

    LdapResult ldapResult = searchResultDone.getLdapResult();

    assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:30,代码来源:SearchResultDoneTest.java

示例2: testResponseWithErrorMessage

import org.apache.directory.api.ldap.model.message.SearchResultDone; //导入方法依赖的package包/类
/**
 * Test parsing of a response with Error Message
 */
@Test
public void testResponseWithErrorMessage()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultDoneTest.class.getResource( "response_with_error_message.xml" ).openStream(),
            "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getSearchResultDone();

    LdapResult ldapResult = searchResultDone.getLdapResult();

    assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
        .getDiagnosticMessage() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:31,代码来源:SearchResultDoneTest.java

示例3: testResponseWithEmptyErrorMessage

import org.apache.directory.api.ldap.model.message.SearchResultDone; //导入方法依赖的package包/类
/**
 * Test parsing of a response with empty Error Message
 */
@Test
public void testResponseWithEmptyErrorMessage()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultDoneTest.class.getResource( "response_with_empty_error_message.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getSearchResultDone();

    LdapResult ldapResult = searchResultDone.getLdapResult();

    assertNull( ldapResult.getDiagnosticMessage() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:30,代码来源:SearchResultDoneTest.java

示例4: testResponseWith1EmptyReferral

import org.apache.directory.api.ldap.model.message.SearchResultDone; //导入方法依赖的package包/类
/**
 * Test parsing of a response with an empty Referral
 */
@Test
public void testResponseWith1EmptyReferral()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultDoneTest.class.getResource( "response_with_1_empty_referral.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultDone searchResultDone = ( ( SearchResponse )
        parser.getBatchResponse().getCurrentResponse().getDecorated() )
            .getSearchResultDone();

    LdapResult ldapResult = searchResultDone.getLdapResult();

    Collection<String> referrals = ldapResult.getReferral().getLdapUrls();

    assertEquals( 0, referrals.size() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:32,代码来源:SearchResultDoneTest.java

示例5: testResponseWithMatchedDNAttribute

import org.apache.directory.api.ldap.model.message.SearchResultDone; //导入方法依赖的package包/类
/**
 * Test parsing of a response with MatchedDN attribute
 */
@Test
public void testResponseWithMatchedDNAttribute()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultDoneTest.class.getResource( "response_with_matchedDN_attribute.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getSearchResultDone();

    LdapResult ldapResult = searchResultDone.getLdapResult();

    assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:30,代码来源:SearchResultDoneTest.java


注:本文中的org.apache.directory.api.ldap.model.message.SearchResultDone.getLdapResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。