@@ -0,0 +1,1164 @@
+package com.j256.simplejmx.server;%0A%0Aimport java.net.InetAddress;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport com.j256.simplejmx.client.JmxClient;%0Aimport com.j256.simplejmx.common.IoUtils;%0A%0A@Ignore(%22not ready for prime time yet%22)%0Apublic class JmxUsernamePasswordAuthenticatorTest %7B%0A%0A%09private static final int DEFAULT_PORT = 5256;%0A%0A%09@Test%0A%09public void testAuthentication() throws Exception %7B%0A%09%09InetAddress serverAddress = InetAddress.getByName(%22127.0.0.1%22);%0A%09%09JmxServer server = new JmxServer(serverAddress, DEFAULT_PORT);%0A%09%09JmxClient client = null;%0A%09%09try %7B%0A%09%09%09JmxUsernamePasswordAuthenticator authenticator = new JmxUsernamePasswordAuthenticator();%0A%09%09%09Map%3CString, String%3E authMap = new HashMap%3CString, String%3E();%0A%09%09%09String username = %22hello%22;%0A%09%09%09String password = %22there%22;%0A%09%09%09authMap.put(username, password);%0A%09%09%09authenticator.setAuthMap(authMap);%0A%09%09%09server.setAuthenticator(authenticator);%0A%09%09%09server.start();%0A%09%09%09Thread.sleep(10000000);%0A%09%09%09// client = new JmxClient(serverAddress, DEFAULT_PORT, username, password);%0A%09%09%7D finally %7B%0A%09%09%09IoUtils.closeQuietly(client);%0A%09%09%09IoUtils.closeQuietly(server);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Revert "Too early."