# HG changeset patch # User Jaroslav Tulach # Date 1256477031 -3600 # Node ID 38615a81d3c408fcbe05b51f03cbeef940165128 # Parent fd95f7873b96273a72abfd09093d011e5d6b9c1c Replace the time with unified text diff -r fd95f7873b96 -r 38615a81d3c4 webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java Sat Oct 24 08:42:37 2009 +0200 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java Sun Oct 25 14:23:51 2009 +0100 @@ -120,14 +120,18 @@ GameId comment1 = webResource.path("games/" + s.getId()). queryParam("loginID", logJarda). queryParam("player", "Jarda").queryParam("comment", "I like this game!").put(GameId.class); + assertEquals("One comment in the game", 1, comment1.getComments()); GameId comment2 = webResource.path("games/" + s.getId()). queryParam("loginID", logJirka). queryParam("player", "Jirka").queryParam("comment", comment).put(GameId.class); + assertEquals("Snd comment in the game", 2, comment2.getComments()); + GameId s2 = webResource.path("games/" + s.getId()). queryParam("loginID", logJirka). queryParam("player", "Jirka").queryParam("move", "S").put(GameId.class); assertNotNull("Successful move", s2); + assertEquals("Still two comments in the game", 2, s2.getComments()); File game = new File(new File(dir, "games"), s1.getId()); assertTrue("File for game exists", game.exists()); @@ -179,10 +183,10 @@ File tmp = File.createTempFile("test-board", "game"); read.storeGame(rg, tmp); - String sss1 = readFile(game); + String sss1 = readFile(game).replaceAll("@.*:", "date"); Thread.sleep(1500); - assertEquals("Newly written file remains the same", sss1, readFile(tmp)); + assertEquals("Newly written file remains the same", sss1, readFile(tmp).replaceAll("@.*:", "date")); String sGame = webResource.path("games").path(s.getId()).accept(MediaType.TEXT_XML).get(String.class); Game readGame = webResource.path("games").path(s.getId()).accept(MediaType.TEXT_XML).get(Game.class);