*/
@Test(expectedExceptions = { ClientException.class })
public void testDoSASLBindAnonymousMultivaluedTrace()
throws Exception
{
AnonymousSASLMechanismHandler handler = new AnonymousSASLMechanismHandler();
handler.initializeSASLMechanismHandler(null);
Socket s = new Socket("127.0.0.1", TestCaseUtils.getServerLdapPort());
LDAPReader r = new LDAPReader(s);
LDAPWriter w = new LDAPWriter(s);
AtomicInteger messageID = new AtomicInteger(1);
ArrayList<Control> requestControls = new ArrayList<Control>();
ArrayList<Control> responseControls = new ArrayList<Control>();
LinkedHashMap<String,List<String>> saslProperties =
new LinkedHashMap<String,List<String>>();
ArrayList<String> propList = new ArrayList<String>();
propList.add("testDoSASLBindAnonymousMultivaluedTrace");
propList.add("aSecondTraceStringWhichIsInvalid");
saslProperties.put("trace", propList);
LDAPAuthenticationHandler authHandler =
new LDAPAuthenticationHandler(r, w, "localhost", messageID);
try
{
authHandler.doSASLBind(ByteString.empty(), ByteString.empty(),
"ANONYMOUS", saslProperties, requestControls,
responseControls);
}
finally
{
s.close();
handler.finalizeSASLMechanismHandler();
}
}