CCM NG: Current status, including basic repository class and some more tests
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3476 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
61e6971152
commit
cbe2b198fd
|
|
@ -102,6 +102,11 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>ccm-core</finalName>
|
<finalName>ccm-core</finalName>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.build.directory}/generated-resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
@ -408,7 +413,6 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>de.jpdigital</groupId>
|
<groupId>de.jpdigital</groupId>
|
||||||
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
<version>1.0.0-alpha.1</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<dialects>
|
<dialects>
|
||||||
<param>h2</param>
|
<param>h2</param>
|
||||||
|
|
@ -447,6 +451,9 @@
|
||||||
org.libreccm.tests.categories.UnitTests,
|
org.libreccm.tests.categories.UnitTests,
|
||||||
org.libreccm.tests.categories.IntegrationTest
|
org.libreccm.tests.categories.IntegrationTest
|
||||||
</groups>
|
</groups>
|
||||||
|
<additionalClasspathElements>
|
||||||
|
<additionalClasspathElement>${project.build.directory}/generated-resources</additionalClasspathElement>
|
||||||
|
</additionalClasspathElements>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
@ -494,7 +501,6 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>de.jpdigital</groupId>
|
<groupId>de.jpdigital</groupId>
|
||||||
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
<version>1.0.0-alpha.1</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<dialects>
|
<dialects>
|
||||||
<param>h2</param>
|
<param>h2</param>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public abstract class AbstractEntityRepository<K, E> {
|
||||||
|
|
||||||
public abstract Class<E> getEntityClass();
|
public abstract Class<E> getEntityClass();
|
||||||
|
|
||||||
public E findById(final K entityId) {
|
public E findById(final K entityId) {
|
||||||
return entityManager.find(getEntityClass(), entityId);
|
return entityManager.find(getEntityClass(), entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,4 +67,5 @@ public abstract class AbstractEntityRepository<K, E> {
|
||||||
|
|
||||||
entityManager.remove(entity);
|
entityManager.remove(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.core;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
public class CcmObjectRepository extends AbstractEntityRepository<Long, CcmObject> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<CcmObject> getEntityClass() {
|
||||||
|
return CcmObject.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNew(final CcmObject entity) {
|
||||||
|
return entity.getObjectId() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ public class QueueItem implements Serializable {
|
||||||
@Column(name = "retry_count")
|
@Column(name = "retry_count")
|
||||||
private long retryCount;
|
private long retryCount;
|
||||||
|
|
||||||
@Column(name = "successful;")
|
@Column(name = "successful_sended")
|
||||||
private boolean successful;
|
private boolean successful;
|
||||||
|
|
||||||
@Column(name = "receiver_address", length = 512)
|
@Column(name = "receiver_address", length = 512)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<skin>
|
<skin>
|
||||||
<groupId>org.apache.maven.skins</groupId>
|
<groupId>org.apache.maven.skins</groupId>
|
||||||
<artifactId>maven-fluido-skin</artifactId>
|
<artifactId>maven-fluido-skin</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>1.4</version>
|
||||||
</skin>
|
</skin>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.core;
|
package org.libreccm.core;
|
||||||
|
|
||||||
import org.dbunit.util.fileloader.DataFileLoader;
|
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
import org.jboss.arquillian.container.test.api.Deployment;
|
||||||
|
|
@ -50,6 +48,8 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.ejb.EJBTransactionRolledbackException;
|
import javax.ejb.EJBTransactionRolledbackException;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.PersistenceContext;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
|
@ -66,6 +66,9 @@ public class CcmObjectRepositoryTest {
|
||||||
@Inject
|
@Inject
|
||||||
private transient CcmObjectRepository ccmObjectRepository;
|
private transient CcmObjectRepository ccmObjectRepository;
|
||||||
|
|
||||||
|
@PersistenceContext(name = "LibreCCM")
|
||||||
|
private transient EntityManager entityManager;
|
||||||
|
|
||||||
public CcmObjectRepositoryTest() {
|
public CcmObjectRepositoryTest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,6 +120,66 @@ public class CcmObjectRepositoryTest {
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void repoIsInjected() {
|
||||||
|
assertThat(ccmObjectRepository, is(not((nullValue()))));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void entityManagerIsInjected() {
|
||||||
|
assertThat(entityManager, is(not((nullValue()))));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@InSequence(5)
|
||||||
|
public void entityManagerFindCcmObjectByLongPrimitive() {
|
||||||
|
final CcmObject obj1 = entityManager.find(CcmObject.class, -10L);
|
||||||
|
final CcmObject obj2 = entityManager.find(CcmObject.class, -20L);
|
||||||
|
final CcmObject obj3 = entityManager.find(CcmObject.class, -30L);
|
||||||
|
final CcmObject none = entityManager.find(CcmObject.class, -999L);
|
||||||
|
|
||||||
|
assertThat(obj1, is(not(nullValue())));
|
||||||
|
assertThat(obj1.getObjectId(), is(-10L));
|
||||||
|
assertThat(obj1.getDisplayName(), is(equalTo("Test Object 1")));
|
||||||
|
|
||||||
|
assertThat(obj2, is(not(nullValue())));
|
||||||
|
assertThat(obj2.getObjectId(), is(-20L));
|
||||||
|
assertThat(obj2.getDisplayName(), is(equalTo("Test Object 2")));
|
||||||
|
|
||||||
|
assertThat(obj3, is(not(nullValue())));
|
||||||
|
assertThat(obj3.getObjectId(), is(-30L));
|
||||||
|
assertThat(obj3.getDisplayName(), is(equalTo("Test Object 3")));
|
||||||
|
|
||||||
|
assertThat(none, is(nullValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@UsingDataSet(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
@InSequence(6)
|
||||||
|
public void entityManagerFindCcmObjectByLongClass() {
|
||||||
|
final CcmObject obj1 = entityManager.find(CcmObject.class, new Long(-10L));
|
||||||
|
final CcmObject obj2 = entityManager.find(CcmObject.class, new Long(-20L));
|
||||||
|
final CcmObject obj3 = entityManager.find(CcmObject.class, new Long(-30L));
|
||||||
|
final CcmObject none = entityManager.find(CcmObject.class, new Long(-999L));
|
||||||
|
|
||||||
|
assertThat(obj1, is(not(nullValue())));
|
||||||
|
assertThat(obj1.getObjectId(), is(-10L));
|
||||||
|
assertThat(obj1.getDisplayName(), is(equalTo("Test Object 1")));
|
||||||
|
|
||||||
|
assertThat(obj2, is(not(nullValue())));
|
||||||
|
assertThat(obj2.getObjectId(), is(-20L));
|
||||||
|
assertThat(obj2.getDisplayName(), is(equalTo("Test Object 2")));
|
||||||
|
|
||||||
|
assertThat(obj3, is(not(nullValue())));
|
||||||
|
assertThat(obj3.getObjectId(), is(-30L));
|
||||||
|
assertThat(obj3.getDisplayName(), is(equalTo("Test Object 3")));
|
||||||
|
|
||||||
|
assertThat(none, is(nullValue()));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@UsingDataSet(
|
@UsingDataSet(
|
||||||
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.core;
|
||||||
|
|
||||||
|
import org.dbunit.DatabaseUnitException;
|
||||||
|
import org.dbunit.database.DatabaseConnection;
|
||||||
|
import org.dbunit.database.IDatabaseConnection;
|
||||||
|
import org.dbunit.dataset.IDataSet;
|
||||||
|
import org.dbunit.operation.DatabaseOperation;
|
||||||
|
import org.h2.tools.RunScript;
|
||||||
|
import org.jboss.arquillian.persistence.core.data.descriptor.Format;
|
||||||
|
import org.jboss.arquillian.persistence.dbunit.dataset.DataSetBuilder;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.experimental.categories.Category;
|
||||||
|
import org.libreccm.tests.categories.UnitTest;
|
||||||
|
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@Category(UnitTest.class)
|
||||||
|
public class DatasetsExampleTest {
|
||||||
|
|
||||||
|
public DatasetsExampleTest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUpClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void tearDownClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void verifyBaseDataset() throws ClassNotFoundException,
|
||||||
|
SQLException,
|
||||||
|
DatabaseUnitException,
|
||||||
|
IOException,
|
||||||
|
URISyntaxException {
|
||||||
|
final DataSetBuilder builder = DataSetBuilder.builderFor(Format.JSON);
|
||||||
|
final IDataSet dataSet = builder.build(
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json");
|
||||||
|
final Path schemaPath = Paths.get(getClass().getResource(
|
||||||
|
"/sql/ddl/auto/h2.sql").toURI());
|
||||||
|
|
||||||
|
Class.forName("org.h2.Driver");
|
||||||
|
try (Connection connection = DriverManager.getConnection(
|
||||||
|
"jdbc:h2:mem:testdatabase", "sa", "")) {
|
||||||
|
//Create db schema
|
||||||
|
RunScript.execute(connection, Files.newBufferedReader(schemaPath));
|
||||||
|
connection.commit();
|
||||||
|
|
||||||
|
final IDatabaseConnection dbUnitConn
|
||||||
|
= new DatabaseConnection(connection);
|
||||||
|
DatabaseOperation.CLEAN_INSERT.execute(dbUnitConn, dataSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.core;
|
||||||
|
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.experimental.categories.Category;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.runners.Parameterized;
|
||||||
|
import org.libreccm.tests.categories.UnitTest;
|
||||||
|
import org.libreccm.testutils.DatasetsVerifier;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RunWith(Parameterized.class)
|
||||||
|
@Category(UnitTest.class)
|
||||||
|
public class DatasetsTest extends DatasetsVerifier {
|
||||||
|
|
||||||
|
@Parameterized.Parameters(name = "Dataset {0}")
|
||||||
|
public static Collection<String> data() {
|
||||||
|
return Arrays.asList(new String[]{
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/data.json",
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/after-delete.json",
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/after-save-changed.json",
|
||||||
|
"datasets/org/libreccm/core/CcmObjectRepositoryTest/after-save-new.json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatasetsTest(final String datasetPath) {
|
||||||
|
super(datasetPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUpClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void tearDownClass() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.libreccm.testutils;
|
||||||
|
|
||||||
|
import org.dbunit.DatabaseUnitException;
|
||||||
|
import org.dbunit.database.DatabaseConnection;
|
||||||
|
import org.dbunit.database.IDatabaseConnection;
|
||||||
|
import org.dbunit.dataset.IDataSet;
|
||||||
|
import org.dbunit.operation.DatabaseOperation;
|
||||||
|
import org.h2.tools.RunScript;
|
||||||
|
import org.jboss.arquillian.persistence.core.data.descriptor.Format;
|
||||||
|
import org.jboss.arquillian.persistence.dbunit.dataset.DataSetBuilder;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class DatasetsVerifier {
|
||||||
|
|
||||||
|
private final String datasetPath;
|
||||||
|
|
||||||
|
public DatasetsVerifier(final String datasetsPath) {
|
||||||
|
this.datasetPath = datasetsPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void verifyDataset() throws SQLException,
|
||||||
|
URISyntaxException,
|
||||||
|
IOException,
|
||||||
|
DatabaseUnitException {
|
||||||
|
//Create database connection to an in memory h2 database. Placed in
|
||||||
|
//try-with-resources block to ensure that the connection is closed.
|
||||||
|
try (Connection connection = DriverManager.getConnection(
|
||||||
|
"jdbc:h2:mem:testdatabase", "sa", "")) {
|
||||||
|
//Create DB schema
|
||||||
|
final Path schemaPath = Paths.get(getClass().getResource(
|
||||||
|
"/sql/ddl/auto/h2.sql").toURI());
|
||||||
|
RunScript.execute(connection, Files.newBufferedReader(schemaPath));
|
||||||
|
connection.commit();
|
||||||
|
|
||||||
|
//Get dataset to test
|
||||||
|
final DataSetBuilder builder = DataSetBuilder
|
||||||
|
.builderFor(Format.JSON);
|
||||||
|
final IDataSet dataSet = builder.build(datasetPath);
|
||||||
|
|
||||||
|
//Put dataset into DB
|
||||||
|
final IDatabaseConnection dbUnitConn
|
||||||
|
= new DatabaseConnection(connection);
|
||||||
|
DatabaseOperation.CLEAN_INSERT.execute(dbUnitConn, dataSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
33
pom.xml
33
pom.xml
|
|
@ -125,7 +125,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.3</version>
|
<version>2.5.4</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
@ -198,7 +198,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>de.jpdigital</groupId>
|
<groupId>de.jpdigital</groupId>
|
||||||
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
<version>1.0.0-alpha.1</version>
|
<version>1.0.0-alpha.2</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
|
|
@ -227,7 +227,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-entitymanager</artifactId>
|
<artifactId>hibernate-entitymanager</artifactId>
|
||||||
<version>4.3.8.Final</version>
|
<version>4.3.10.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
@ -237,17 +237,17 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-envers</artifactId>
|
<artifactId>hibernate-envers</artifactId>
|
||||||
<version>4.3.8.Final</version>
|
<version>4.3.10.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Hibernate Validator used as implemenation of the Bean
|
Hibernate Validator used as implemenation of the Bean
|
||||||
Validation API -->
|
Validation API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
<version>5.1.3.Final</version>
|
<version>5.1.3.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
*********************
|
*********************
|
||||||
|
|
@ -266,7 +266,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-bom</artifactId>
|
<artifactId>log4j-bom</artifactId>
|
||||||
<version>2.2</version>
|
<version>2.3</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -403,7 +403,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.arquillian</groupId>
|
<groupId>org.jboss.arquillian</groupId>
|
||||||
<artifactId>arquillian-bom</artifactId>
|
<artifactId>arquillian-bom</artifactId>
|
||||||
<version>1.1.7.Final</version>
|
<version>1.1.8.Final</version>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -448,6 +448,13 @@
|
||||||
<version>1.7.2</version>
|
<version>1.7.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- h2 database in used to check some database related things -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<version>1.4.187</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<skin>
|
<skin>
|
||||||
<groupId>org.apache.maven.skins</groupId>
|
<groupId>org.apache.maven.skins</groupId>
|
||||||
<artifactId>maven-fluido-skin</artifactId>
|
<artifactId>maven-fluido-skin</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>1.4</version>
|
||||||
</skin>
|
</skin>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue