@Test(timeout=10000) public void testDelayedEmailNotificationOnDeadlineContentSingleObject() throws Exception { CountDownTaskEventListener countDownListener = new CountDownTaskEventListener(1, false, true); addCountDownListner(countDownListener); Map<String, Object> vars = new HashMap<String, Object>(); vars.put("now", new Date()); Reader reader = new InputStreamReader(getClass().getResourceAsStream(MvelFilePath.DeadlineWithNotificationContentSingleObject)); Task task = (Task) TaskFactory.evalTask(reader, vars); taskService.addTask(task, new HashMap<String, Object>()); long taskId = task.getId(); InternalContent content = (InternalContent) TaskModelProvider.getFactory().newContent(); ContentData marshalledObject = ContentMarshallerHelper.marshal(task, "'singleobject'", null); content.setContent(marshalledObject.getContent()); taskService.addContent(taskId, content); long contentId = content.getId(); content = (InternalContent) taskService.getContentById(contentId); Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); assertThat(unmarshallObject.toString()).isEqualTo("'singleobject'"); // emails should not be set yet assertThat(((MockNotificationListener)notificationListener).getEventsRecieved().size()).isEqualTo(0); countDownListener.waitTillCompleted(); // 1 email with two recipients should now exist assertThat(((MockNotificationListener)notificationListener).getEventsRecieved().size()).isEqualTo(1); } @Test(timeout=10000)
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); assertEquals("'singleobject'", unmarshallObject.toString());
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);
Object unmarshallObject = ContentMarshallerHelper.unmarshall(content.getContent(), null); checkContentSubjectAndBody(unmarshallObject);