Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jpa.tests;
- import static org.junit.Assert.*;
- import org.dbunit.JdbcBasedDBTestCase;
- import org.dbunit.dataset.DataSetException;
- import org.dbunit.dataset.IDataSet;
- import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
- import org.junit.Before;
- import org.junit.Test;
- public class CustomerJpaControllerTest extends JdbcBasedDBTestCase {
- @Before
- public void setUp() throws Exception {
- }
- @Test
- public void testExample() {
- try {
- assertEquals(5, getDataSet().getTable("customer").getRowCount());
- } catch (DataSetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- @Test
- public void testGetEntityManager() {
- fail("Not yet implemented");
- }
- @Test
- public void testCreate() {
- fail("Not yet implemented");
- }
- @Test
- public void testEdit() {
- fail("Not yet implemented");
- }
- @Test
- public void testDestroy() {
- fail("Not yet implemented");
- }
- @Test
- public void testFindCustomerEntities() {
- fail("Not yet implemented");
- }
- @Test
- public void testFindCustomerEntitiesIntInt() {
- fail("Not yet implemented");
- }
- @Test
- public void testFindCustomer() {
- fail("Not yet implemented");
- }
- @Test
- public void testGetCustomerCount() {
- fail("Not yet implemented");
- }
- @Override
- protected String getConnectionUrl() {
- return "jdbc:mysql://localhost:3306/sqs";
- }
- @Override
- protected String getPassword() {
- return "";
- }
- @Override
- protected String getUsername() {
- return "root";
- }
- @Override
- protected String getDriverClass() {
- return "com.mysql.jdbc.Driver";
- }
- @Override
- protected IDataSet getDataSet() throws Exception {
- return new FlatXmlDataSetBuilder().build(this.getClass().getClassLoader().getResourceAsStream("META-INF/dataset.xml"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement