Package org.easycassandra.bean

Source Code of org.easycassandra.bean.ProfessionalDAOTest

package org.easycassandra.bean;

import junit.framework.Assert;

import org.easycassandra.bean.dao.PersistenceDao;
import org.easycassandra.bean.model.Professional;
import org.junit.Test;
/**
* ProfessionalDAOTest.
* @author otaviojava
*/
public class ProfessionalDAOTest {

    private static final double SALARY = 123D;
    private PersistenceDao<Professional, String> persistence =
            new PersistenceDao<Professional, String>(
            Professional.class);
    /**
     * run the test.
     */
    @Test
    public void insertTest() {
        Professional professional = getProfessional();
        Assert.assertTrue(persistence.insert(professional));
    }

    private Professional getProfessional() {
        Professional professional = new Professional();
        professional.setName("Programmer");
        professional.setSalary(SALARY);
        return professional;
    }
    /**
     * run the test.
     */
    @Test
    public void retrieveTest() {
        Professional professional = persistence.retrieve(getProfessional()
                .getName());
        Assert.assertNotNull(professional);
        Assert.assertNull(professional.getSalaryYear());

    }

}
TOP

Related Classes of org.easycassandra.bean.ProfessionalDAOTest

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.