1.1 --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java Sun Oct 18 15:48:47 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);