@Test public void testCreated2Running2Aborted2Finished2Deleted() { // create evaluation, model and vote Evaluation eval = postEvaluation(evalMsg); postModel(eval.getEvaluationUrl(), model); assertNotNull(eval); // change to running state evalMsg.setState(EvaluationMapper.mapEvaluationState(EvaluationE.EvaluationState.RUNNING)); eval = putEvaluation(eval.getEvaluationUrl(), evalMsg); assertNotNull(eval); Vote vote = postSingleVote(eval.getEvaluationUrl(), voteMsg1); // change to aborted state evalMsg.setState(EvaluationMapper.mapEvaluationState(EvaluationE.EvaluationState.ABORTED)); eval = putEvaluation(eval.getEvaluationUrl(), evalMsg); assertNotNull(eval); // change to aborted state with past date evalMsg.setState(EvaluationMapper.mapEvaluationState(EvaluationE.EvaluationState.ABORTED)); try { evalMsg.setPollDeadline(DateUtil.getXmlGregCal(new GregorianCalendar(2000, 1, 1).getTime())); } catch (DatatypeConfigurationException e) { log.error(e); } eval = putEvaluation(eval.getEvaluationUrl(), evalMsg); assertNotNull(eval); // change to aborted state evalMsg.setState(EvaluationMapper.mapEvaluationState(EvaluationE.EvaluationState.FINISHED)); eval = putEvaluation(eval.getEvaluationUrl(), evalMsg); assertNotNull(eval); // clean up deleteSingleVote(vote.getVoteUrl()); deleteEvaluation(eval.getEvaluationUrl()); }
@Test public void testCreated2Running2Aborted2Deleted() { // create evaluation, model and vote Evaluation eval = postEvaluation(evalMsg); postModel(eval.getEvaluationUrl(), model); assertNotNull(eval); // change to running state evalMsg.setState(EvaluationMapper.mapEvaluationState(EvaluationE.EvaluationState.RUNNING)); eval = putEvaluation(eval.getEvaluationUrl(), evalMsg); assertNotNull(eval); Vote vote = postSingleVote(eval.getEvaluationUrl(), voteMsg1); // change to aborted state evalMsg.setState(EvaluationMapper.mapEvaluationState(EvaluationE.EvaluationState.ABORTED)); eval = putEvaluation(eval.getEvaluationUrl(), evalMsg); assertNotNull(eval); // clean up deleteSingleVote(vote.getVoteUrl()); deleteEvaluation(eval.getEvaluationUrl()); }