Skip to content

Commit 9835b9d

Browse files
committed
OCP-DEMO Add slots to server task deployment config
1 parent 9e481a5 commit 9835b9d

File tree

6 files changed

+84
-3
lines changed

6 files changed

+84
-3
lines changed

openshift/message-board/extra/message-server-task/src/main/resources/META-INF/jboss-deployment-structure.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
44
<deployment>
55
<dependencies>
6-
<module name="org.infinispan.protostream" />
7-
<module name="org.infinispan.remote-query.server" />
6+
<module name="org.infinispan.protostream" slot="ispn-9.3" />
7+
<module name="org.infinispan.remote-query.server" slot="ispn-9.3" />
88
</dependencies>
99
</deployment>
1010
</jboss-deployment-structure>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@
125125
<scope>test</scope>
126126
</dependency>
127127

128+
<dependency>
129+
<groupId>org.jboss.shrinkwrap.resolver</groupId>
130+
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
131+
<scope>test</scope>
132+
</dependency>
133+
128134
<dependency>
129135
<groupId>com.h2database</groupId>
130136
<artifactId>h2</artifactId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.hibernate.demo.message.post.it;
2+
3+
import java.io.File;
4+
5+
import org.hibernate.demo.message.post.util.DeploymentUtil;
6+
import org.hibernate.demo.message.post.util.MavenUtils;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import org.jboss.arquillian.container.test.api.Deployment;
12+
import org.jboss.arquillian.container.test.api.TargetsContainer;
13+
import org.jboss.arquillian.junit.Arquillian;
14+
import org.jboss.shrinkwrap.api.ShrinkWrap;
15+
import org.jboss.shrinkwrap.api.spec.JavaArchive;
16+
import org.jboss.shrinkwrap.api.spec.WebArchive;
17+
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
18+
19+
@RunWith(Arquillian.class)
20+
public class MessageTaskIT {
21+
22+
@Deployment(name = "wildfly")
23+
@TargetsContainer("wildfly")
24+
public static WebArchive doDeploy() {
25+
return DeploymentUtil.create();
26+
}
27+
28+
@Deployment(name = "infinispan", testable = false)
29+
@TargetsContainer("infinispan")
30+
public static JavaArchive getInfinispanDeployment() {
31+
File file = Maven.resolver()
32+
.resolve( "org.hibernate.demos.messageboard:message-server-task:jar:" + MavenUtils.getProperty("project.version") )
33+
.withoutTransitivity().asSingleFile();
34+
35+
return ShrinkWrap.createFromZipFile( JavaArchive.class, file );
36+
}
37+
38+
@Test
39+
public void tryStartInfinispanRemoteWithTask() {
40+
//TODO: implement test case
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
package org.hibernate.demo.message.post.util;
3+
4+
import java.io.IOException;
5+
import java.io.InputStream;
6+
import java.util.Properties;
7+
8+
public class MavenUtils {
9+
10+
private static final String MAVEN_PROPERTIES_FILENAME = "maven.properties";
11+
12+
private static Properties getProperties() {
13+
try ( InputStream inputStream = MavenUtils.class.getClassLoader().getResourceAsStream( MAVEN_PROPERTIES_FILENAME ) ) {
14+
Properties mavenProperties = new Properties();
15+
mavenProperties.load( inputStream );
16+
return mavenProperties;
17+
}
18+
catch (IOException e) {
19+
// not expected
20+
throw new RuntimeException( e );
21+
}
22+
}
23+
24+
public static String getProperty(String propertyName) {
25+
return getProperties().getProperty( propertyName );
26+
}
27+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Define here the Maven properties you want to make available through MavenUtil.getProperties().
2+
#
3+
# It would be nice to have these generated with something like properties-maven-plugin but
4+
# at the moment that doesn't copy system properties and tests don't run propertly in Eclipse.
5+
6+
project.version=${project.version}

openshift/message-board/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
</properties>
2020

2121
<modules>
22+
<module>extra</module>
2223
<module>account-service</module>
2324
<module>message-service</module>
2425
<module>test-util</module>
25-
<module>extra</module>
2626
</modules>
2727

2828
<dependencyManagement>

0 commit comments

Comments
 (0)