Package org.spw.model

Examples of org.spw.model.Contact


        boolean found1 = false;
        boolean found2 = false;
        System.out.println("addDonation");
       
        ContactController instance = new ContactController();
        Contact contact = instance.read(TEST_ID_ABC1);
        Donation donation1 = new Donation();
        donation1.setDueDate(new Date());
        donation1.setProposalTitle(getName());
        donation1.setReasonNotFunded(getName());
        donation1.setStatus("Test1");
View Full Code Here


        System.out.println("removeDonation");
       
        ContactController instance = new ContactController();
        DonationController donationCtrl = new DonationController();

        Contact contact = instance.read(TEST_ID_ABC1);
        Donation donation1 = new Donation();
        donation1.setDueDate(new Date());
        donation1.setProposalTitle(getName());
        donation1.setReasonNotFunded(getName());
        donation1.setStatus("Test1");
        donation1.setAmount(new BigDecimal(1.11));
       
        Donation donation2 = new Donation();
        donation2.setDueDate(new Date());
        donation2.setProposalTitle(getName());
        donation2.setReasonNotFunded(getName());
        donation2.setStatus("Test2");
        donation2.setAmount(new BigDecimal(2.22));
       
        donation1.setDonor(contact);
        donation2.setDonor(contact);
        donation1 = instance.addDonation(donation1);
        donation2 = instance.addDonation(donation2);
        contact = instance.removeDonation(donation1);
        contact = instance.removeDonation(donation2);
        for(Donation aDonation : contact.getDonations()) {
            if (aDonation.getProposalTitle().equals(getName())
            && aDonation.getReasonNotFunded().equals(getName())
            && aDonation.getStatus().equals("Test1")
            && aDonation.getAmount().equals(new BigDecimal(1.11))) {
                found1 = true;
View Full Code Here

       
        boolean found1 = false;
        boolean found2 = false;
       
        ContactController instance = new ContactController();
        Contact contact = instance.read(TEST_ID_ABC1);
        Document doc1 = new Document();
        doc1.setContact(contact);
        doc1.setDocumentType("Test1");
        doc1.setTitle(getName());
       
View Full Code Here

        boolean found1 = false;
        boolean found2 = false;
       
        ContactController instance = new ContactController();
        DocumentController docCtrl = new DocumentController();
        Contact contact = instance.read(TEST_ID_ABC1);
        Document doc1 = new Document();
        doc1.setContact(contact);
        doc1.setDocumentType("Test1");
        doc1.setTitle(getName());
       
        Document doc2 = new Document();
        doc2.setContact(contact);
        doc2.setDocumentType("Test2");
        doc2.setTitle(getName());
       
        doc1 = instance.addDocument(doc1);
        doc2 = instance.addDocument(doc2);
        assertEquals(contact, doc1.getContact());
        assertEquals(contact, doc2.getContact());

        contact = instance.removeDocument(doc1);
        contact = instance.removeDocument(doc2);
        for(Document aDoc : contact.getDocumentLinks()) {
            if (aDoc.getTitle().equals(getName())
            && aDoc.getDocumentType().equals("Test1")) {
                found1 = true;
                break;
            }
View Full Code Here

    public void testButtonValidateBottom_action() {
        System.out.println("buttonValidateBottom_action");
       
       
        EditMock instance = new EditMock();
        Contact contact = new Contact();
        contact.setFirstName(this.getName());
        Donation donation = new Donation();
        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 resultDonation = donationCtrl.read(donation.getIdDonation());
        assertEquals(donation, resultDonation);
        assertEquals(contact, resultDonation.getDonor());
        assertEquals(this.getName(), resultDonation.getDonor().getFirstName());
        ContactController contactCtrl = new ContactController();
        Contact resultContact = contactCtrl.read(contact.getIdContact());
        assertTrue(resultContact.getDonations().contains(donation));
        assertEquals(1, resultContact.getDonations().size());
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        comCtrl = new CommunicationController();
        contactCtrl = new ContactController();
        testContact = new Contact();
        testContact.setFirstName(getName());
        contactCtrl.create(testContact);
        //Action completed with a participant
        completedWithContact = new Communication();
        completedWithContact.setActionToBeConducted("Test already done");
View Full Code Here

    public void testRefreshListSeletedContact() {
        System.out.println("refreshListSeletedContact");
       
        CommunicationDataProvider instance = new CommunicationDataProvider();
       
        Contact contact = contactCtrl.read(testContact.getIdContact());
        instance.setContact(contact);
        instance.refreshListCommunicationsContact();
       
        List<Communication> result = instance.getList();
        assertFalse("The list must not be empty",
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 String buttonEmail_action() {
        int added = 0;
        int selectedRows = getTableRowGroup1().getSelectedRowsCount();
        RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys();
        for(RowKey rk : selectedRowKeys){
            Contact contact = (Contact)list.getObject(rk);
            if (getSessionBean1().getEmailChoices().add(contact)) added++;
        }
        info (added + " added to the email selection.");
       
        return null;
View Full Code Here

    public String buttonMail_action() {
        int added = 0;
        int selectedRows = getTableRowGroup1().getSelectedRowsCount();
        RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys();
        for(RowKey rk : selectedRowKeys){
            Contact contact = (Contact)list.getObject(rk);
            if (getSessionBean1().getMailChoices().add(contact)) added++;
        }
        info (added + " added to the mail selection.");
       
        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.