-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrades to Infinispan 13.0.0.Final, adds infinispan test resource
- Loading branch information
Showing
5 changed files
with
141 additions
and
1 deletion.
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
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,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-test-framework</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-test-infinispan-client</artifactId> | ||
<name>Quarkus - Test Framework - Infinispan Client Support</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-test-common</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.infinispan</groupId> | ||
<artifactId>infinispan-server-testdriver-core</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.codehaus.plexus</groupId> | ||
<artifactId>plexus-interpolation</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-embedder</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-impl-maven</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.maven.wagon</groupId> | ||
<artifactId>wagon-http-shared</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-slf4j-impl</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-core</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.glassfish</groupId> | ||
<artifactId>javax.json</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.jboss.marshalling</groupId> | ||
<artifactId>jboss-marshalling-osgi</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>net.spy</groupId> | ||
<artifactId>spymemcached</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
52 changes: 52 additions & 0 deletions
52
...nispan-client/src/main/java/io/quarkus/test/infinispan/client/InfinispanTestResource.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,52 @@ | ||
package io.quarkus.test.infinispan.client; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import org.infinispan.client.hotrod.impl.ConfigurationProperties; | ||
import org.infinispan.commons.util.Version; | ||
import org.infinispan.server.test.core.InfinispanContainer; | ||
import org.jboss.logging.Logger; | ||
|
||
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; | ||
|
||
public class InfinispanTestResource implements QuarkusTestResourceLifecycleManager { | ||
private static final Logger LOGGER = Logger.getLogger(InfinispanTestResource.class); | ||
public static final String PORT_ARG = "port"; | ||
public static final String USER_ARG = "user"; | ||
public static final String PASSWORD_ARG = "password"; | ||
private static final int DEFAULT_PORT = ConfigurationProperties.DEFAULT_HOTROD_PORT; | ||
private static final String DEFAULT_USER = "admin"; | ||
private static final String DEFAULT_PASSWORD = "password"; | ||
private static InfinispanContainer INFINISPAN; | ||
private String USER; | ||
private String PASSWORD; | ||
private Integer HOTROD_PORT; | ||
|
||
@Override | ||
public void init(Map<String, String> initArgs) { | ||
HOTROD_PORT = Optional.ofNullable(initArgs.get(PORT_ARG)).map(Integer::parseInt).orElse(DEFAULT_PORT); | ||
USER = Optional.ofNullable(initArgs.get(USER_ARG)).orElse(DEFAULT_USER); | ||
PASSWORD = Optional.ofNullable(initArgs.get(PASSWORD_ARG)).orElse(DEFAULT_PASSWORD); | ||
} | ||
|
||
@Override | ||
public Map<String, String> start() { | ||
INFINISPAN = new InfinispanContainer(); | ||
INFINISPAN.withUser(USER).withPassword(PASSWORD); | ||
LOGGER.infof("Starting Infinispan Server %s on port %s with user %s and password %s", Version.getMajorMinor(), | ||
HOTROD_PORT, USER, PASSWORD); | ||
INFINISPAN.start(); | ||
|
||
final String hosts = INFINISPAN.getContainerIpAddress() + ":" + INFINISPAN.getMappedPort(HOTROD_PORT); | ||
return Collections.singletonMap("quarkus.infinispan-client.server-list", hosts); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
if (INFINISPAN != null) { | ||
INFINISPAN.stop(); | ||
} | ||
} | ||
} |
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