h.putSingle("accept", "application/xml");
ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
ContainerResponse response = launcher.service("GET", "/", "", h, null, writer, null);
assertEquals(200, response.getStatus());
assertEquals("application/xml", response.getContentType().toString());
Book book = (Book)response.getEntity();
assertEquals("Hamlet", book.getTitle());
assertEquals("William Shakespeare", book.getAuthor());
assertTrue(book.isSendByPost());
// Resource2#m2()
writer = new ByteArrayContainerResponseWriter();
response = launcher.service("POST", "/", "", h, null, writer, null);
assertEquals(200, response.getStatus());
assertEquals("application/xml", response.getContentType().toString());
book = (Book)response.getEntity();
assertEquals("Hamlet\n", book.getTitle());
assertEquals("William Shakespeare\n", book.getAuthor());
assertFalse(book.isSendByPost());
unregistry(r2);
}