Package com.suarte.core

Examples of com.suarte.core.Contact


    public String edit() {
        if (id != null) {
            contact = contactManager.get(id);
            company = contact.getCompany();
        } else {
            contact = new Contact();
        }

        return "edit";
    }
View Full Code Here


        return "edit";
    }

    public String add() {
        contact = new Contact();

        return "add";
    }
View Full Code Here

    private ContactDao contactDao;

    @Test
    @ExpectedException(DataAccessException.class)
    public void testAddAndRemovePerson() throws Exception {
        Contact contact = new Contact();
        contact.setFirstName("Giovanella");
        contact.setLastName("Gutierrez");

        contact = contactDao.save(contact);
        flush();

        contact = contactDao.get(contact.getId());

//        assertEquals("Giovanella", contact.getNombres());
//        assertNotNull(contact.getId());

        log.debug("removing person...");

        contactDao.remove(contact.getId());
        flush();

        // should throw DataAccessException
        contactDao.get(contact.getId());
    }
View Full Code Here

    @Test
    public void testGetPerson() {
        log.debug("testing get...");

        final Long id = 7L;
        final Contact contact = new Contact();

        // set expected behavior on dao
        context.checking(new Expectations() {{
            one(dao).get(with(equal(id)));
            will(returnValue(contact));
        }});

        Contact result = manager.get(id);
        assertSame(contact, result);
    }
View Full Code Here

    @Test
    public void testSavePerson() {
        log.debug("testing save...");

        final Contact person = new Contact();
        // enter all required fields

        // set expected behavior on dao
        context.checking(new Expectations() {{
            one(dao).save(with(same(person)));
View Full Code Here

        super.onSetUp();
        bean = new ContactList();
        bean.setContactManager(contactManager);

        // add a test person to the database
        Contact contact = new Contact();
        contact.setFirstName("Abbie Loo");
        contact.setLastName("Raible");
        contactManager.save(contact);
    }
View Full Code Here

TOP

Related Classes of com.suarte.core.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.