Package com.suarte.webapp.action

Source Code of com.suarte.webapp.action.ContactListTest

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.suarte.webapp.action;

import com.suarte.core.Contact;
import com.suarte.core.service.ContactManager;

/**
* @date   Dec 20, 2010
* @author Ggutierrez
*/
public class ContactListTest extends BasePageTestCase {

    private ContactList bean;
    private ContactManager contactManager;

    public void setContactManager(ContactManager contactManager) {
        this.contactManager = contactManager;
    }

    @Override
    @SuppressWarnings("unchecked")
    protected void onSetUp() throws Exception {
        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);
    }

    @Override
    protected void onTearDown() throws Exception {
        super.onTearDown();
        bean = null;
    }

    public void testSearch() throws Exception {
        assertTrue(bean.getContacts().size() >= 1);
        assertFalse(bean.hasErrors());
    }
}
TOP

Related Classes of com.suarte.webapp.action.ContactListTest

TOP
Copyright © 2018 www.massapi.com. 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.