Java Code Examples for org.apache.directory.api.ldap.model.message.ModifyResponse#getLdapResult()
The following examples show how to use
org.apache.directory.api.ldap.model.message.ModifyResponse#getLdapResult() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModifyResponseTest.java From directory-ldap-api with Apache License 2.0 | 6 votes |
/** * Test parsing of a response with Result Code */ @Test public void testResponseWithResultCode() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_result_code.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() ); }
Example 2
Source File: ModifyResponseTest.java From directory-ldap-api with Apache License 2.0 | 6 votes |
/** * Test parsing of a response with Error Message */ @Test public void testResponseWithErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_error_message.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult .getDiagnosticMessage() ); }
Example 3
Source File: ModifyResponseTest.java From directory-ldap-api with Apache License 2.0 | 6 votes |
/** * Test parsing of a response with empty Error Message */ @Test public void testResponseWithEmptyErrorMessage() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_empty_error_message.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertNull( ldapResult.getDiagnosticMessage() ); }
Example 4
Source File: ModifyResponseTest.java From directory-ldap-api with Apache License 2.0 | 6 votes |
/** * Test parsing of a response with MatchedDN attribute */ @Test public void testResponseWithMatchedDNAttribute() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_matchedDN_attribute.xml" ) .openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); assertTrue( ldapResult.getMatchedDn().equals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM" ) ); }
Example 5
Source File: ModifyResponseTest.java From directory-ldap-api with Apache License 2.0 | 5 votes |
/** * Test parsing of a response with an empty Referral */ @Test public void testResponseWith1EmptyReferral() { Dsmlv2ResponseParser parser = null; try { parser = new Dsmlv2ResponseParser( getCodec() ); parser.setInput( ModifyResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).openStream(), "UTF-8" ); parser.parse(); } catch ( Exception e ) { fail( e.getMessage() ); } ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse(); LdapResult ldapResult = modifyResponse.getLdapResult(); Collection<String> referrals = ldapResult.getReferral().getLdapUrls(); assertEquals( 0, referrals.size() ); }