Class GeodeEmbeddedPolicy.RefCountPolicy

  • All Implemented Interfaces:
    org.junit.rules.TestRule
    Enclosing class:
    GeodeEmbeddedPolicy

    private static class GeodeEmbeddedPolicy.RefCountPolicy
    extends GeodeEmbeddedPolicy
    Calls before() and after() methods only once (for first and last subscriber respectively). The implementation counts number of times before() was called which determines number of "clients". Delegate after() is called when that count reaches zero again (when last "client" called that method).
    • Field Detail

      • refCount

        private final java.util.concurrent.atomic.AtomicInteger refCount
    • Method Detail

      • share

        GeodeEmbeddedPolicy share()
        Description copied from class: GeodeEmbeddedPolicy
        Allows this instance to be shared by multiple test classes (in parallel). Guarantees that before() and after() 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.
        Overrides:
        share in class GeodeEmbeddedPolicy