Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In order to write integration tests for your application, you need ability to spin up a geode cluster from your test and then run tests for your application that work against the cluster. Geode now ships with a JUnit Rule to help.

You can use this GfshRule like so:

Code Block
languagejava
titleIntegration Test
linenumberstrue
public class LibraryTest {
    @Rule
    public GfshRule gfshRule = new GfshRule();

    @Test
    public void testSomeLibraryMethod() {
        Library classUnderTest = new Library();
        GfshScript.of("start locator --name=loc",
            "start server --name=serv1",
            "create region --name=test --type=REPLICATE").execute(gfshRule);
        classUnderTest.doPut();
        assertEquals("one", classUnderTest.doGet());
    }
}

...