Package com.agiletec.plugins.jpaddressbook.aps.system.services.addressbook.model

Examples of com.agiletec.plugins.jpaddressbook.aps.system.services.addressbook.model.IContact


 
  public void testEdit() throws Throwable {
    try {
      Date birthdate1 = this._helper.setBirthdate(1982, 10, 25);
      IUserProfile profile = this._helper.createUserProfile("1", "name1 surname1", "email1", birthdate1, "it");
      IContact contact = this._helper.createContact(profile.getId(), "editorCoach", true, profile);
      this._addressBookManager.addContact(contact);
     
      String result = this.executeEdit("editorCoach", "notExistantContact");
      assertEquals(Action.INPUT, result);
      List<String> fieldErrors = this.getAction().getFieldErrors().get("contactKey");
      assertEquals(1, fieldErrors.size());
      assertEquals("*CONTATTO NULLO*", fieldErrors.get(0));
     
      result = this.executeEdit("editorCoach", contact.getId());
      assertEquals(Action.SUCCESS, result);
      IContact actionContact = ((ContactAction) this.getAction()).getContact();
      this.compareContacts(contact, actionContact);
     
      result = this.executeEdit("editorCustomers", contact.getId());
      assertEquals(Action.SUCCESS, result);
      actionContact = ((ContactAction) this.getAction()).getContact();
View Full Code Here


      result = this.executeSave(username, params);
      assertEquals(Action.SUCCESS, result);
     
      List<String> contactIds = this._addressBookManager.getAllowedContacts(username, null);
      assertEquals(1, contactIds.size());
      IContact contact = this._addressBookManager.getContact(contactIds.get(0));
      assertEquals(username, contact.getOwner());
      assertEquals(false, contact.isPublicContact());
      IUserProfile profile = contact.getContactInfo();
      assertEquals("name surname", ((ITextAttribute) profile.getAttribute("fullname")).getText());
      assertEquals("email@eeeeeeemail.it", ((ITextAttribute) profile.getAttribute("email")).getText());
      assertEquals("10/09/1986", ((DateAttribute) profile.getAttribute("birthdate")).getFormattedDate("dd/MM/yyyy"));
      assertEquals("lang", ((ITextAttribute) profile.getAttribute("language")).getText());
    } catch (Throwable t) {
View Full Code Here

  public void testSaveEditSuccessful() throws Throwable {
    try {
      String username = "editorCoach";
      Date birthdate = this._helper.setBirthdate(1982, 10, 25);
      IUserProfile profile = this._helper.createUserProfile("1", "name surname", "email", birthdate, "it");
      IContact contact = this._helper.createContact(profile.getId(), username, true, profile);
      this._addressBookManager.addContact(contact);
     
      String result = this.executeEdit(username, contact.getId());
      assertEquals(Action.SUCCESS, result);
     
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("Monotext:fullname", "nameMOD surnameMOD");
      params.put("Monotext:email", "email@eeeeeeemail.it");
      params.put("Date:birthdate", "10/09/1986");
      params.put("Monotext:language", "langMOD");
      result = this.executeSave(username, params);
      assertEquals(Action.SUCCESS, result);
     
      List<String> contactIds = this._addressBookManager.getAllowedContacts(username, null);
      assertEquals(1, contactIds.size());
      contact = this._addressBookManager.getContact(contactIds.get(0));
      assertEquals(username, contact.getOwner());
      assertEquals(true, contact.isPublicContact());
      profile = contact.getContactInfo();
      assertEquals("nameMOD surnameMOD", ((ITextAttribute) profile.getAttribute("fullname")).getText());
      assertEquals("email@eeeeeeemail.it", ((ITextAttribute) profile.getAttribute("email")).getText());
      assertEquals("10/09/1986", ((DateAttribute) profile.getAttribute("birthdate")).getFormattedDate("dd/MM/yyyy"));
      assertEquals("langMOD", ((ITextAttribute) profile.getAttribute("language")).getText());
    } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpaddressbook.aps.system.services.addressbook.model.IContact

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.