public void testProxyInfo() throws Exception {
String[] availableFiles = new String[] { "/proxy_config/proxy_config_1.txt", "/proxy_config/proxy_config_2.txt" };
for (String testConfigurationFile : availableFiles) {
String testConfiguration = readConfigFile(testConfigurationFile);
ProxyInfo proxyInfo = new ProxyInfo(testConfiguration);
for (ProxyInfo.Context context : proxyInfo.getAvailableContexts()) {
assert (proxyInfo.getAvailableContexts().indexOf(context) != -1) : "Equals and hash functions not implemented correctly for "
+ ProxyInfo.Context.class.getCanonicalName();
assert (context.equals(ProxyInfo.Context.fromString(context.toString())) == true) : "fromString and toString are not equivalent for:"
+ ProxyInfo.Context.class.getCanonicalName();
}
assert (proxyInfo.getAvailableContexts().size() != 0) : "Raw proxy info parsing failed to parse application contexts!";
assert (proxyInfo.getAvailableVhosts().size() != 0) : "Raw proxy info parsing failed to parse vhosts!";
}
}