# HG changeset patch # User Jaroslav Tulach # Date 1255890589 -7200 # Node ID e905cd9b1e4a40a06cb9dac612f78fb4ab40b946 # Parent 4e21f47580b4ec56119b6cd2548c0ef53d125740 Removing compile time dependency on webidor, its functionality is accessed only via REST diff -r 4e21f47580b4 -r e905cd9b1e4a freemarkerdor/pom.xml --- a/freemarkerdor/pom.xml Sun Oct 18 18:00:58 2009 +0200 +++ b/freemarkerdor/pom.xml Sun Oct 18 20:29:49 2009 +0200 @@ -16,9 +16,20 @@ ${project.groupId} webidor + [1.0, 2.0) + test + + + ${project.groupId} + quoridor [1.0,2.0) + com.sun.jersey + jersey-server + 1.1.0-ea + + org.netbeans.modules org-netbeans-libs-freemarker RELEASE67 diff -r 4e21f47580b4 -r e905cd9b1e4a freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sun Oct 18 18:00:58 2009 +0200 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sun Oct 18 20:29:49 2009 +0200 @@ -36,7 +36,6 @@ import com.sun.net.httpserver.HttpServer; import cz.xelfi.quoridor.Board; import cz.xelfi.quoridor.IllegalPositionException; -import cz.xelfi.quoridor.webidor.resources.Quoridor; import java.awt.Image; import java.io.IOException; import java.io.InputStream; @@ -332,9 +331,7 @@ final HttpServer apiServer; if (remoteAPI == null) { - int localAPIPort = port - 1; - apiServer = Quoridor.start(localAPIPort); - base = client.resource(new URI("http://localhost:" + localAPIPort)); + throw new IllegalArgumentException("Provide URL to API server"); // NOI18N } else { base = client.resource(new URI(remoteAPI)); apiServer = null; diff -r 4e21f47580b4 -r e905cd9b1e4a freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java --- a/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java Sun Oct 18 18:00:58 2009 +0200 +++ b/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java Sun Oct 18 20:29:49 2009 +0200 @@ -31,6 +31,8 @@ import com.sun.jersey.api.client.WebResource; import com.sun.jersey.core.header.MediaTypes; import com.sun.jersey.core.util.MultivaluedMapImpl; +import com.sun.net.httpserver.HttpServer; +import cz.xelfi.quoridor.webidor.resources.Quoridor; import java.awt.Image; import java.io.File; import java.io.FileOutputStream; @@ -56,6 +58,7 @@ */ public class UITest extends Object { private static File dir; + private static HttpServer stopAPI; private static Callable stop; private WebResource webResource; private WebResource apiResource; @@ -70,7 +73,8 @@ dir.delete(); dir.mkdirs(); System.setProperty("quoridor.dir", dir.getPath()); - stop = UI.startServers(9991, null); + stopAPI = Quoridor.start(9990); + stop = UI.startServers(9991, "http://localhost:9990"); File passwd = new File(dir, "passwd"); FileOutputStream os = new FileOutputStream(passwd); @@ -92,6 +96,9 @@ if (stop != null) { stop.call(); } + if (stopAPI != null) { + stopAPI.stop(0); + } } static void deleteRec(File dir) throws IOException {