@DELETE @Path("/{testSuiteID:[0-9][0-9]*}") @Produces(MediaType.APPLICATION_JSON) public Response deleteTestSuite(@PathParam("testSuiteID") long id) { TestSuite testSuiteToRemove = testSuiteManager.findById(id); jcrBean.removeTestSuite(testSuiteToRemove.getName()); testSuiteManager.deleteTestSuite(testSuiteManager.findById(id)); return Response.ok().build(); }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public TestSuite createTestSuite(TestSuite testSuite) { TestSuite result = null; if (testSuiteManager.getTestSuite(testSuite.getName()) == null) { result = testSuiteManager.createTestSuite(testSuite); } else { result = testSuite; } return result; }
@GET @Path("/{testSuiteID:[0-9][0-9]*}") @Produces(MediaType.APPLICATION_JSON) public TestSuite getTestSuite(@PathParam("testSuiteID") long id) { return testSuiteManager.findById(id); }
@GET @Produces(MediaType.APPLICATION_JSON) public List<TestSuite> getAllTestSuites() { return testSuiteManager.getAllTestSuites(); }