* upgrade to final release of infinispan 15 --------- Signed-off-by: Olivier Lamy <olamy@apache.org>
This commit is contained in:
parent
adfa0da5e4
commit
d2beb2bd3f
|
@ -74,7 +74,7 @@ jobs:
|
|||
|
||||
- name: Set up Maven
|
||||
run:
|
||||
mvn -e -B -V org.apache.maven.plugins:maven-wrapper-plugin:3.1.0:wrapper "-Dmaven=3.9.4"
|
||||
mvn -e -B -V org.apache.maven.plugins:maven-wrapper-plugin:3.1.0:wrapper "-Dmaven=3.9.6"
|
||||
|
||||
- name: Clean install dependencies and build
|
||||
env:
|
||||
|
|
|
@ -126,7 +126,7 @@ public abstract class AbstractSessionDataStoreTest
|
|||
throws Exception
|
||||
{
|
||||
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("Foo.clazz");
|
||||
extraClasses = new File(MavenTestingUtils.getTargetDir(), "extraClasses");
|
||||
extraClasses = new File(MavenTestingUtils.getTargetPath().toFile(), "extraClasses");
|
||||
extraClasses.mkdirs();
|
||||
File fooclass = new File(extraClasses, "Foo.class");
|
||||
IO.copy(is, new FileOutputStream(fooclass));
|
||||
|
@ -199,20 +199,15 @@ public abstract class AbstractSessionDataStoreTest
|
|||
//before serialization
|
||||
final SessionData finalData = data;
|
||||
|
||||
Runnable r = new Runnable()
|
||||
Runnable r = () ->
|
||||
{
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
store.store("aaa1", finalData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail(e);
|
||||
}
|
||||
store.store("aaa1", finalData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail(e);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -304,20 +299,15 @@ public abstract class AbstractSessionDataStoreTest
|
|||
//before serialization
|
||||
final SessionData finalData = data;
|
||||
|
||||
Runnable r = new Runnable()
|
||||
Runnable r = () ->
|
||||
{
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
store.store("aaa3", finalData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail(e);
|
||||
}
|
||||
store.store("aaa3", finalData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail(e);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.jetty.server.Handler;
|
|||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
@ -65,6 +66,7 @@ public class ServerTimeoutsTest extends AbstractTest
|
|||
|
||||
@ParameterizedTest
|
||||
@MethodSource("transportsAndIdleTimeoutListener")
|
||||
@Tag("flaky")
|
||||
public void testIdleTimeout(Transport transport, boolean addIdleTimeoutListener) throws Exception
|
||||
{
|
||||
AtomicBoolean listenerCalled = new AtomicBoolean();
|
||||
|
@ -94,6 +96,7 @@ public class ServerTimeoutsTest extends AbstractTest
|
|||
|
||||
@ParameterizedTest
|
||||
@MethodSource("transportsAndIdleTimeoutListener")
|
||||
@Tag("flaky")
|
||||
public void testIdleTimeoutWithDemand(Transport transport, boolean addIdleTimeoutListener) throws Exception
|
||||
{
|
||||
AtomicBoolean listenerCalled = new AtomicBoolean();
|
||||
|
|
|
@ -10,10 +10,17 @@
|
|||
<name>EE10 :: Tests :: Sessions :: Infinispan</name>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.sessions.infinispan</bundle-symbolic-name>
|
||||
<!-- from 10.xx it has changed to jboss/infinispan -->
|
||||
<infinispan.docker.image.name>infinispan/server</infinispan.docker.image.name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-pojo-base</artifactId>
|
||||
<version>7.1.0.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
|
@ -21,8 +28,9 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-core</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -77,6 +85,11 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.infinispan</groupId>
|
||||
<artifactId>infinispan-client-hotrod</artifactId>
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
<name>EE9 :: Tests :: Sessions :: Infinispan</name>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.sessions.infinispan</bundle-symbolic-name>
|
||||
<!-- from 10.xx it has changed to jboss/infinispan -->
|
||||
<infinispan.docker.image.name>infinispan/server</infinispan.docker.image.name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-session</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-mapper-pojo-base</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.infinispan</groupId>
|
||||
<artifactId>infinispan-core</artifactId>
|
||||
|
|
|
@ -21,6 +21,9 @@ import java.util.Map;
|
|||
|
||||
import org.eclipse.jetty.session.SessionData;
|
||||
import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
|
||||
import org.hibernate.search.engine.backend.types.Searchable;
|
||||
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
|
||||
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
|
||||
|
||||
/**
|
||||
* InfinispanSessionData
|
||||
|
@ -32,6 +35,7 @@ import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
|
|||
* pool and thus these threads have no knowledge of the correct classloader to
|
||||
* use.
|
||||
*/
|
||||
@Indexed
|
||||
public class InfinispanSessionData extends SessionData
|
||||
{
|
||||
protected byte[] _serializedAttributes;
|
||||
|
@ -47,6 +51,13 @@ public class InfinispanSessionData extends SessionData
|
|||
super(id, cpath, vhost, created, accessed, lastAccessed, maxInactiveMs, attributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
@GenericField(searchable = Searchable.YES)
|
||||
public long getExpiry()
|
||||
{
|
||||
return super.getExpiry();
|
||||
}
|
||||
|
||||
public byte[] getSerializedAttributes()
|
||||
{
|
||||
return _serializedAttributes;
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.jetty.session.SessionData;
|
|||
import org.infinispan.client.hotrod.RemoteCache;
|
||||
import org.infinispan.client.hotrod.RemoteCacheManager;
|
||||
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
|
||||
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
|
||||
import org.infinispan.commons.marshall.ProtoStreamMarshaller;
|
||||
import org.infinispan.protostream.FileDescriptorSource;
|
||||
import org.infinispan.protostream.SerializationContext;
|
||||
|
||||
|
@ -55,11 +55,12 @@ public class InfinispanSessionLegacyConverter
|
|||
|
||||
Properties properties = new Properties();
|
||||
ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
|
||||
clientBuilder.withProperties(properties).addServer().host(host).marshaller(new ProtoStreamMarshaller());
|
||||
ProtoStreamMarshaller protoStreamMarshaller = new ProtoStreamMarshaller();
|
||||
clientBuilder.withProperties(properties).addServer().host(host).marshaller(protoStreamMarshaller);
|
||||
_protoManager = new RemoteCacheManager(clientBuilder.build());
|
||||
FileDescriptorSource fds = new FileDescriptorSource();
|
||||
fds.addProtoFiles("/session.proto");
|
||||
SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(_protoManager);
|
||||
SerializationContext serCtx = protoStreamMarshaller.getSerializationContext();
|
||||
serCtx.registerProtoFiles(fds);
|
||||
serCtx.registerMarshaller(new SessionDataMarshaller());
|
||||
_protoCache = _protoManager.getCache(cacheName);
|
||||
|
|
|
@ -7,35 +7,7 @@
|
|||
<!-- ===================================================================== -->
|
||||
<!-- Get a reference to the default local cache. -->
|
||||
<!-- ===================================================================== -->
|
||||
|
||||
<!-- TODO allow users to add more properties -->
|
||||
<New id="properties" class="java.util.Properties">
|
||||
<Call name="put">
|
||||
<Arg>
|
||||
<Get class="org.hibernate.search.cfg.Environment" name="MODEL_MAPPING"/>
|
||||
</Arg>
|
||||
<Arg>
|
||||
<New class="org.hibernate.search.cfg.SearchMapping">
|
||||
<Call name="entity">
|
||||
<Arg>
|
||||
<Get class="org.eclipse.jetty.session.infinispan.InfinispanSessionData" name="class"/>
|
||||
</Arg>
|
||||
<Call name="indexed">
|
||||
<Call name="providedId">
|
||||
<Call name="property">
|
||||
<Arg type="String">expiry</Arg>
|
||||
<Arg>
|
||||
<Get class="java.lang.annotation.ElementType" name="FIELD"/>
|
||||
</Arg>
|
||||
<Call name="field"/>
|
||||
</Call>
|
||||
</Call>
|
||||
</Call>
|
||||
</Call>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</New>
|
||||
|
||||
|
||||
<New id="cacheMgr" class="org.infinispan.manager.DefaultCacheManager">
|
||||
<Arg>
|
||||
|
@ -50,27 +22,16 @@
|
|||
<Arg>
|
||||
<Ref refid="defaultConfig"/>
|
||||
</Arg>
|
||||
<Call name="indexing">
|
||||
<Call name="index">
|
||||
<Arg>
|
||||
<Get class="org.infinispan.configuration.cache.Index" name="ALL"/>
|
||||
</Arg>
|
||||
<Call name="addIndexedEntity">
|
||||
<Arg>
|
||||
<Get class="org.eclipse.jetty.session.infinispan.InfinispanSessionData" name="class"/>
|
||||
</Arg>
|
||||
<Call name="withProperties">
|
||||
<Arg>
|
||||
<Ref refid="properties"/>
|
||||
</Arg>
|
||||
<Call id="config" name="build"/>
|
||||
</Call>
|
||||
</Call>
|
||||
</Call>
|
||||
<Call name="indexing"/>
|
||||
<Call name="enabled"/>
|
||||
<Call name="addIndexedEntity">
|
||||
<Arg>
|
||||
<Get class="org.eclipse.jetty.session.infinispan.InfinispanSessionData" name="class"/>
|
||||
</Arg>
|
||||
</Call>
|
||||
</Call>
|
||||
</New>
|
||||
|
||||
|
||||
<Ref refid="cacheMgr">
|
||||
<Call name="defineConfiguration">
|
||||
<Arg>jetty-query-sessions</Arg>
|
||||
|
|
|
@ -6,20 +6,7 @@
|
|||
<!-- ===================================================================== -->
|
||||
<!-- Set up support for queries and index on session expiry time. -->
|
||||
<!-- ===================================================================== -->
|
||||
<New id="mapping" class="org.hibernate.search.cfg.SearchMapping">
|
||||
<Call name="entity">
|
||||
<Arg><Call class="java.lang.Class" name="forName"><Arg>org.eclipse.jetty.session.infinispan.InfinispanSessionData</Arg></Call></Arg>
|
||||
<Call name="indexed">
|
||||
<Call name="providedId">
|
||||
<Call name="property">
|
||||
<Arg type="String">expiry</Arg>
|
||||
<Arg><Get class="java.lang.annotation.ElementType" name="FIELD"/></Arg>
|
||||
<Call name="field"/>
|
||||
</Call>
|
||||
</Call>
|
||||
</Call>
|
||||
</Call>
|
||||
</New>
|
||||
|
||||
|
||||
<New id="properties" class="java.util.Properties">
|
||||
<Call name="load">
|
||||
|
@ -29,10 +16,6 @@
|
|||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
<Call name="put">
|
||||
<Arg><Get class="org.hibernate.search.cfg.Environment" name="MODEL_MAPPING"/></Arg>
|
||||
<Arg><Ref refid="mapping"/></Arg>
|
||||
</Call>
|
||||
</New>
|
||||
|
||||
|
||||
|
|
95
pom.xml
95
pom.xml
|
@ -189,9 +189,11 @@
|
|||
<h2spec.maven.plugin.version>1.0.11</h2spec.maven.plugin.version>
|
||||
<hamcrest.version>2.2</hamcrest.version>
|
||||
<hazelcast.version>5.3.6</hazelcast.version>
|
||||
<infinispan.docker.image.version>11.0.14.Final</infinispan.docker.image.version>
|
||||
<infinispan.protostream.version>4.6.5.Final</infinispan.protostream.version>
|
||||
<infinispan.version>11.0.19.Final</infinispan.version>
|
||||
<hibernate.search.version>7.1.0.Final</hibernate.search.version>
|
||||
<infinispan.docker.image.name>infinispan/server</infinispan.docker.image.name>
|
||||
<infinispan.docker.image.version>15.0.1.Final-1</infinispan.docker.image.version>
|
||||
<infinispan.protostream.version>5.0.2.Final</infinispan.protostream.version>
|
||||
<infinispan.version>15.0.1.Final</infinispan.version>
|
||||
<injection.bundle.version>1.2</injection.bundle.version>
|
||||
<invoker.mergeUserSettings>false</invoker.mergeUserSettings>
|
||||
<it.debug>false</it.debug>
|
||||
|
@ -234,6 +236,7 @@
|
|||
<localRepoPath>${project.build.directory}/local-repo</localRepoPath>
|
||||
<log4j2.version>2.23.1</log4j2.version>
|
||||
<logback.version>1.5.3</logback.version>
|
||||
<lucene.version>9.9.2</lucene.version>
|
||||
<mariadb.docker.version>10.3.6</mariadb.docker.version>
|
||||
<mariadb.version>3.3.3</mariadb.version>
|
||||
<maven-artifact-transfer.version>0.13.1</maven-artifact-transfer.version>
|
||||
|
@ -270,7 +273,7 @@
|
|||
<mina.core.version>2.2.3</mina.core.version>
|
||||
<mongo.docker.version>3.2.20</mongo.docker.version>
|
||||
<mongodb.version>3.12.14</mongodb.version>
|
||||
<netty.version>4.1.100.Final</netty.version>
|
||||
<netty.version>4.1.107.Final</netty.version>
|
||||
<openpojo.version>0.9.1</openpojo.version>
|
||||
<org.osgi.annotation.version>8.1.0</org.osgi.annotation.version>
|
||||
<org.osgi.core.version>8.0.0</org.osgi.core.version>
|
||||
|
@ -321,6 +324,13 @@
|
|||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-bom</artifactId>
|
||||
<version>${hibernate.search.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.infinispan</groupId>
|
||||
<artifactId>infinispan-bom</artifactId>
|
||||
|
@ -536,6 +546,11 @@
|
|||
<artifactId>maven-settings</artifactId>
|
||||
<version>${maven.deps.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${maven.plugin-tools.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
|
@ -904,6 +919,11 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<version>${jetty.test.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-xhtml-schemas</artifactId>
|
||||
<version>${jetty.xhtml.schemas-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>jetty-websocket-core-client</artifactId>
|
||||
|
@ -1094,6 +1114,16 @@
|
|||
<artifactId>org.osgi.util.function</artifactId>
|
||||
<version>${org.osgi.util.function.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.measurement</artifactId>
|
||||
<version>${osgi-util-measurement-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.position</artifactId>
|
||||
<version>${osgi-util-position-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.promise</artifactId>
|
||||
|
@ -1104,6 +1134,11 @@
|
|||
<artifactId>org.osgi.util.tracker</artifactId>
|
||||
<version>${osgi-util-tracker-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.xml</artifactId>
|
||||
<version>${osgi-util-xml-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>osgi.annotation</artifactId>
|
||||
|
@ -1152,76 +1187,44 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${maven.plugin-tools.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-xhtml-schemas</artifactId>
|
||||
<version>${jetty.xhtml.schemas-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.measurement</artifactId>
|
||||
<version>${osgi-util-measurement-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.position</artifactId>
|
||||
<version>${osgi-util-position-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.util.xml</artifactId>
|
||||
<version>${osgi-util-xml-version}</version>
|
||||
<scope>test</scope>
|
||||
<groupId>org.wildfly.common</groupId>
|
||||
<artifactId>wildfly-common</artifactId>
|
||||
<version>1.7.0.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-digest</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-external</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-gs2</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-gssapi</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-oauth2</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-plain</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.security</groupId>
|
||||
<artifactId>wildfly-elytron-sasl-scram</artifactId>
|
||||
<version>2.2.2.Final</version>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1.Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
|
|
@ -70,13 +70,6 @@
|
|||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-search-engine</artifactId>
|
||||
<version>5.10.7.Final</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.infinispan</groupId>
|
||||
<artifactId>infinispan-client-hotrod</artifactId>
|
||||
|
@ -144,6 +137,11 @@
|
|||
<artifactId>testcontainers</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.search</groupId>
|
||||
<artifactId>hibernate-search-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -22,11 +22,11 @@ import org.eclipse.jetty.session.SessionData;
|
|||
import org.eclipse.jetty.session.infinispan.InfinispanSerializationContextInitializer;
|
||||
import org.eclipse.jetty.session.infinispan.InfinispanSessionData;
|
||||
import org.eclipse.jetty.toolchain.test.FS;
|
||||
import org.hibernate.search.cfg.Environment;
|
||||
import org.hibernate.search.cfg.SearchMapping;
|
||||
import org.infinispan.Cache;
|
||||
import org.infinispan.configuration.cache.ConfigurationBuilder;
|
||||
import org.infinispan.configuration.cache.ConfigurationChildBuilder;
|
||||
import org.infinispan.configuration.cache.IndexStorage;
|
||||
import org.infinispan.configuration.cache.SingleFileStoreConfigurationBuilder;
|
||||
import org.infinispan.configuration.cache.StorageType;
|
||||
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
|
||||
import org.infinispan.eviction.EvictionStrategy;
|
||||
|
@ -92,12 +92,6 @@ public class InfinispanTestSupport
|
|||
Path tmpdir = root.resolve("tmp");
|
||||
FS.ensureDirExists(indexesDir);
|
||||
|
||||
SearchMapping mapping = new SearchMapping();
|
||||
mapping.entity(SessionData.class).indexed().providedId().property("expiry", ElementType.FIELD).field();
|
||||
Properties properties = new Properties();
|
||||
properties.put(Environment.MODEL_MAPPING, mapping);
|
||||
properties.put("hibernate.search.default.indexBase", indexesDir.toString());
|
||||
properties.put("hibernate.cache.infinispan.entity.eviction.strategy", "NONE");
|
||||
|
||||
if (_manager.cacheExists(_name))
|
||||
{
|
||||
|
@ -108,14 +102,16 @@ public class InfinispanTestSupport
|
|||
{
|
||||
ConfigurationChildBuilder b = _builder
|
||||
.indexing()
|
||||
.addIndexedEntity(SessionData.class)
|
||||
.withProperties(properties)
|
||||
.enable()
|
||||
.addIndexedEntity(InfinispanSessionData.class)
|
||||
.storage(IndexStorage.FILESYSTEM)
|
||||
.path(tmpdir.toFile().getAbsolutePath())
|
||||
.memory()
|
||||
.whenFull(EvictionStrategy.NONE)
|
||||
.persistence()
|
||||
.addSingleFileStore()
|
||||
.segmented(false)
|
||||
.location(tmpdir.toFile().getAbsolutePath());
|
||||
.addStore(SingleFileStoreConfigurationBuilder.class)
|
||||
.location(System.getProperty("java.io.tmpdir"));
|
||||
|
||||
if (_serializeSessionData)
|
||||
{
|
||||
b = b.memory().storage(StorageType.HEAP)
|
||||
|
@ -127,8 +123,9 @@ public class InfinispanTestSupport
|
|||
else
|
||||
{
|
||||
ConfigurationChildBuilder b = _builder.indexing()
|
||||
.withProperties(properties)
|
||||
.addIndexedEntity(SessionData.class);
|
||||
.enable()
|
||||
.storage(IndexStorage.LOCAL_HEAP)
|
||||
.addIndexedEntity(InfinispanSessionData.class);
|
||||
|
||||
if (_serializeSessionData)
|
||||
{
|
||||
|
|
|
@ -26,14 +26,12 @@ import org.eclipse.jetty.session.infinispan.InfinispanSerializationContextInitia
|
|||
import org.eclipse.jetty.session.infinispan.InfinispanSessionData;
|
||||
import org.eclipse.jetty.session.infinispan.SessionDataMarshaller;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.hibernate.search.cfg.Environment;
|
||||
import org.hibernate.search.cfg.SearchMapping;
|
||||
import org.infinispan.client.hotrod.RemoteCache;
|
||||
import org.infinispan.client.hotrod.RemoteCacheManager;
|
||||
import org.infinispan.client.hotrod.configuration.ClientIntelligence;
|
||||
import org.infinispan.client.hotrod.configuration.Configuration;
|
||||
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
|
||||
import org.infinispan.commons.configuration.XMLStringConfiguration;
|
||||
import org.infinispan.commons.configuration.StringConfiguration;
|
||||
import org.infinispan.commons.marshall.ProtoStreamMarshaller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -56,7 +54,7 @@ public class RemoteInfinispanTestSupport
|
|||
private static final Logger INFINISPAN_LOG =
|
||||
LoggerFactory.getLogger("org.eclipse.jetty.server.session.remote.infinispanLogs");
|
||||
|
||||
private static final String INFINISPAN_VERSION = System.getProperty("infinispan.docker.image.version", "11.0.14.Final");
|
||||
private static final String INFINISPAN_VERSION = System.getProperty("infinispan.docker.image.version", "14.0.25.Final");
|
||||
private static final String IMAGE_NAME = System.getProperty("infinispan.docker.image.name", "infinispan/server") +
|
||||
":" + INFINISPAN_VERSION;
|
||||
|
||||
|
@ -77,15 +75,7 @@ public class RemoteInfinispanTestSupport
|
|||
|
||||
// setup instance
|
||||
{
|
||||
|
||||
SearchMapping mapping = new SearchMapping();
|
||||
mapping.entity(InfinispanSessionData.class).indexed().providedId()
|
||||
.property("expiry", ElementType.METHOD).field();
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.put(Environment.MODEL_MAPPING, mapping);
|
||||
|
||||
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().withProperties(properties)
|
||||
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.addServer()
|
||||
.host(infinispan.getHost())
|
||||
.port(infinispan.getMappedPort(11222))
|
||||
|
@ -139,7 +129,7 @@ public class RemoteInfinispanTestSupport
|
|||
"</cache-container>" +
|
||||
"</infinispan>", _name);
|
||||
|
||||
XMLStringConfiguration xmlConfig = new XMLStringConfiguration(xml);
|
||||
StringConfiguration xmlConfig = new StringConfiguration(xml);
|
||||
_cache = _manager.administration().getOrCreateCache(_name, xmlConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -256,6 +256,16 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<systemPropertyVariables combine.children="append">
|
||||
<infinispan.docker.image.version>${infinispan.docker.image.version}</infinispan.docker.image.version>
|
||||
<infinispan.docker.image.name>${infinispan.docker.image.name}</infinispan.docker.image.name>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -31,14 +30,13 @@ import org.infinispan.client.hotrod.RemoteCacheManager;
|
|||
import org.infinispan.client.hotrod.configuration.ClientIntelligence;
|
||||
import org.infinispan.client.hotrod.configuration.Configuration;
|
||||
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
|
||||
import org.infinispan.commons.configuration.XMLStringConfiguration;
|
||||
import org.infinispan.commons.configuration.StringConfiguration;
|
||||
import org.infinispan.commons.marshall.ProtoStreamMarshaller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testcontainers.containers.BindMode;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.output.Slf4jLogConsumer;
|
||||
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
|
||||
/**
|
||||
|
@ -59,7 +57,7 @@ public class InfinispanSessionDistributionTests extends AbstractSessionDistribut
|
|||
@Override
|
||||
public void startExternalSessionStorage() throws Exception
|
||||
{
|
||||
String infinispanVersion = System.getProperty("infinispan.docker.image.version", "11.0.14.Final");
|
||||
String infinispanVersion = System.getProperty("infinispan.docker.image.version", "15.0.0.CR1-1");
|
||||
infinispan =
|
||||
new GenericContainer<>(System.getProperty("infinispan.docker.image.name", "infinispan/server") +
|
||||
":" + infinispanVersion)
|
||||
|
@ -129,7 +127,7 @@ public class InfinispanSessionDistributionTests extends AbstractSessionDistribut
|
|||
"</cache-container>" +
|
||||
"</infinispan>", "sessions");
|
||||
|
||||
XMLStringConfiguration xmlConfig = new XMLStringConfiguration(xml);
|
||||
StringConfiguration xmlConfig = new StringConfiguration(xml);
|
||||
remoteCacheManager.administration().getOrCreateCache("sessions", xmlConfig);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue