Class GeodeEmbeddedPolicy
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- org.apache.calcite.adapter.geode.rel.GeodeEmbeddedPolicy
-
- All Implemented Interfaces:
org.junit.rules.TestRule
- Direct Known Subclasses:
GeodeEmbeddedPolicy.RefCountPolicy
public class GeodeEmbeddedPolicy extends org.junit.rules.ExternalResource
Manages embedded Geode instance using nativeServerLauncher
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
GeodeEmbeddedPolicy.RefCountPolicy
Callsbefore()
andafter()
methods only once (for first and last subscriber respectively).
-
Field Summary
Fields Modifier and Type Field Description private org.apache.geode.distributed.ServerLauncher
launcher
-
Constructor Summary
Constructors Modifier Constructor Description private
GeodeEmbeddedPolicy(org.apache.geode.distributed.ServerLauncher launcher)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
after()
protected void
before()
(package private) org.apache.geode.cache.Cache
cache()
Returns current cache instance which was initialized for tests.(package private) static GeodeEmbeddedPolicy
create()
private void
requireStatus(org.apache.geode.distributed.AbstractLauncher.Status expected)
(package private) GeodeEmbeddedPolicy
share()
Allows this instance to be shared by multiple test classes (in parallel).
-
-
-
Method Detail
-
before
protected void before()
- Overrides:
before
in classorg.junit.rules.ExternalResource
-
after
protected void after()
- Overrides:
after
in classorg.junit.rules.ExternalResource
-
share
GeodeEmbeddedPolicy share()
Allows this instance to be shared by multiple test classes (in parallel). Guarantees thatbefore()
andafter()
methods will be called only once. This setup is useful for maven (surefire) plugin which executes tests in parallel (including@ClassRule
methods) and may initialize (or destroy) same resource multiple times.
-
cache
org.apache.geode.cache.Cache cache()
Returns current cache instance which was initialized for tests.- Throws:
java.lang.IllegalStateException
- if server process didn't start
-
requireStatus
private void requireStatus(org.apache.geode.distributed.AbstractLauncher.Status expected)
-
create
static GeodeEmbeddedPolicy create()
-
-