# HG changeset patch # User Jaroslav Tulach # Date 1255873727 -7200 # Node ID 90371f3eb106c23e6b9e1bf823a89e781b4d6e9e # Parent 4529cb22ff7de5a4374dcac4c7f477ef483f8caa Removing /api prefix from the webidor server diff -r 4529cb22ff7d -r 90371f3eb106 freemarkerdor/pom.xml --- a/freemarkerdor/pom.xml Sun Oct 11 19:32:48 2009 +0200 +++ b/freemarkerdor/pom.xml Sun Oct 18 15:48:47 2009 +0200 @@ -10,13 +10,13 @@ org.apidesign freemarkerdor freemarkerdor - 1.32 + 1.33 http://maven.apache.org ${project.groupId} webidor - 1.4 + [1.0,2.0) org.netbeans.modules diff -r 4529cb22ff7d -r 90371f3eb106 freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sun Oct 11 19:32:48 2009 +0200 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sun Oct 18 15:48:47 2009 +0200 @@ -38,7 +38,6 @@ import cz.xelfi.quoridor.IllegalPositionException; import cz.xelfi.quoridor.webidor.resources.Quoridor; import java.awt.Image; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -335,7 +334,7 @@ if (remoteAPI == null) { int localAPIPort = port - 1; apiServer = Quoridor.start(localAPIPort); - base = client.resource(new URI("http://localhost:" + localAPIPort + "/api/")); + base = client.resource(new URI("http://localhost:" + localAPIPort)); } else { base = client.resource(new URI(remoteAPI)); apiServer = null; diff -r 4529cb22ff7d -r 90371f3eb106 freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java --- a/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java Sun Oct 11 19:32:48 2009 +0200 +++ b/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java Sun Oct 18 15:48:47 2009 +0200 @@ -83,7 +83,7 @@ Client client = new Client(); webResource = client.resource(new URI("http://localhost:9991/")); - apiResource = client.resource(new URI("http://localhost:9990/api/")); + apiResource = client.resource(new URI("http://localhost:9990/")); } @AfterClass @@ -107,16 +107,18 @@ dir.delete(); } - /** - * Test if a WADL document is available at the relative path - * "application.wadl". - */ @Test public void testApplicationWadl() { String serviceWadl = webResource.path("application.wadl"). accept(MediaTypes.WADL).get(String.class); assertTrue(serviceWadl.length() > 0); } + @Test public void testAPIWadl() { + String serviceWadl = apiResource.path("application.wadl"). + accept(MediaTypes.WADL).get(String.class); + assertTrue(serviceWadl.length() > 0); + } + @Test public void testGetIndexPage() throws Exception { String logJarda = apiResource.path("login"). queryParam("name", "Jarda"). diff -r 4529cb22ff7d -r 90371f3eb106 webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java Sun Oct 11 19:32:48 2009 +0200 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java Sun Oct 18 15:48:47 2009 +0200 @@ -50,7 +50,7 @@ * * @author Jaroslav Tulach */ -@Path("/api") +@Path("/") @Singleton public final class Quoridor { private final File path; diff -r 4529cb22ff7d -r 90371f3eb106 webidor/src/test/java/cz/xelfi/quoridor/webidor/FinishedGameTest.java --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/FinishedGameTest.java Sun Oct 11 19:32:48 2009 +0200 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/FinishedGameTest.java Sun Oct 18 15:48:47 2009 +0200 @@ -77,7 +77,6 @@ dir.delete(); } @Test public void testNotLoggedIn() { - webResource = webResource.path("api"); String status = webResource.path("login").queryParam("id", "not-logged-in"). accept(MediaType.TEXT_PLAIN).get(String.class); assertEquals("Nobody is logged in", "", status); @@ -85,7 +84,6 @@ @Test public void testCreateAGame() throws Exception { - webResource = webResource.path("api"); String logJarda = webResource.path("login"). queryParam("name", "Jarda"). queryParam("password", "heslo"). @@ -131,7 +129,6 @@ } @Test public void testResignAGame() throws Exception { - webResource = webResource.path("api"); String logJarda = webResource.path("login"). queryParam("name", "Jarda"). queryParam("password", "heslo"). diff -r 4529cb22ff7d -r 90371f3eb106 webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java Sun Oct 11 19:32:48 2009 +0200 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java Sun Oct 18 15:48:47 2009 +0200 @@ -99,7 +99,6 @@ } @Test public void testCreateAGame() throws Exception { - webResource = webResource.path("api"); String logJarda = webResource.path("login"). queryParam("name", "Jarda"). queryParam("password", "heslo"). diff -r 4529cb22ff7d -r 90371f3eb106 webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java Sun Oct 11 19:32:48 2009 +0200 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java Sun Oct 18 15:48:47 2009 +0200 @@ -89,7 +89,6 @@ } @Test public void testCreateAGame() throws Exception { - webResource = webResource.path("api"); String logJarda = webResource.path("login"). queryParam("name", "Jarda"). queryParam("password", "heslo").