/*
* 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());
}
}