hs.hsadmin/hsarback/test/de/hsadmin/remote/RemoteTestHelper.java

36 lines
1007 B
Java
Raw Normal View History

2010-10-01 21:42:49 +02:00
package de.hsadmin.remote;
import java.net.URL;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
2010-10-05 21:42:07 +02:00
import de.hsadmin.core.util.Config;
2010-10-01 21:42:49 +02:00
public class RemoteTestHelper {
2010-10-05 21:42:07 +02:00
private static final String XMLRPC_URL = "https://admin.hostsharing.net:443/hsar/xmlrpc/hsadmin";
private static final String BACKEND_URL = "https://admin.hostsharing.net:443/hsar/backend";
2010-10-01 21:42:49 +02:00
private static XmlRpcClient client;
public static XmlRpcClient getClient() throws Exception {
if (client == null) {
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
2010-10-05 21:42:07 +02:00
config.setServerURL(new URL(getXmlrpcURL()));
2010-10-01 21:42:49 +02:00
config.setEnabledForExtensions(true);
client = new XmlRpcClient();
client.setConfig(config);
}
return client;
}
2010-10-05 21:42:07 +02:00
public static String getBackendURL() {
return Config.getInstance().getProperty("backendURL", BACKEND_URL);
}
public static String getXmlrpcURL() {
return Config.getInstance().getProperty("xmlrpcURL", XMLRPC_URL);
}
2010-10-01 21:42:49 +02:00
}