1.1 --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java Mon Aug 31 22:44:47 2009 +0200
1.2 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java Fri Sep 11 22:25:21 2009 +0200
1.3 @@ -96,6 +96,13 @@
1.4 GameId s = webResource.path("games").queryParam("white", "Jarda")
1.5 .queryParam("black", "Jirka").post(GameId.class);
1.6
1.7 + Thread.sleep(100);
1.8 + final long now = System.currentTimeMillis();
1.9 + if (s.getModified() >= now) {
1.10 + fail("The game is supposed to be modified in past");
1.11 + }
1.12 + Thread.sleep(100);
1.13 +
1.14 String msg = webResource.path("games").get(String.class);
1.15 //List<Game> games = webResource.path("games").get(new GenericType<List<Game>>() {});
1.16
1.17 @@ -125,6 +132,9 @@
1.18 }
1.19 GameId s2 = webResource.path("games/" + s.getId()).queryParam("player", "Jirka").queryParam("move", "S").put(GameId.class);
1.20 assertNotNull("Successful move", s2);
1.21 + if (s2.getModified() <= now) {
1.22 + fail("The game is newly modified");
1.23 + }
1.24
1.25 File game = new File(new File(dir, "games"), s2.getId());
1.26 assertTrue("File for game exists", game.exists());