/** Invokes additional methods of JAX-RS resource as local EJB. */ @Test public void testAsLocalEJB() throws Exception { log.info("entering testAsLocalEJB()"); // Create book. Book book1 = new Book("RESTEasy: the Sequel"); int id1 = localResource.createBook(book1); log.info("id1: " + id1); Assert.assertEquals(Counter.INITIAL_VALUE, id1); // Create another book. Book book2 = new Book("RESTEasy: It's Alive"); int id2 = localResource.createBook(book2); log.info("id2: " + id2); Assert.assertEquals(Counter.INITIAL_VALUE + 1, id2); // Retrieve first book. Book bookResponse1 = localResource.lookupBookById(id1); log.info("book1 response: " + bookResponse1); Assert.assertEquals(book1, bookResponse1); // Retrieve second book. Book bookResponse2 = localResource.lookupBookById(id2); log.info("book2 response: " + bookResponse2); Assert.assertEquals(book2, bookResponse2); // Verify that EJBBookReader and EJBBookWriter haven't been used. localResource.testUse(0); // Reset counter. localResource.reset(); }