freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java
changeset 126 e905cd9b1e4a
parent 124 90371f3eb106
child 180 c92831d4812c
     1.1 --- a/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java	Sun Oct 18 15:48:47 2009 +0200
     1.2 +++ b/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java	Sun Oct 18 20:29:49 2009 +0200
     1.3 @@ -31,6 +31,8 @@
     1.4  import com.sun.jersey.api.client.WebResource;
     1.5  import com.sun.jersey.core.header.MediaTypes;
     1.6  import com.sun.jersey.core.util.MultivaluedMapImpl;
     1.7 +import com.sun.net.httpserver.HttpServer;
     1.8 +import cz.xelfi.quoridor.webidor.resources.Quoridor;
     1.9  import java.awt.Image;
    1.10  import java.io.File;
    1.11  import java.io.FileOutputStream;
    1.12 @@ -56,6 +58,7 @@
    1.13   */
    1.14  public class UITest extends Object {
    1.15      private static File dir;
    1.16 +    private static HttpServer stopAPI;
    1.17      private static Callable<Void> stop;
    1.18      private WebResource webResource;
    1.19      private WebResource apiResource;
    1.20 @@ -70,7 +73,8 @@
    1.21          dir.delete();
    1.22          dir.mkdirs();
    1.23          System.setProperty("quoridor.dir", dir.getPath());
    1.24 -        stop = UI.startServers(9991, null);
    1.25 +        stopAPI = Quoridor.start(9990);
    1.26 +        stop = UI.startServers(9991, "http://localhost:9990");
    1.27  
    1.28          File passwd = new File(dir, "passwd");
    1.29          FileOutputStream os = new FileOutputStream(passwd);
    1.30 @@ -92,6 +96,9 @@
    1.31          if (stop != null) {
    1.32              stop.call();
    1.33          }
    1.34 +        if (stopAPI != null) {
    1.35 +            stopAPI.stop(0);
    1.36 +        }
    1.37      }
    1.38  
    1.39      static void deleteRec(File dir) throws IOException {