Skip to content

Commit

Permalink
Revert "Revert "[BAQE-439] Introducing Narayana and tomcat-dbcp into …
Browse files Browse the repository at this point in the history
…engine tests (#1360)" (#1364)" (#1365)

This reverts commit 64218d0.
  • Loading branch information
rsynek authored and mareknovotny committed Nov 2, 2018
1 parent be1ef82 commit 9aae5f4
Show file tree
Hide file tree
Showing 103 changed files with 365 additions and 682 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
<property name="hibernate.connection.release_mode" value="after_transaction"/>
</properties>
</persistence-unit>

Expand All @@ -49,6 +50,7 @@
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
<property name="hibernate.connection.release_mode" value="after_transaction"/>
</properties>
</persistence-unit>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.dialect" value="${maven.hibernate.dialect}"/>

<property name="hibernate.connection.driver_class" value="${maven.jdbc.driver.class}"/>
<property name="hibernate.connection.url" value="${maven.jdbc.url}"/>
<property name="hibernate.connection.username" value="${maven.jdbc.username}"/>
<property name="hibernate.connection.password" value="${maven.jdbc.password}"/>
<property name="hibernate.default_schema" value="${maven.jdbc.schema}"/>

<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform"/>
<property name="hibernate.connection.release_mode" value="after_transaction"/>
</properties>
</persistence-unit>
</persistence>
19 changes: 5 additions & 14 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import org.jbpm.process.instance.impl.DefaultProcessInstanceManagerFactory;
import org.jbpm.ruleflow.core.RuleFlowProcess;
import org.jbpm.test.util.AbstractBaseTest;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl;
import org.junit.After;
import org.junit.AfterClass;
Expand Down Expand Up @@ -138,7 +138,7 @@ public abstract class JbpmBpmn2TestCase extends AbstractBaseTest {
protected AuditLogService logService;

protected static EntityManagerFactory emf;
private static PoolingDataSource ds;
private static PoolingDataSourceWrapper ds;

private RequireLocking testReqLocking;
private RequirePersistence testReqPersistence;
Expand Down Expand Up @@ -185,18 +185,9 @@ public JbpmBpmn2TestCase(boolean sessionPersistance, boolean locking) {
this.pessimisticLocking = locking;
}

public static PoolingDataSource setupPoolingDataSource() {
public static PoolingDataSourceWrapper setupPoolingDataSource() {
Properties dsProps = PersistenceUtil.getDatasourceProperties();
String jdbcUrl = dsProps.getProperty("url");
String driverClass = dsProps.getProperty("driverClassName");

// Setup the datasource
PoolingDataSource ds1 = PersistenceUtil.setupPoolingDataSource(dsProps, "jdbc/testDS1", false);
if( driverClass.startsWith("org.h2") ) {
ds1.getDriverProperties().setProperty("url", jdbcUrl);
}
ds1.init();
return ds1;
return PersistenceUtil.setupPoolingDataSource(dsProps, "jdbc/testDS1");
}

public void setPersistence(boolean sessionPersistence) {
Expand All @@ -211,7 +202,7 @@ public void setEntityManagerFactory(EntityManagerFactory emf) {
JbpmBpmn2TestCase.emf = emf;
}

public void setPoolingDataSource(PoolingDataSource ds) {
public void setPoolingDataSource(PoolingDataSourceWrapper ds) {
JbpmBpmn2TestCase.ds = ds;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.jbpm.runtime.manager.impl.jpa.EntityManagerFactoryManager;
import org.jbpm.services.api.model.DeploymentUnit;
import org.jbpm.test.services.AbstractCaseServicesTest;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.kie.api.task.model.Status;
import org.kie.api.task.model.TaskSummary;

Expand All @@ -41,7 +41,7 @@ public abstract class AbstractCaseServicesBaseTest extends AbstractCaseServicesT
protected static final String GROUP_ID = "org.jbpm.cases";
protected static final String VERSION = "1.0.0";

protected PoolingDataSource ds;
protected PoolingDataSourceWrapper ds;

protected static final String EMPTY_CASE_P_ID = "EmptyCase";
protected static final String USER_TASK_STAGE_CASE_P_ID = "UserTaskWithStageCase";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@

<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.connection.release_mode" value="after_transaction"/>
</properties>
</persistence-unit>

Expand Down
12 changes: 8 additions & 4 deletions jbpm-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test-util</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test-util</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-test-util</artifactId>
</dependency>
<dependency>
<groupId>org.subethamail</groupId>
<artifactId>subethasmtp-wiser</artifactId>
Expand Down
1 change: 1 addition & 0 deletions jbpm-examples/src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<property name="hibernate.id.new_generator_mappings" value="false" />

<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
<property name="hibernate.connection.release_mode" value="after_transaction"/>
</properties>
</persistence-unit>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import javax.persistence.EntityManagerFactory;

import org.jbpm.services.task.utils.TaskFluent;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.kie.api.task.model.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractTotalCompletionTimeTest extends AbstractAssignmentTest {

protected PoolingDataSource pds;
protected PoolingDataSourceWrapper pds;
protected EntityManagerFactory emf;
protected Long taskIds[];
protected static final String DARTH_VADER = "Darth Vader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import org.jbpm.services.task.HumanTaskServiceFactory;
import org.jbpm.services.task.audit.JPATaskLifeCycleEventListener;
import org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;
import org.jbpm.services.task.audit.TaskAuditServiceFactory;

public class LocalTaskAuditTest extends TaskAuditBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.jbpm.services.task.impl.factories.TaskFactory;
import org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener;
import org.jbpm.test.listener.task.CountDownTaskEventListener;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -53,7 +53,7 @@

public class LocalTaskAuditWithDeadlineTest extends HumanTaskServicesBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

protected TaskAuditService taskAuditService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.jbpm.services.task.HumanTaskServicesBaseTest;
import org.jbpm.services.task.audit.TaskAuditServiceFactory;
import org.jbpm.services.task.utils.TaskFluent;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand All @@ -44,7 +44,7 @@

public class LocalWithCustomCallbackTaskAuditTest extends HumanTaskServicesBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;
private NullGroupsUserGroupCallback callback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.jbpm.query.QueryBuilderCoverageTestUtil.ModuleSpecificInputFiller;
import org.jbpm.services.task.HumanTaskServicesBaseTest;
import org.jbpm.services.task.audit.BAMTaskSummaryQueryBuilder;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
Expand All @@ -46,7 +46,7 @@ public class TaskAuditQueryBuilderCoverageTest extends HumanTaskServicesBaseTest

private static final Logger logger = LoggerFactory.getLogger(TaskAuditQueryBuilderCoverageTest.class);

private static PoolingDataSource pds;
private static PoolingDataSourceWrapper pds;
private static EntityManagerFactory emf;

private TaskJPAAuditService auditService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@

<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />

<property name="hibernate.connection.release_mode" value="after_transaction"/>
</properties>
</persistence-unit>

Expand Down
5 changes: 5 additions & 0 deletions jbpm-human-task/jbpm-human-task-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
</dependency>

<!-- TEST -->
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-test-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test-util</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,13 @@
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
<!--
<property name="hibernate.connection.driver_class" value="${maven.jdbc.driver.class}" />
<property name="hibernate.connection.url" value="${maven.jdbc.url}" />
<property name="hibernate.connection.username" value="${maven.jdbc.username}" />
<property name="hibernate.connection.password" value="${maven.jdbc.password}" />
-->

<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false" />

<!-- needed for JTA testing -->
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
<property name="hibernate.connection.release_mode" value="after_transaction"/>

</properties>
</persistence-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.jbpm.services.task.deadlines.notifications.impl.MockNotificationListener;
import org.jbpm.services.task.impl.TaskDeadlinesServiceImpl;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;
Expand All @@ -32,7 +32,7 @@

public class DeadlinesLocalTest extends DeadlinesBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
import javax.persistence.Persistence;

import org.jbpm.services.task.impl.TaskDeadlinesServiceImpl;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;


public class EmailDeadlinesLocalTest extends EmailDeadlinesBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.jbpm.test.listener.task.CountDownTaskEventListener;
import org.jbpm.services.task.utils.ContentMarshallerHelper;
import org.jbpm.services.task.utils.MVELUtils;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -185,10 +185,9 @@ protected JaxbContent xmlRoundTripContent(Content content) {
protected static final String PASSWORD = "password";
protected static final String JDBC_URL = "url";

protected static PoolingDataSource setupPoolingDataSource() {
Properties dsProps = getDatasourceProperties();
PoolingDataSource pds = PersistenceUtil.setupPoolingDataSource(dsProps, "jdbc/jbpm-ds", false);
pds.init();
protected static PoolingDataSourceWrapper setupPoolingDataSource() {
Properties dsProps = PersistenceUtil.getDatasourceProperties();
PoolingDataSourceWrapper pds = PersistenceUtil.setupPoolingDataSource(dsProps, "jdbc/jbpm-ds");

return pds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;
Expand All @@ -28,7 +28,7 @@

public class LifeCycleLocalCommandBasedTest extends LifeCycleBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.jbpm.services.task.rule.TaskRuleService;
import org.jbpm.services.task.rule.impl.RuleContextProviderImpl;
import org.jbpm.services.task.utils.ContentMarshallerHelper;
import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
Expand All @@ -57,7 +57,7 @@

public class LifeCycleLocalWithRuleServiceTest extends HumanTaskServicesBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;


public class SubTasksLocalTest extends SubTasksBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.jbpm.test.util.PoolingDataSource;
import org.kie.test.util.db.PoolingDataSourceWrapper;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;


public class TaskAttachmentLocalTest extends TaskAttachmentBaseTest {

private PoolingDataSource pds;
private PoolingDataSourceWrapper pds;
private EntityManagerFactory emf;

@Before
Expand Down
Loading

0 comments on commit 9aae5f4

Please sign in to comment.