@Test public void importDevoxx(@ArquillianResource URL baseUrl) throws IOException { String message = postAndReadSingleMessage(baseUrl.toExternalForm() + "rest/conference/import/devoxx"); }
@POST @Path("/import/devoxx") public Response importDevoxx() { StringBuilder message = new StringBuilder(); try { utx.begin(); em.joinTransaction(); Conference conference = devoxxImporter.importConference(true); message.append("Devoxx conference with ") .append(conference.getDayList().size()).append(" days, ") .append(conference.getTimeslotList().size()) .append(" timeslots, ").append(conference.getRoomList().size()) .append(" rooms, ").append(conference.getTrackList().size()) .append(" tracks, ").append(conference.getSpeakerList().size()) .append(" speakers, ").append(conference.getTalkList().size()) .append(" talks imported successfully."); LOG.info(message.toString()); } catch (NotSupportedException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } finally { try { utx.commit(); } catch (SecurityException | IllegalStateException | RollbackException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } } return Response.ok(message).build(); }
ConferenceService { @POST @Path("/import/devoxx") public Response importDevoxx() { StringBuilder message = new StringBuilder(); try { utx.begin(); em.joinTransaction(); Conference conference = devoxxImporter.importConference(true); message.append("Devoxx conference with ") .append(conference.getDayList().size()).append(" days, ") .append(conference.getTimeslotList().size()) .append(" timeslots, ").append(conference.getRoomList().size()) .append(" rooms, ").append(conference.getTrackList().size()) .append(" tracks, ").append(conference.getSpeakerList().size()) .append(" speakers, ").append(conference.getTalkList().size()) .append(" talks imported successfully."); LOG.info(message.toString()); } catch (NotSupportedException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } finally { try { utx.commit(); } catch (SecurityException | IllegalStateException | RollbackException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } } return Response.ok(message).build(); } }
ConferenceService { @POST @Path("/import/devoxx") public Response importDevoxx() { StringBuilder message = new StringBuilder(); try { utx.begin(); em.joinTransaction(); Conference conference = devoxxImporter.importConference(true); message.append("Devoxx conference with ") .append(conference.getDayList().size()).append(" days, ") .append(conference.getTimeslotList().size()) .append(" timeslots, ").append(conference.getRoomList().size()) .append(" rooms, ").append(conference.getTrackList().size()) .append(" tracks, ").append(conference.getSpeakerList().size()) .append(" speakers, ").append(conference.getTalkList().size()) .append(" talks imported successfully."); LOG.info(message.toString()); } catch (NotSupportedException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } finally { try { utx.commit(); } catch (SecurityException | IllegalStateException | RollbackException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } } return Response.ok(message).build(); }  }
ConferenceService { @POST @Path("/import/devoxx") public Response importDevoxx() { StringBuilder message = new StringBuilder(); try { utx.begin(); em.joinTransaction(); Conference conference = devoxxImporter.importConference(true); message.append("Devoxx conference with ") .append(conference.getDayList().size()).append(" days, ") .append(conference.getTimeslotList().size()) .append(" timeslots, ").append(conference.getRoomList().size()) .append(" rooms, ").append(conference.getTrackList().size()) .append(" tracks, ").append(conference.getSpeakerList().size()) .append(" speakers, ").append(conference.getTalkList().size()) .append(" talks imported successfully."); LOG.info(message.toString()); } catch (NotSupportedException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } finally { try { utx.commit(); } catch (SecurityException | IllegalStateException | RollbackException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } } return Response.ok(message).build(); }  @POST @Path("/import/devoxx") Response importDevoxx(); @GET @Path("") List<Conference> getAll(); @GET @Path("/{conferenceId}") Conference getOne(@PathParam("conferenceId") Long conferenceId); @DELETE @Path("/{conferenceId}") void deleteOne(@PathParam("conferenceId") Long conferenceId); @PUT @Path("/{conferenceId}/solve") Response solveSchedule(@PathParam("conferenceId") Long conferenceId); @GET @Path("/{conferenceId}/isSolving") Response isSolving(@PathParam("conferenceId") Long conferenceId); @PUT @Path("/{conferenceId}/terminateSolving") Response terminateSolving(@PathParam("conferenceId") Long conferenceId); }
ConferenceService { @POST @Path("/import/devoxx") public Response importDevoxx() { StringBuilder message = new StringBuilder(); try { utx.begin(); em.joinTransaction(); Conference conference = devoxxImporter.importConference(true); message.append("Devoxx conference with ") .append(conference.getDayList().size()).append(" days, ") .append(conference.getTimeslotList().size()) .append(" timeslots, ").append(conference.getRoomList().size()) .append(" rooms, ").append(conference.getTrackList().size()) .append(" tracks, ").append(conference.getSpeakerList().size()) .append(" speakers, ").append(conference.getTalkList().size()) .append(" talks imported successfully."); LOG.info(message.toString()); } catch (NotSupportedException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } finally { try { utx.commit(); } catch (SecurityException | IllegalStateException | RollbackException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { LOG.error(e.getLocalizedMessage(), e); } } return Response.ok(message).build(); }  @POST @Path("/import/devoxx") Response importDevoxx(); @GET @Path("") List<Conference> getAll(); @GET @Path("/{conferenceId}") Conference getOne(@PathParam("conferenceId") Long conferenceId); @DELETE @Path("/{conferenceId}") void deleteOne(@PathParam("conferenceId") Long conferenceId); @PUT @Path("/{conferenceId}/solve") Response solveSchedule(@PathParam("conferenceId") Long conferenceId); @GET @Path("/{conferenceId}/isSolving") Response isSolving(@PathParam("conferenceId") Long conferenceId); @PUT @Path("/{conferenceId}/terminateSolving") Response terminateSolving(@PathParam("conferenceId") Long conferenceId);  }