test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java in calabash-android-0.4.2 vs test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java in calabash-android-0.4.3.pre1
- old
+ new
@@ -40,32 +40,26 @@
/**
* Creates and returns the singleton instance for HttpServer.
*
* Can only be called once. Otherwise, you'll get an IllegalStateException.
*/
- public synchronized static HttpServer instantiate() {
+ public synchronized static HttpServer instantiate(int testServerPort) {
if (instance != null) {
throw new IllegalStateException("Can only instantiate once!");
}
- instance = new HttpServer();
+ instance = new HttpServer(testServerPort);
return instance;
}
- /**
- * Returns the singleton instance for HttpServer.
- *
- * If {@link #instantiate()} hasn't already been called, an
- * IllegalStateException is thrown.
- */
public synchronized static HttpServer getInstance() {
if (instance == null) {
throw new IllegalStateException("Must be initialized!");
}
return instance;
}
- private HttpServer() {
- super(7102, new File("/"));
+ private HttpServer(int testServerPort) {
+ super(testServerPort, new File("/"));
}
@SuppressWarnings("rawtypes")
public Response serve(String uri, String method, Properties header,
Properties params, Properties files) {