Skip to content

Commit

Permalink
Server Integration Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolovison authored and ryanemerson committed Jan 20, 2021
1 parent dc532ea commit 557eb40
Show file tree
Hide file tree
Showing 41 changed files with 2,131 additions and 328 deletions.
25 changes: 25 additions & 0 deletions integrationtests/server-integration/README.md
@@ -0,0 +1,25 @@
# Running in the container:

The test in the module should match one of the following rules:

* Classloading 1: see if all the modules can be correctly initialized
* Classloading 2: see if extension points work with user classes (marshalling, listeners, CDI annotations)
* Security: see if things still work when running the container with a security manager

## Module separation

### server-integration-commons
It contains tests that can be running inside a container.

### third-party-server
It run the tests from `server-integration-commons` and could have specific tests for a container.

### wildfly-modules
It run the tests from `server-integration-commons` and could have specific tests for a wildfly-modules.

## Debug
To export shrinkwrap archive to a file use the following
```java
war.as(ZipExporter.class).exportTo(new File("/path/to/my.war"), true);
```

Expand Up @@ -37,6 +37,42 @@
<artifactId>infinispan-client-hotrod</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-cachestore-jdbc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-cachestore-rocksdb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-cachestore-jpa</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
Expand All @@ -57,6 +93,12 @@
</dependencies>

<build>
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

This file was deleted.

This file was deleted.

@@ -1,4 +1,4 @@
package org.infinispan.test.integration.as;
package org.infinispan.test.integration.data;

import java.io.Serializable;

Expand Down
@@ -1,4 +1,4 @@
package org.infinispan.test.integration.as.client;
package org.infinispan.test.integration.data;

import org.infinispan.protostream.annotations.ProtoField;

Expand All @@ -10,6 +10,9 @@ public class Person {
@ProtoField(2)
public Integer id;

public Person() {
}

public Person(String name) {
this.name = name;
}
Expand All @@ -19,6 +22,11 @@ public Person(String name, Integer id) {
this.id = id;
}

public Person() {
public String getName() {
return name;
}

public Integer getId() {
return id;
}
}
@@ -0,0 +1,39 @@
package org.infinispan.test.integration.embedded;

import static org.junit.Assert.assertEquals;

import org.infinispan.Cache;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.junit.After;
import org.junit.Test;

/**
* Test the Infinispan AS module integration
*
* @author Tristan Tarrant
* @since 5.2
*/
public abstract class AbstractInfinispanCoreIT {

private EmbeddedCacheManager cm;

@After
public void cleanUp() {
if (cm != null)
cm.stop();
}

@Test
public void testCacheManager() {
GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder();
gcb.defaultCacheName("default");

cm = new DefaultCacheManager(gcb.build(), new ConfigurationBuilder().build());
Cache<String, String> cache = cm.getCache();
cache.put("a", "a");
assertEquals("a", cache.get("a"));
}
}

0 comments on commit 557eb40

Please sign in to comment.