The GS-Test library contains utilities designed to simplify testing of applications implemented using GigaSpaces.
The PuConfigurers class contains factory methods for builders for different types of processing units (partitioned pu, mirror pu). Those can be used to create an embedded processing unit (RunningPu). The RunningPu extends the org.junit.rules.TestRule interface which makes it easy to run a processing unit "around" either an entire test class using @ClassRule, or around each test case using @Rule.
class FruitTest {
@Rule
public RunningPu fruitPu = PuConfigurers.partitionedPu("classpath:/fruit-pu.xml")
.configure();
// Test cases against fruitPu
}class FruitTest {
RunningPu fruitPu = PuConfigurers.partitionedPu("classpath:/fruit-pu.xml")
.configure();
@Before
public void startFruitPu() {
fruitPu.start();
}
@After
public void stopFruitPu() {
fruitPu.stop();
}
// Test cases against fruitPu
}GS-Test packed as a single jar file. Maven users can get GS-Test using the following coordinates:
<dependency>
<groupId>com.avanza.gs</groupId>
<artifactId>gs-test</artifactId>
<version>0.1.0</version>
</dependency>The GS-Test library is released under version 2.0 of the Apache License.