freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java
branchstatistics-and-elo
changeset 180 c92831d4812c
parent 126 e905cd9b1e4a
child 234 0a71b6bd786f
     1.1 --- a/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java	Sun Oct 18 20:29:49 2009 +0200
     1.2 +++ b/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java	Thu Jan 07 22:57:43 2010 +0100
     1.3 @@ -33,6 +33,7 @@
     1.4  import com.sun.jersey.core.util.MultivaluedMapImpl;
     1.5  import com.sun.net.httpserver.HttpServer;
     1.6  import cz.xelfi.quoridor.webidor.resources.Quoridor;
     1.7 +import cz.xelfi.quoridor.statistics.resources.Statistics;
     1.8  import java.awt.Image;
     1.9  import java.io.File;
    1.10  import java.io.FileOutputStream;
    1.11 @@ -59,9 +60,11 @@
    1.12  public class UITest extends Object {
    1.13      private static File dir;
    1.14      private static HttpServer stopAPI;
    1.15 +    private static HttpServer stopStatistics;
    1.16      private static Callable<Void> stop;
    1.17      private WebResource webResource;
    1.18      private WebResource apiResource;
    1.19 +    private WebResource statResource;
    1.20  
    1.21      public UITest() throws Exception {
    1.22      }
    1.23 @@ -74,7 +77,8 @@
    1.24          dir.mkdirs();
    1.25          System.setProperty("quoridor.dir", dir.getPath());
    1.26          stopAPI = Quoridor.start(9990);
    1.27 -        stop = UI.startServers(9991, "http://localhost:9990");
    1.28 +        stopStatistics = Quoridor.start(9992);
    1.29 +        stop = UI.startServers(9991, "http://localhost:9990", "http://localhost:9992");
    1.30  
    1.31          File passwd = new File(dir, "passwd");
    1.32          FileOutputStream os = new FileOutputStream(passwd);
    1.33 @@ -88,6 +92,7 @@
    1.34          Client client = new Client();
    1.35          webResource = client.resource(new URI("http://localhost:9991/"));
    1.36          apiResource = client.resource(new URI("http://localhost:9990/"));
    1.37 +        statResource = client.resource(new URI("http://localhost:9992/"));
    1.38      }
    1.39  
    1.40      @AfterClass
    1.41 @@ -126,6 +131,12 @@
    1.42          assertTrue(serviceWadl.length() > 0);
    1.43      }
    1.44  
    1.45 +    @Test public void testStatWadl() {
    1.46 +        String serviceWadl = statResource.path("application.wadl").
    1.47 +                accept(MediaTypes.WADL).get(String.class);
    1.48 +        assertTrue(serviceWadl.length() > 0);
    1.49 +    }
    1.50 +
    1.51      @Test public void testGetIndexPage() throws Exception {
    1.52          String logJarda = apiResource.path("login").
    1.53              queryParam("name", "Jarda").