webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java
changeset 54 f041b6570ff9
parent 48 69e897fe8140
child 78 5ea4172dcf8b
     1.1 --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java	Sun Aug 30 14:37:47 2009 +0200
     1.2 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/QuoridorTest.java	Mon Aug 31 22:44:47 2009 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4  import java.util.Map;
     1.5  import javax.ws.rs.core.MediaType;
     1.6  import org.junit.Test;
     1.7 +import org.w3c.dom.Document;
     1.8  import static org.junit.Assert.*;
     1.9  
    1.10  /**
    1.11 @@ -100,6 +101,10 @@
    1.12  
    1.13          GenericType<List<GameId>> gType = new GenericType<List<GameId>>() {};
    1.14  
    1.15 +        Document doc = webResource.path("games").accept("text/xml").get(Document.class);
    1.16 +        assertNotNull("Can read games in form of XML", doc);
    1.17 +        assertEquals("Name is correct", "gameIds", doc.getDocumentElement().getNodeName());
    1.18 +        assertEquals("One child", 1, doc.getDocumentElement().getChildNodes().getLength());
    1.19          List<GameId> games = webResource.path("games").accept("application/json").get(gType);
    1.20          assertEquals("One game", 1, games.size());
    1.21          assertEquals("Same white", "Jarda", games.get(0).getWhite());