Replace the time with unified text
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sun, 25 Oct 2009 14:23:51 +0100
changeset 13038615a81d3c4
parent 129 fd95f7873b96
child 131 19e81456eef2
Replace the time with unified text
webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java
     1.1 --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java	Sat Oct 24 08:42:37 2009 +0200
     1.2 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java	Sun Oct 25 14:23:51 2009 +0100
     1.3 @@ -120,14 +120,18 @@
     1.4          GameId comment1 = webResource.path("games/" + s.getId()).
     1.5              queryParam("loginID", logJarda).
     1.6              queryParam("player", "Jarda").queryParam("comment", "I like this game!").put(GameId.class);
     1.7 +        assertEquals("One comment in the game", 1, comment1.getComments());
     1.8  
     1.9          GameId comment2 = webResource.path("games/" + s.getId()).
    1.10              queryParam("loginID", logJirka).
    1.11              queryParam("player", "Jirka").queryParam("comment", comment).put(GameId.class);
    1.12 +        assertEquals("Snd comment in the game", 2, comment2.getComments());
    1.13 +
    1.14          GameId s2 = webResource.path("games/" + s.getId()).
    1.15              queryParam("loginID", logJirka).
    1.16              queryParam("player", "Jirka").queryParam("move", "S").put(GameId.class);
    1.17          assertNotNull("Successful move", s2);
    1.18 +        assertEquals("Still two comments in the game", 2, s2.getComments());
    1.19  
    1.20          File game = new File(new File(dir, "games"), s1.getId());
    1.21          assertTrue("File for game exists", game.exists());
    1.22 @@ -179,10 +183,10 @@
    1.23          File tmp = File.createTempFile("test-board", "game");
    1.24          read.storeGame(rg, tmp);
    1.25  
    1.26 -        String sss1 = readFile(game);
    1.27 +        String sss1 = readFile(game).replaceAll("@.*:", "date");
    1.28          Thread.sleep(1500);
    1.29  
    1.30 -        assertEquals("Newly written file remains the same", sss1, readFile(tmp));
    1.31 +        assertEquals("Newly written file remains the same", sss1, readFile(tmp).replaceAll("@.*:", "date"));
    1.32  
    1.33          String sGame = webResource.path("games").path(s.getId()).accept(MediaType.TEXT_XML).get(String.class);
    1.34          Game readGame = webResource.path("games").path(s.getId()).accept(MediaType.TEXT_XML).get(Game.class);