Package org.spw.model

Examples of org.spw.model.VolunteerApplication


     * Test of update method, of class org.spw.controller.VolunteerApplicationController.
     */
    public void testUpdate() {
        System.out.println("update");
       
        VolunteerApplication va = new VolunteerApplication();
        VolunteerApplicationController instance = new VolunteerApplicationController();
       
        va = instance.read(TEST_ID);
        Contribution contribution = new Contribution();
        contribution.setReference(getName());
        va.addContribution(contribution);
       
        instance.update(va);
       
        va = instance.read(TEST_ID);
        assertEquals(getName(), va.getContributions().get(0).getReference());
    }
View Full Code Here


     */
    public void testDelete() {
        System.out.println("delete");
       
        VolunteerApplicationController instance = new VolunteerApplicationController();
        VolunteerApplication va = instance.read(TEST_ID);
       
        Contribution contribution = new Contribution();
        contribution.setReference(getName());
        va.addContribution(contribution);
        va = instance.update(va);
        contribution = va.getContributions().get(0);
       
        instance.delete(va);
       
        assertNull(instance.read(TEST_ID));
        assertNull(checkContribution(contribution.getIdContribution()));
View Full Code Here

     */
    public void testAddContribution() {
        System.out.println("addContribution");
       
        VolunteerApplicationController instance = new VolunteerApplicationController();
        VolunteerApplication object = instance.read(TEST_ID);
        Contribution contribution = new Contribution();
        contribution.setReference(getName());
       
        VolunteerApplication result = instance.addContribution(object, contribution);
        assertEquals(1, result.getContributions().size());
        Long id = result.getContributions().get(0).getIdContribution();
       
        //refresh
        object = instance.read(TEST_ID);
        assertEquals(1, object.getContributions().size());
       
View Full Code Here

     */
    public void testRemoveContribution() {
        System.out.println("removeContribution");
       
        VolunteerApplicationController instance = new VolunteerApplicationController();
        VolunteerApplication object = instance.read(TEST_ID);
        Contribution contribution = new Contribution();
        contribution.setReference(getName());
       
        VolunteerApplication result = instance.addContribution(object, contribution);
        assertEquals(1, result.getContributions().size());
        Long id = result.getContributions().get(0).getIdContribution();
       
        //delete
        instance.delete(result);
       
        contribution = checkContribution(id);
View Full Code Here

        prg.setStartDate(cal.getTime());
        prg.setNumberVolunteer(12);
        prg.setProgramAcronym("TEST");
        prg = prgCtrl.update(prg);
       
        VolunteerApplication va = new VolunteerApplication();
        va.setIdApplication(TEST_ID);
        va.setAcceptanceFeeReceived(new Date());
        va.setAcceptanceLettersSent(new Date());
        va.setVolunteer(vo);
        va.setProgram(prg);
        va = vaCtrl.update(va);
       
        vCtrl.addApplication(vo, va, prg);
    }
View Full Code Here

   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            VolunteerApplicationController ctrl = new VolunteerApplicationController();
            VolunteerApplication application = dataProvider.getApplication();
            Contribution contribution = (Contribution)dataProvider.getObject(rk);
            application.removeContribution(contribution);
           
            ctrl.removeContribution(application, contribution);
            dataProvider.refreshList();
        }
       
View Full Code Here

        prg.setStartDate(cal.getTime());
        prg.setNumberVolunteer(12);
        prg.setProgramAcronym("TEST");
        prg = prgCtrl.update(prg);
       
        VolunteerApplication va = new VolunteerApplication();
        va.setIdApplication(TEST_ID);
        va.setAcceptanceFeeReceived(new Date());
        va.setAcceptanceLettersSent(new Date());
        va.setVolunteer(vo);
        va.setProgram(prg);
        va = vaCtrl.update(va);
       
        vCtrl.addApplication(vo, va, prg);
    }
View Full Code Here

        volunteer.setFirstName(getName());
        volunteer.setLastName(getName());
        volunteer.setTypeVolunteer("Accepted");
        volunteer.setYearApplyingFor(1900);
       
        VolunteerApplication application = new VolunteerApplication();
        application.setIdApplication(TEST_ID);
        application.setProgram(programCtrl.getPrograms().get(0));
        application.setAcceptanceFeeReceived(new Date());
        volunteer.setApplication(application);
       
        for (int i=1; i < 5; i++) {
            Contribution contrib = new Contribution();
            contrib.setApplication(application);
            contrib.setContributionAmount(new BigDecimal(i));
            contrib.setContributionValue(new BigDecimal(i*8));
            contrib.setCurrency("TST");
            contrib.setDateContribution(new Date());
            if ((i%3) == 0)
                contrib.setGiftAidable(true);
            contrib.setIdContribution(new Long(i));
            if (i == 1)
                contrib.setInitialFee(true);
            if (i < 3 )
                contrib.setMeansOfPayment("Cheque");
            else
                contrib.setMeansOfPayment("JustGiving");
            contrib.setPayer(getName());
            contrib.setReference(Integer.toString(i));
            application.addContribution(contrib);
        }
       
        VolunteerDetailsFundraisingXmlReport instance =
                new VolunteerDetailsFundraisingXmlReport(volunteer);
       
View Full Code Here

        prg.setStartDate(cal.getTime());
        prg.setNumberVolunteer(12);
        prg.setProgramAcronym("TEST");
        prg = prgCtrl.update(prg);

        VolunteerApplication va = new VolunteerApplication();
        va.setIdApplication(TEST_ID);
        va.setAcceptanceFeeReceived(new Date());
        va.setAcceptanceLettersSent(new Date());
        va.setVolunteer(vo);
        va.setProgram(prg);
        va = vaCtrl.update(va);
       
        vCtrl.addApplication(vo, va, prg);
    }
View Full Code Here

TOP

Related Classes of org.spw.model.VolunteerApplication

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.