JvmAgentConfig extends JolokiaServerConfig { private Map<String, String> readConfig(String pFilename) { File file = new File(pFilename); try { InputStream is = new FileInputStream(file); return readPropertiesFromInputStream(is,pFilename); } catch (FileNotFoundException e) { throw new IllegalArgumentException("jolokia: Can not find configuration file " + pFilename,e); } } JvmAgentConfig(String pArgs);  JvmAgentConfig(Map<String,String> pConfig); boolean isModeStop();  }
@Test public void readConfig() throws IOException { String path = copyResourceToTemp("/agent-test.properties"); JvmAgentConfig config = new JvmAgentConfig("config=" + path); assertEquals(config.getProtocol(), "https"); Authenticator authenticator = config.getAuthenticator(); assertNotNull(authenticator); assertEquals(config.getClientPrincipals().get(0),"O=jolokia.org,OU=JVM"); assertTrue(authenticator instanceof UserPasswordAuthenticator); assertTrue(((UserPasswordAuthenticator) authenticator).checkCredentials("roland", "s!cr!t")); }