Package com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model

Examples of com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model.Answer


    ((ITextAttribute) message.getAttribute("Note")).setText(note, null);
    return message;
    }

    public Answer createAnswer(String answerId, String messageId, String operator, Date sendDate, String text) {
      Answer answer = new Answer();
      answer.setAnswerId(answerId);
      answer.setMessageId(messageId);
      answer.setOperator(operator);
      answer.setSendDate(sendDate);
      answer.setText(text);
    return answer;
    }
View Full Code Here


    this._helper.addMessage(message2);
    Message message3 = this._helper.createMessage(null, "mainEditor", "it", today, "MyCompany3", "MyAddress3", "MyEmail3@aaaaaaaaaaaa.ittt", "MyNotes");
    this._helper.addMessage(message3);
    Message message4 = this._helper.createMessage(null, null, "it", tomorrow, "MyCompany4", "MyAddress4", "MyEmail4@aaaaaaaaaaaa.ittt", "MyNotes");
    this._helper.addMessage(message4);
    Answer answer = this._helper.createAnswer("1", message4.getId(), "mainEditor", new Date(), "text1");
    this._helper.addAnswer(answer);

    Map<String, String> params = new HashMap<String, String>();
    params.put("entityTypeCode", "PER");
    String result = this.executeSearch(username, params);
View Full Code Here

    Message message = this._helper.createMessage(null, null, "it", new Date(), "company", "address", "indirizzoemail@dominioinesistente.it", "note");
    this._helper.addMessage(message);
    String messageId = message.getId();
    assertNotNull(this._messageDao.loadEntityRecord(messageId));
   
    Answer answer1 = this._helper.createAnswer(null, messageId, "admin", new Date(), "text1");
    this._helper.addAnswer(answer1);
    Answer answer2 = this._helper.createAnswer(null, messageId, "admin", new Date(), "text2");
    this._helper.addAnswer(answer2);
    List<Answer> answers = this._messageDao.loadAnswers(messageId);
    assertEquals(2, answers.size());
   
    this._messageDao.deleteEntity(messageId);
View Full Code Here

  public void testDeleteUserMessages() throws Throwable {
    Message message1 = this._helper.createMessage(null, "admin", "it", new Date(), "company1", "address1", "email1@miodominio.it", "note1");
    this._helper.addMessage(message1);
    String messageId1 = message1.getId();
    assertNotNull(this._messageDao.loadEntityRecord(messageId1));
    Answer answer1 = this._helper.createAnswer(null, messageId1, "admin", new Date(), "text1");
    this._helper.addAnswer(answer1);
    Answer answer2 = this._helper.createAnswer(null, messageId1, "admin", new Date(), "text2");
    this._helper.addAnswer(answer2);
    List<Answer> answers = this._messageDao.loadAnswers(messageId1);
    assertEquals(2, answers.size());
   
    Message message2 = this._helper.createMessage(null, "mainEditor", "it", new Date(), "company2", "address2", "email2@miodominio.it", "note2");
    this._helper.addMessage(message2);
    String messageId2 = message2.getId();
    assertNotNull(this._messageDao.loadEntityRecord(messageId2));
    Answer answer3 = this._helper.createAnswer(null, messageId2, "admin", new Date(), "text3");
    this._helper.addAnswer(answer3);
    answers = this._messageDao.loadAnswers(messageId2);
    assertEquals(1, answers.size());
   
    this._messageDao.deleteUserMessages("admin");
View Full Code Here

    Message message = this._helper.createMessage(null, "admin", "it", new Date(), "company", "address", "indirizzoemail@dominioinesistente.it", "note");
    this._helper.addMessage(message);
    String messageId = message.getId();
    assertNotNull(this._messageDao.loadEntityRecord(messageId));

    Answer answer1 = this._helper.createAnswer("1", messageId, "mainEditor", new Date(), "text1");
    this._messageDao.addAnswer(answer1);
    Answer answer2 = this._helper.createAnswer("2", messageId, "mainEditor", new Date(), "text2");
    this._messageDao.addAnswer(answer2);
   
    List<Answer> answers = this._messageDao.loadAnswers(messageId);
    assertEquals(2, answers.size());
   
View Full Code Here

    assertEquals("messageNotFound", result);

    Message message = this._helper.createMessage(null, "mainEditor", "it", new Date(), "MyName", "MySurname", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._helper.addMessage(message);
    String messageId = message.getId();
    Answer answer1 = this._helper.createAnswer("1", messageId, "mainEditor", new Date(), "text1");
    this._helper.addAnswer(answer1);
    Answer answer2 = this._helper.createAnswer("2", messageId, "mainEditor", new Date(), "text2");
    this._helper.addAnswer(answer2);
    result = this.executeView("admin", "PER", messageId);
    assertEquals(Action.SUCCESS, result);
    AbstractMessageAction action = (AbstractMessageAction) this.getAction();
    Message receivedMessage = action.getMessage();
View Full Code Here

    params.put("text", "Text of answer");
    String result = this.executeSendAnswer("admin", params);
    assertEquals(Action.SUCCESS, result);
    List<Answer> addedAnswers = this._messageManager.getAnswers(messageId);
    assertEquals(1, addedAnswers.size());
    Answer answer = addedAnswers.get(0);
    assertEquals(messageId, answer.getMessageId());
    assertEquals("admin", answer.getOperator());
    assertEquals("Text of answer", answer.getText());
    assertNotNull(answer.getAnswerId());
    assertNotNull(answer.getSendDate());
  }
View Full Code Here

  public void testTrash() throws Throwable {
    Message message = this._helper.createMessage(null, "mainEditor", "it", new Date(), "MyName", "MySurname", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._helper.addMessage(message);
    String messageId = message.getId();
    assertNotNull(this._messageManager.getMessage(messageId));
    Answer answer1 = this._helper.createAnswer("1", messageId, "mainEditor", new Date(), "text1");
    this._helper.addAnswer(answer1);

    String result = this.executeTrash("admin", messageId+"unknow");
    assertEquals("messageNotFound", result);
View Full Code Here

  public void testDelete() throws Throwable {
    Message message = this._helper.createMessage(null, "mainEditor", "it", new Date(), "MyName", "MySurname", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._helper.addMessage(message);
    String messageId = message.getId();
    assertNotNull(this._messageManager.getMessage(messageId));
    Answer answer1 = this._helper.createAnswer("1", messageId, "mainEditor", new Date(), "text1");
    this._helper.addAnswer(answer1);

    String result = this.executeDelete("admin", messageId+"unknow");
    assertEquals("messageNotFound", result);
View Full Code Here

  public void testSearchIdAnswered() throws Throwable {
    Date currentDate = new Date();
    Message message1 = this._helper.createMessage("TEST1", "admin", "it", currentDate, "MyName", "MySurname", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._messageDao.addEntity(message1);
    String message1Id = message1.getId();
    Answer answer1 = this._helper.createAnswer(null, message1Id, "admin", new Date(), "text1");
    this._helper.addAnswer(answer1);
   
    Message message2 = this._helper.createMessage("TEST2", "mainEditor", "it", currentDate, "MyCompany", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._messageDao.addEntity(message2);
    String message2Id = message2.getId();
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model.Answer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.