Package org.spw.model

Examples of org.spw.model.Person


    public PersonControllerTest(String testName) {
        super(testName);
    }
   
    protected void setUp() throws Exception {
        Person person = new Person();
        person.setIdContact(TEST_ID);
        person.setFirstName("Test1");
        person.setLastName("Office Staff");
        person.setOfficeStaff(true);
        person.setNote(getName());
        personCtl.create(person);
       
        person = new Person();
        person.setIdContact(TEST_ID+1);
        person.setFirstName("Test office Test");
        person.setLastName("Lambda");
        person.setOfficeStaff(false);
        person.setOffice("Test");
        person.setNote(getName());
        personCtl.create(person);
       
        // Create a person with now last name
        person = new Person();
        person.setIdContact(TEST_ID+2);
        person.setFirstName("Test no last name");
        // person.setLastName("Lambda");
        person.setOfficeStaff(false);
        person.setOffice("Test");
        person.setNote(getName());
        personCtl.create(person);
       
        Person p1 = new Person();
        p1.setIdContact(TEST_ID_ABC1);
        p1.setFirstName(TEST_FIRSTNAME_ABC1);
        p1.setLastName(getName());
        personCtl.create(p1);
        for(long id = TEST_ID_ABC1+1; id < TEST_ID_ABC1 + 8; id++) {
            Person p = new Person();
            p.setIdContact(id);
            p.setFirstName(TEST_FIRSTNAME_ABC1 + id);
            p.setLastName(getName());
            personCtl.create(p);
        }
        Person p2 = new Person();
        p2.setIdContact(TEST_ID_BBC);
        p2.setFirstName(TEST_FIRSTNAME_BBC);
        p2.setLastName(getName());
        personCtl.create(p2);
       
    }
View Full Code Here


        personCtl.create(p2);
       
    }
   
    protected void tearDown() throws Exception {
        Person person = personCtl.read(TEST_ID);
        if (person != null) personCtl.delete(person);
        person = personCtl.read(TEST_ID+1);
        if (person != null) personCtl.delete(person);
        person = personCtl.read(TEST_ID+2);
        if (person != null) personCtl.delete(person);
View Full Code Here

    }

    public String buttonInfo_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Person person = (Person)getSessionBean1().
                    getContactDataProvider().getObject(rk);
            getSessionBean1().setPerson(person);
        }
       
        return "infoPerson";
View Full Code Here

    public ContactControllerTest(String testName) {
        super(testName);
    }
   
    protected void setUp() throws Exception {
        Person p1 = new Person();
        p1.setIdContact(TEST_ID_ABC1);
        p1.setFirstName(TEST_FIRSTNAME_ABC1);
        p1.setLastName(getName());
        ctrl.create(p1);
        for(long id = TEST_ID_ABC1+1; id < TEST_ID_ABC1 + 8; id++) {
            Person p = new Person();
            p.setIdContact(id);
            p.setFirstName(TEST_FIRSTNAME_ABC1 + id);
            p.setLastName(getName());
            ctrl.create(p);
        }
        Person p2 = new Person();
        p2.setIdContact(TEST_ID_BBC);
        p2.setFirstName(TEST_FIRSTNAME_BBC);
        p2.setLastName(getName());
        ctrl.create(p2);
    }
View Full Code Here

    /**
     * Test of create method, of class org.spw.controller.ContactController.
     */
    public void testCreate() {
        // check create a double thows an exception
        Person p1 = new Person();
        p1.setIdContact(TEST_ID_ABC1);
        p1.setFirstName(TEST_FIRSTNAME_ABC1);
        p1.setLastName(getName());
        try {
            ctrl.create(p1);
            fail("create a double should send an error");
        } catch (EntityExistsException eee) {
            //OK
View Full Code Here

    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1)getBean("ApplicationBean1");
    }
   
    public String hyperlinkCreateVolunteer_action() {
        Person person = getSessionBean1().getPerson();
        // if Person, create an instance of Volunteer
        if (person instanceof Volunteer) {
            return null;
        } else {
            getSessionBean1().setVolunteer(new Volunteer((Person) person));
View Full Code Here

       
        return "editVolunteer";
    }
   
    public String hyperlinkCreateApplication_action() {
        Person person = getSessionBean1().getPerson();
        if (! (person instanceof Volunteer)) {
            return null;
        } else {
            getSessionBean1().setVolunteer((Volunteer) person);
        }
View Full Code Here

       
        return "application";
    }
   
    public String hyperlinkEditVolunteer_action() {
        Person person = getSessionBean1().getPerson();
        if (! (person instanceof Volunteer)) {
            return null;
        } else {
            getSessionBean1().setVolunteer((Volunteer) person);
        }
View Full Code Here

       
        return "editDocument";
    }
   
    public String hyperlinkEditApplication_action() {
        Person person = getSessionBean1().getPerson();
        if (! (person instanceof Volunteer)) {
            return null;
        } else {
            getSessionBean1().setVolunteer((Volunteer) person);
        }
View Full Code Here

       
        return "donationList";
    }
   
    public String hyperlinkContributions_action() {
        Person person = getSessionBean1().getPerson();
        if (! (person instanceof Volunteer)) {
            return null;
        }
        VolunteerApplication application = getSessionBean1().getVolunteer().getApplication();
        if (application == null) {
View Full Code Here

TOP

Related Classes of org.spw.model.Person

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.