Package org.spw.model

Examples of org.spw.model.Donation


    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


        contactCtrl.update(contact);
    }
   
    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

     */
    public void testDeleteDonation() {
        System.out.println("deleteDonation");
       
        List instance = new List();
        Donation donation = donationCtrl.read(id);
        assertNotNull(donation);
        instance.deleteDonation(donation);
        donation = donationCtrl.read(id);
        assertNull(donation);
        Contact contact = contactCtrl.read(id);
View Full Code Here

       
        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

    }

    protected void tearDown() throws Exception {
        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 buttonRefresh_action() {
        return null;
    }
   
    public String buttonAdd_action() {
        getSessionBean1().setDonation(new Donation());
       
        return "new";
    }
View Full Code Here

    }
   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Donation donation = (Donation)list.getObject(rk);
            deleteDonation(donation);
        }
        list.refreshList();
       
        return null;
View Full Code Here

    }
   
    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Donation donation = (Donation)list.getObject(rk);
            getSessionBean1().setDonation(donation);
        }
       
        return "edit";
    }
View Full Code Here

     * Creates a new instance of DonationDataProvider
     */
    public DonationDataProvider() {
        aList = new ArrayList<Donation>();
        // Put in dummy data for design time
        aList.add(new Donation());
       
        // Wrap the list
        setList(aList);
    }
View Full Code Here

       
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        if (getSessionBean1().getDonation() == null) {
            getSessionBean1().setDonation(new Donation());
        }
    }
View Full Code Here

TOP

Related Classes of org.spw.model.Donation

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.