Skip to content

Commit 637ae48

Browse files
fax4everDavideD
authored andcommitted
OCP-DEMO Remove Hibernate Unit test
We can rely on IT Arquillian test. We can remove also repository scoped test, because we have similar ones on services.
1 parent d9f9422 commit 637ae48

File tree

10 files changed

+14
-700
lines changed

10 files changed

+14
-700
lines changed

openshift/message-board/account-service/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@
7070
<scope>provided</scope>
7171
</dependency>
7272

73-
<!-- Test -->
74-
<dependency>
75-
<groupId>org.hibernate.demos.messageboard</groupId>
76-
<artifactId>test-util</artifactId>
77-
<version>${project.version}</version>
78-
<scope>test</scope>
79-
</dependency>
80-
8173
<dependency>
8274
<groupId>junit</groupId>
8375
<artifactId>junit</artifactId>

openshift/message-board/account-service/src/test/java/org/hibernate/demo/message/account/repo/UserRepoIT.java

Lines changed: 0 additions & 110 deletions
This file was deleted.

openshift/message-board/account-service/src/test/java/org/hibernate/demo/message/account/repo/UserRepoTest.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

openshift/message-board/account-service/src/test/java/org/hibernate/demo/message/account/repo/service/util/DeploymentUtil.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.hibernate.demo.message.account.repo.service.util;
22

3-
import org.hibernate.Session;
4-
53
import org.jboss.arquillian.container.test.api.Deployment;
64
import org.jboss.shrinkwrap.api.ShrinkWrap;
75
import org.jboss.shrinkwrap.api.asset.StringAsset;
@@ -12,31 +10,26 @@
1210

1311
public class DeploymentUtil {
1412

15-
private static final String ORM_VERSION = Session.class.getPackage().getImplementationVersion();
16-
private static final String ORM_MINOR_VERSION = ORM_VERSION.substring( 0, ORM_VERSION.indexOf( ".", ORM_VERSION.indexOf( "." ) + 1 ) );
17-
1813
@Deployment
1914
public static WebArchive create() {
2015
return ShrinkWrap
21-
.create( WebArchive.class, "account-service.war" )
22-
.addPackages( true, "org.hibernate.demo.message.account.core" )
16+
.create( WebArchive.class, "account-service.war" )
17+
.addPackages( true, "org.hibernate.demo.message.account.core" )
2318

24-
// only for test
25-
.addPackages( true, "org.hibernate.demo.message.test" )
19+
// only for test
20+
.addPackages( true, "org.hibernate.demo.message.test" )
2621

27-
.addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" );
22+
.addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" );
2823
}
2924

3025
private static PersistenceDescriptor persistenceXml() {
3126
return Descriptors.create( PersistenceDescriptor.class )
32-
.version( "2.1" )
33-
.createPersistenceUnit()
34-
.name( "primary" )
35-
.transactionType( PersistenceUnitTransactionType._JTA )
27+
.version( "2.1" )
28+
.createPersistenceUnit()
29+
.name( "primary" )
30+
.transactionType( PersistenceUnitTransactionType._JTA )
3631
.jtaDataSource( "java:jboss/datasources/ExampleDS" )
3732
.getOrCreateProperties()
38-
// We want to use the ORM from this build instead of the one coming with WildFly
39-
// .createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:" + ORM_MINOR_VERSION ).up()
4033
.createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up()
4134
.up().up();
4235
}

openshift/message-board/message-board-web/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openshift/message-board/message-service/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@
8989
</dependency>
9090

9191
<!-- Test -->
92-
<dependency>
93-
<groupId>org.hibernate.demos.messageboard</groupId>
94-
<artifactId>test-util</artifactId>
95-
<version>${project.version}</version>
96-
<scope>test</scope>
97-
</dependency>
98-
9992
<dependency>
10093
<groupId>junit</groupId>
10194
<artifactId>junit</artifactId>
@@ -146,13 +139,6 @@
146139
<scope>test</scope>
147140
</dependency>
148141

149-
<dependency>
150-
<groupId>com.h2database</groupId>
151-
<artifactId>h2</artifactId>
152-
<version>1.4.196</version>
153-
<scope>test</scope>
154-
</dependency>
155-
156142
<dependency>
157143
<!-- TODO Workaround to fix wildfly-arquillian-container-managed https://issues.jboss.org/browse/WFLY-9747 -->
158144
<groupId>org.wildfly.security</groupId>

openshift/message-board/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<module>extra</module>
2323
<module>account-service</module>
2424
<module>message-service</module>
25-
<module>test-util</module>
2625
</modules>
2726

2827
<dependencyManagement>

0 commit comments

Comments
 (0)