Showing the number of comments associated with each game
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sun, 25 Oct 2009 14:55:51 +0100
changeset 135232e42153945
parent 134 6544ad908b05
child 136 73b18c815499
child 137 4e5cf409d1aa
Showing the number of comments associated with each game
freemarkerdor/pom.xml
freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties
freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties
freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java
     1.1 --- a/freemarkerdor/pom.xml	Sun Oct 25 14:54:58 2009 +0100
     1.2 +++ b/freemarkerdor/pom.xml	Sun Oct 25 14:55:51 2009 +0100
     1.3 @@ -10,7 +10,7 @@
     1.4    <groupId>org.apidesign</groupId>
     1.5    <artifactId>freemarkerdor</artifactId>
     1.6    <name>freemarkerdor</name>
     1.7 -  <version>1.33</version>
     1.8 +  <version>1.34</version>
     1.9    <url>http://maven.apache.org</url>
    1.10    <dependencies>
    1.11      <dependency>
     2.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties	Sun Oct 25 14:54:58 2009 +0100
     2.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties	Sun Oct 25 14:55:51 2009 +0100
     2.3 @@ -54,11 +54,12 @@
     2.4  W=West
     2.5  E=East
     2.6  GAME=Game
     2.7 -MOVENUMBER=#
     2.8 +MOVENUMBER=Move
     2.9  MOVES=Moves
    2.10  ROOT=Home
    2.11  
    2.12  TALK=Comments
    2.13 +comments=({0,choice,0#no comments|1#one comment|2#{0} comments})
    2.14  
    2.15  NAME=Name
    2.16  PASSWORD=Password
     3.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties	Sun Oct 25 14:54:58 2009 +0100
     3.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties	Sun Oct 25 14:55:51 2009 +0100
     3.3 @@ -74,6 +74,7 @@
     3.4  })
     3.5  
     3.6  TALK=Koment\u00E1\u0159e
     3.7 +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})
     3.8  
     3.9  NAME=Jm\u00E9no
    3.10  PASSWORD=Heslo
     4.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Sun Oct 25 14:54:58 2009 +0100
     4.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Sun Oct 25 14:55:51 2009 +0100
     4.3 @@ -55,6 +55,7 @@
     4.4        <#macro game game>
     4.5            ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} 
     4.6            <a href="/games/${game.@id}/"><@before (now - game.@modified?number)?int/></a>
     4.7 +          ${bundle("comments", game.@comments?number)}
     4.8            <#assign printed = printed + 1/>
     4.9        </#macro>
    4.10  
     5.1 --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java	Sun Oct 25 14:54:58 2009 +0100
     5.2 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java	Sun Oct 25 14:55:51 2009 +0100
     5.3 @@ -42,7 +42,6 @@
     5.4  import java.util.Map;
     5.5  import javax.ws.rs.core.MediaType;
     5.6  import org.junit.Test;
     5.7 -import org.w3c.dom.Document;
     5.8  import static org.junit.Assert.*;
     5.9  
    5.10  /**
    5.11 @@ -88,10 +87,6 @@
    5.12          dir.delete();
    5.13      }
    5.14  
    5.15 -    /**
    5.16 -     * Test if a WADL document is available at the relative path
    5.17 -     * "application.wadl".
    5.18 -     */
    5.19      @Test public void testApplicationWadl() {
    5.20          String serviceWadl = webResource.path("application.wadl").
    5.21                  accept(MediaTypes.WADL).get(String.class);
    5.22 @@ -125,10 +120,6 @@
    5.23  
    5.24          GenericType<List<GameId>> gType = new GenericType<List<GameId>>() {};
    5.25  
    5.26 -        Document doc = webResource.path("games").accept("text/xml").get(Document.class);
    5.27 -        assertNotNull("Can read games in form of XML", doc);
    5.28 -        assertEquals("Name is correct", "gameIds", doc.getDocumentElement().getNodeName());
    5.29 -        assertEquals("One child", 1, doc.getDocumentElement().getChildNodes().getLength());
    5.30          List<GameId> games = webResource.path("games").accept("application/json").get(gType);
    5.31          assertEquals("One game", 1, games.size());
    5.32          assertEquals("Same white", "Jarda", games.get(0).getWhite());