# HG changeset patch # User Jaroslav Tulach # Date 1256478951 -3600 # Node ID 232e4215394580dea51ca5d2a3257d8dc63f63db # Parent 6544ad908b05fde3fb569dc85b063a60bb31312c Showing the number of comments associated with each game diff -r 6544ad908b05 -r 232e42153945 freemarkerdor/pom.xml --- a/freemarkerdor/pom.xml Sun Oct 25 14:54:58 2009 +0100 +++ b/freemarkerdor/pom.xml Sun Oct 25 14:55:51 2009 +0100 @@ -10,7 +10,7 @@ org.apidesign freemarkerdor freemarkerdor - 1.33 + 1.34 http://maven.apache.org diff -r 6544ad908b05 -r 232e42153945 freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Sun Oct 25 14:54:58 2009 +0100 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Sun Oct 25 14:55:51 2009 +0100 @@ -54,11 +54,12 @@ W=West E=East GAME=Game -MOVENUMBER=# +MOVENUMBER=Move MOVES=Moves ROOT=Home TALK=Comments +comments=({0,choice,0#no comments|1#one comment|2#{0} comments}) NAME=Name PASSWORD=Password diff -r 6544ad908b05 -r 232e42153945 freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Sun Oct 25 14:54:58 2009 +0100 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Sun Oct 25 14:55:51 2009 +0100 @@ -74,6 +74,7 @@ }) TALK=Koment\u00E1\u0159e +comments=({0,choice,0#\u017E\u00E1dn\u00E9 koment\u00E1\u0159e|1#jeden koment\u00E1\u0159|2#2 koment\u00E1\u0159e|3#3 koment\u00E1\u0159e|4#4 koment\u00E1\u0159e|5#{0} koment\u00E1\u0159\u016F}) NAME=Jm\u00E9no PASSWORD=Heslo diff -r 6544ad908b05 -r 232e42153945 freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Sun Oct 25 14:54:58 2009 +0100 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Sun Oct 25 14:55:51 2009 +0100 @@ -55,6 +55,7 @@ <#macro game game> ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} <@before (now - game.@modified?number)?int/> + ${bundle("comments", game.@comments?number)} <#assign printed = printed + 1/> diff -r 6544ad908b05 -r 232e42153945 webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java Sun Oct 25 14:54:58 2009 +0100 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java Sun Oct 25 14:55:51 2009 +0100 @@ -42,7 +42,6 @@ import java.util.Map; import javax.ws.rs.core.MediaType; import org.junit.Test; -import org.w3c.dom.Document; import static org.junit.Assert.*; /** @@ -88,10 +87,6 @@ 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); @@ -125,10 +120,6 @@ GenericType> gType = new GenericType>() {}; - Document doc = webResource.path("games").accept("text/xml").get(Document.class); - assertNotNull("Can read games in form of XML", doc); - assertEquals("Name is correct", "gameIds", doc.getDocumentElement().getNodeName()); - assertEquals("One child", 1, doc.getDocumentElement().getChildNodes().getLength()); List games = webResource.path("games").accept("application/json").get(gType); assertEquals("One game", 1, games.size()); assertEquals("Same white", "Jarda", games.get(0).getWhite());