Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add distributed TimerService test case that uses infinispan-server fo…
…r timer persistence.
- Loading branch information
Showing
6 changed files
with
200 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...rc/test/java/org/jboss/as/test/clustering/cluster/ejb/timer/DistributedTimerTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2022, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This 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 software 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 software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.as.test.clustering.cluster.ejb.timer; | ||
|
||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.jboss.arquillian.container.test.api.TargetsContainer; | ||
import org.jboss.shrinkwrap.api.Archive; | ||
|
||
/** | ||
* @author Paul Ferraro | ||
*/ | ||
public class DistributedTimerTestCase extends AbstractTimerServiceTestCase { | ||
|
||
@Deployment(name = DEPLOYMENT_1, managed = false, testable = false) | ||
@TargetsContainer(NODE_1) | ||
public static Archive<?> deployment0() { | ||
return createArchive(); | ||
} | ||
|
||
@Deployment(name = DEPLOYMENT_2, managed = false, testable = false) | ||
@TargetsContainer(NODE_2) | ||
public static Archive<?> deployment1() { | ||
return createArchive(); | ||
} | ||
|
||
private static Archive<?> createArchive() { | ||
return createArchive(DistributedTimerTestCase.class); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
...oss/as/test/clustering/cluster/ejb/timer/remote/HotRodPersistentTimerServiceTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2022, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This 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 software 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 software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.as.test.clustering.cluster.ejb.timer.remote; | ||
|
||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.jboss.arquillian.container.test.api.TargetsContainer; | ||
import org.jboss.as.arquillian.api.ServerSetup; | ||
import org.jboss.as.test.clustering.cluster.ejb.timer.AbstractTimerServiceTestCase; | ||
import org.jboss.as.test.shared.CLIServerSetupTask; | ||
import org.jboss.shrinkwrap.api.Archive; | ||
import org.junit.ClassRule; | ||
import org.junit.rules.TestRule; | ||
|
||
/** | ||
* @author Paul Ferraro | ||
*/ | ||
@ServerSetup({ InfinispanServerSetupTask.class, HotRodPersistentTimerServiceTestCase.ServerSetupTask.class }) | ||
public class HotRodPersistentTimerServiceTestCase extends AbstractTimerServiceTestCase { | ||
|
||
@ClassRule | ||
public static final TestRule INFINISPAN_SERVER_RULE = infinispanServerTestRule(); | ||
|
||
@Deployment(name = DEPLOYMENT_1, managed = false, testable = false) | ||
@TargetsContainer(NODE_1) | ||
public static Archive<?> deployment0() { | ||
return createArchive(); | ||
} | ||
|
||
@Deployment(name = DEPLOYMENT_2, managed = false, testable = false) | ||
@TargetsContainer(NODE_2) | ||
public static Archive<?> deployment1() { | ||
return createArchive(); | ||
} | ||
|
||
private static Archive<?> createArchive() { | ||
return createArchive(HotRodPersistentTimerServiceTestCase.class); | ||
} | ||
|
||
static class ServerSetupTask extends CLIServerSetupTask { | ||
ServerSetupTask() { | ||
this.builder.node(THREE_NODES) | ||
.setup("/subsystem=infinispan/cache-container=ejb/invalidation-cache=hotrod-persistent:add") | ||
.setup("/subsystem=infinispan/cache-container=ejb/invalidation-cache=hotrod-persistent/component=expiration:add(interval=0)") | ||
.setup("/subsystem=infinispan/cache-container=ejb/invalidation-cache=hotrod-persistent/component=locking:add(isolation=REPEATABLE_READ)") | ||
.setup("/subsystem=infinispan/cache-container=ejb/invalidation-cache=hotrod-persistent/component=transaction:add(mode=BATCH)") | ||
.setup("/subsystem=infinispan/cache-container=ejb/invalidation-cache=hotrod-persistent/store=hotrod:add(remote-cache-container=ejb, cache-configuration=default, fetch-state=false, purge=false, passivation=false, shared=true)") | ||
.setup("/subsystem=distributable-ejb/infinispan-timer-management=hotrod:add(cache-container=ejb, cache=hotrod-persistent)") | ||
.teardown("/subsystem=distributable-ejb/infinispan-timer-management=hotrod:remove") | ||
.teardown("/subsystem=infinispan/cache-container=ejb/invalidation-cache=hotrod-persistent:remove") | ||
; | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...java/org/jboss/as/test/clustering/cluster/ejb/timer/remote/InfinispanServerSetupTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2019, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This 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 software 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 software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.as.test.clustering.cluster.ejb.timer.remote; | ||
|
||
import static org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase.INFINISPAN_APPLICATION_PASSWORD; | ||
import static org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase.INFINISPAN_APPLICATION_USER; | ||
import static org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase.INFINISPAN_SERVER_ADDRESS; | ||
import static org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase.INFINISPAN_SERVER_PORT; | ||
|
||
import org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase; | ||
import org.jboss.as.test.shared.CLIServerSetupTask; | ||
|
||
/** | ||
* Server setup task that configures a hotrod client to connect to an Infinispan server. | ||
* @author Paul Ferraro | ||
*/ | ||
public class InfinispanServerSetupTask extends CLIServerSetupTask { | ||
public InfinispanServerSetupTask() { | ||
this.builder.node(AbstractClusteringTestCase.THREE_NODES) | ||
.setup("/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=infinispan-server:add(port=%d,host=%s)", INFINISPAN_SERVER_PORT, INFINISPAN_SERVER_ADDRESS) | ||
.setup("/subsystem=infinispan/remote-cache-container=ejb:add(default-remote-cluster=infinispan-server-cluster, tcp-keep-alive=true, marshaller=PROTOSTREAM, module=org.wildfly.clustering.ejb.infinispan, properties={infinispan.client.hotrod.auth_username=%s, infinispan.client.hotrod.auth_password=%s}, statistics-enabled=true)", INFINISPAN_APPLICATION_USER, INFINISPAN_APPLICATION_PASSWORD) | ||
.setup("/subsystem=infinispan/remote-cache-container=ejb/remote-cluster=infinispan-server-cluster:add(socket-bindings=[infinispan-server])") | ||
.teardown("/subsystem=infinispan/remote-cache-container=ejb:remove") | ||
.teardown("/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=infinispan-server:remove") | ||
; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...tering/src/test/java/org/jboss/as/test/clustering/cluster/ejb/timer/remote/jboss-ejb3.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee" | ||
xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:t="urn:timer-service:2.0" | ||
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd | ||
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd | ||
http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" | ||
version="3.1" | ||
impl-version="2.0"> | ||
<assembly-descriptor> | ||
<t:timer-service> | ||
<ejb-name>*</ejb-name> | ||
<t:persistent-timer-management>hotrod</t:persistent-timer-management> | ||
</t:timer-service> | ||
</assembly-descriptor> | ||
</jboss:ejb-jar> |