Search in sources :

Example 41 with Parameter

use of nl.nn.adapterframework.parameters.Parameter in project iaf by ibissource.

the class LdapSenderTest method deleteAttribute.

@Test
public void deleteAttribute() throws SAXException, IOException, ConfigurationException, SenderException, LDAPException {
    String result;
    LDAPConnection connection = inMemoryDirectoryServer.getConnection();
    LdapSender ldapSender = null;
    try {
        ldapSender = new LdapSender();
        ldapSender.setLdapProviderURL("ldap://" + connection.getConnectedAddress() + ":" + connection.getConnectedPort());
        ldapSender.setOperation("delete");
        Parameter parameter = new Parameter();
        parameter.setName("entryName");
        parameter.setValue("cn=LEA Administrator,ou=groups,ou=development," + baseDNs);
        ldapSender.addParameter(parameter);
        ldapSender.configure();
        ldapSender.open();
        result = ldapSender.sendMessage("dummy", "<attributes><attribute name=\"mail\"><value>leaadministrator@ibissource.org</value></attribute></attributes>");
    } finally {
        if (ldapSender != null) {
            ldapSender.close();
        }
        if (connection != null) {
            connection.close();
        }
    }
    assertEquals("<LdapResult>Success</LdapResult>", result);
    compareXML("Ldap/expected/delete.xml", getTree());
}
Also used : Parameter(nl.nn.adapterframework.parameters.Parameter) LDAPConnection(com.unboundid.ldap.sdk.LDAPConnection) Test(org.junit.Test)

Aggregations

Parameter (nl.nn.adapterframework.parameters.Parameter)41 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)19 ParameterResolutionContext (nl.nn.adapterframework.parameters.ParameterResolutionContext)15 ParameterList (nl.nn.adapterframework.parameters.ParameterList)13 PipeRunException (nl.nn.adapterframework.core.PipeRunException)12 IOException (java.io.IOException)7 FixedQuerySender (nl.nn.adapterframework.jdbc.FixedQuerySender)7 ParameterException (nl.nn.adapterframework.core.ParameterException)6 PipeRunResult (nl.nn.adapterframework.core.PipeRunResult)6 ParameterValueList (nl.nn.adapterframework.parameters.ParameterValueList)5 LDAPConnection (com.unboundid.ldap.sdk.LDAPConnection)4 Map (java.util.Map)4 Test (org.junit.Test)3 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 LinkedHashMap (java.util.LinkedHashMap)2 LinkedList (java.util.LinkedList)2