Examples of IContact


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

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

      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

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

  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

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

    }
   
    private void execute(OpenJPAEntityManagerFactorySPI myEMF) throws Exception {
        Log log = myEMF.getConfiguration().getLog("test");
        //EntityManager em = myEMF.createEntityManager();
        IContact contact = null;
       
        try {
            if (log.isTraceEnabled())
                log.trace("creating contact");
            try {      
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

        return annuityHolder;
    }

    private void verifyContactValues(OpenJPAEntityManagerFactorySPI myEMF, IContact contact) throws Exception {
        // read the contact with id.
        IContact results = null;
        results = findContactById(myEMF, Contact.class, contact.getId());
        assertEqual(contact, results,
            "Contact from Client is not equal to DB value.", "Mismacth was found.");    
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

            "Contact from Client is not equal to DB value.", "Mismacth was found.");    
    }

    private IContact findContactById(OpenJPAEntityManagerFactorySPI myEMF, Class<Contact> class1, String id) {
        EntityManager em = createEM(myEMF);
        IContact ic = em.find(class1, id);
        closeEM(em);
        return ic;
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

    }

    private IContact createContact(OpenJPAEntityManagerFactorySPI myEMF) {
        EntityManager em = createEM(myEMF);
        em.getTransaction().begin();
        IContact contact = null;
        contact = new Contact();
        contact.setContactType(ContactType.BUSINESS);
        contact.setId(getId());
        contact.setEmail("here@there");
        contact.setPhone("555-5555");
        em.persist(contact);
        em.getTransaction().commit();
        closeEM(em);
        return contact;
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

    }
   
    private void execute(OpenJPAEntityManagerFactorySPI myEMF) throws Exception {
        Log log = myEMF.getConfiguration().getLog("test");
        //EntityManager em = myEMF.createEntityManager();
        IContact contact = null;
       
        try {
            if (log.isTraceEnabled())
                log.trace("creating contact");
            try {      
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

        return annuityHolder;
    }

    private void verifyContactValues(OpenJPAEntityManagerFactorySPI myEMF, IContact contact) throws Exception {
        // read the contact with id.
        IContact results = null;
        results = findContactById(myEMF, Contact.class, contact.getId());
        assertEqual(contact, results,
            "Contact from Client is not equal to DB value.", "Mismacth was found.");    
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.proxy.entities.IContact

            "Contact from Client is not equal to DB value.", "Mismacth was found.");    
    }

    private IContact findContactById(OpenJPAEntityManagerFactorySPI myEMF, Class<Contact> class1, String id) {
        EntityManager em = createEM(myEMF);
        IContact ic = em.find(class1, id);
        closeEM(em);
        return ic;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.