Package com.jverstry.DAO

Source Code of com.jverstry.DAO.MyPersistenceDAOTest

package com.jverstry.DAO;

import com.jverstry.Configuration.JpaTestConfig;
import com.jverstry.Configuration.TestConfig;
import com.jverstry.Item.MilliTimeItem;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={ JpaTestConfig.class, TestConfig.class })
public class MyPersistenceDAOTest {
 
  @Autowired
    private MyPersistenceDAO myDAO;
 
  @Test
  public void testCreateMilliTimeItem() {
   
    // This operation should not throw an Exception
    long id = myDAO.createMilliTimeItem();
   
  }

  @Test
  public void testGetMilliTimeItem() {
   
    long id = myDAO.createMilliTimeItem();
    MilliTimeItem retr = myDAO.getMilliTimeItem(id);
   
    assertNotNull(retr);
    assertEquals(id,retr.getID());
   
  }

}
TOP

Related Classes of com.jverstry.DAO.MyPersistenceDAOTest

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.