Search in sources :

Example 1 with MinAvailablePolicy

use of org.apache.pulsar.common.policies.impl.MinAvailablePolicy in project incubator-pulsar by apache.

the class MinAvailablePolicyTest method testMinAvailablePolicty.

@Test
public void testMinAvailablePolicty() {
    MinAvailablePolicy m = new MinAvailablePolicy(3, 10);
    Assert.assertFalse(m.equals(new OldPolicies()));
    Assert.assertFalse(m.shouldFailoverToSecondary(15));
    Assert.assertTrue(m.shouldFailoverToSecondary(2));
}
Also used : OldPolicies(org.apache.pulsar.common.policies.data.OldPolicies) MinAvailablePolicy(org.apache.pulsar.common.policies.impl.MinAvailablePolicy) Test(org.testng.annotations.Test)

Aggregations

OldPolicies (org.apache.pulsar.common.policies.data.OldPolicies)1 MinAvailablePolicy (org.apache.pulsar.common.policies.impl.MinAvailablePolicy)1 Test (org.testng.annotations.Test)1