Package org.spw.model

Examples of org.spw.model.Contact


    public CommunicationDataProviderTest(String testName) {
        super(testName);
    }
   
    protected void setUp() throws Exception {
        Contact contact = new Contact();
        contact.setIdContact(TEST_ID_CONTACT);
        contact.setFirstName(getName());
        contactCtrl.create(contact);
        //Action completed with a participant
        Communication com1 = new Communication();
        com1.setIdCommunication(TEST_ID_COMPLETED_WITH_CONTACT);
        com1.setActionToBeConducted("Test already done");
        com1.setDateOfCompletion(new Date());
        com1.setTopic(getName());
        List participants = new ArrayList();
        participants.add(contact);
        com1.setParticipants(participants);
        comCtrl.create(com1);
        contact.getParticipate().add(com1);
        contactCtrl.update(contact);
        //No action to complete
        Communication com2 = new Communication();
        com2.setIdCommunication(TEST_ID_NO_ACTION);
        com2.setTopic(getName());
View Full Code Here


    public void testRefreshListSeletedContact() {
        System.out.println("refreshListSeletedContact");
       
        CommunicationDataProvider instance = new CommunicationDataProvider();
       
        Contact contact = contactCtrl.read(TEST_ID_CONTACT);
        instance.setContact(contact);
        instance.refreshListCommunicationsContact();
       
        List<Communication> result = instance.getList();
        assertFalse("The list must not be empty",
                result.isEmpty());
        assertFalse("The list must contain only one item",
                result.size() > 1);
        Communication retrievedCom = result.get(0);
        assertEquals(TEST_ID_COMPLETED_WITH_CONTACT, (long)retrievedCom.getIdCommunication());
        List<Contact> participants = retrievedCom.getParticipants();
        assertFalse("The list of participants must not be empty",
                participants.isEmpty());
        assertFalse("The list of participants must contain only one item",
                participants.size() > 1);
        Contact retrievedContact = participants.get(0);
    }
View Full Code Here

    public ListTest(String testName) {
        super(testName);
    }
   
    protected void setUp() throws Exception {
        Contact contact = new Contact();
        contact.setIdContact(id);
        contact.setFirstName(this.getName());
        contact = contactCtrl.update(contact);
        Donation donation = new Donation();
        donation.setIdDonation(id);
        donation.setProposalTitle(this.getName());
        donation.setDonor(contact);
        donation = donationCtrl.update(donation);
        contact.getDonations().add(donation);
        contactCtrl.update(contact);
    }
View Full Code Here

    protected void tearDown() throws Exception {
        DonationController donationCtrl = new DonationController();
        Donation donation = donationCtrl.read(id);
        donationCtrl.delete(donation);
        ContactController contactCtrl = new ContactController();
        Contact contact = contactCtrl.read(id);
        contactCtrl.delete(contact);
    }
View Full Code Here

        Donation donation = donationCtrl.read(id);
        assertNotNull(donation);
        instance.deleteDonation(donation);
        donation = donationCtrl.read(id);
        assertNull(donation);
        Contact contact = contactCtrl.read(id);
        assertFalse(contact.getDonations().contains(donation));
    }
View Full Code Here

       
        for ( Object obj : prop.values() ) {
          System.out.println( "Property: " + obj.toString() );
        }
        Set<Contact> set = new HashSet<Contact>();
        Contact contact1 = new Volunteer();
        String sMailTo = prop.getProperty( "mail.to");
        contact1.setEmail( sMailTo);
        contact1.setFirstName("Patrice");
        contact1.setIdContact(1L);
        Contact contact2 = new Partnership();
        contact2.setEmail( "Pablo@localhost" );
        contact2.setFirstName("Pablo");
        contact2.setIdContact(2L);
        set.add(contact1);
        set.add(contact2);
        EMailer instance = new EMailer();
        instance.setSendCopy(true);
        instance.setContent(" Dear $firstName");
View Full Code Here

    public void testButtonValidateBottom_action() {
        System.out.println("buttonValidateBottom_action");
       
       
        EditMock instance = new EditMock();
        Contact contact = new Contact();
        contact.setIdContact(id);
        contact.setFirstName(this.getName());
        Donation donation = new Donation();
        donation.setIdDonation(id);
        donation.setProposalTitle(this.getName());
        donation.setDonor(contact);
        java.util.List donations = new ArrayList();
        donations.add(instance.getDonation());
        contact.setDonations(donations);
        instance.setContact(contact);
        instance.setDonation(donation);
        String expResult = "success";
        String result = instance.buttonValidateBottom_action();
        assertEquals(expResult, result);
       
        //check the insertion of the entities
        DonationController donationCtrl = new DonationController();
        donation = donationCtrl.read(id);
        assertEquals(donation.getIdDonation(), id);
        assertEquals(donation.getDonor(), contact);
        assertEquals(donation.getDonor().getIdContact(), id);
        assertEquals(donation.getDonor().getFirstName(), this.getName());
        ContactController contactCtrl = new ContactController();
        contact = contactCtrl.read(id);
        assertTrue(contact.getDonations().contains(donation));
    }
View Full Code Here

        super.tearDown();
        DonationController donationCtrl = new DonationController();
        Donation donation = donationCtrl.read(id);
        donationCtrl.delete(donation);
        ContactController contactCtrl = new ContactController();
        Contact contact = contactCtrl.read(id);
        contactCtrl.delete(contact);
    }
View Full Code Here

        }
    }
   
    public String buttonAdd_action() {
        // check contact
        Contact contactToAdd = null;
        if (contact.getText().length() > 0) {
            contactToAdd = contactCtl.parse((String) contact.getValue());
            if (contactToAdd == null) {
                error("Cannot find this contact.");
                return null;
View Full Code Here

    }
   
    public String buttonDeleteAttended_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Contact contact= (Contact) getSessionBean1().getAttendedDataProvider().getObject(rk);
            removeAttended(contact);
        }
        getSessionBean1().getAttendedDataProvider().refreshList();
       
        return null;
View Full Code Here

TOP

Related Classes of org.spw.model.Contact

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.