Search in sources :

Example 1 with AbstractStaticFailoverStrategy

use of org.apache.cxf.clustering.AbstractStaticFailoverStrategy in project cxf by apache.

the class FailoverAddressOverrideTest method verifyStrategy.

protected void verifyStrategy(Object proxy, Class<?> clz, int count) {
    ConduitSelector conduitSelector = ClientProxy.getClient(proxy).getConduitSelector();
    if (conduitSelector instanceof FailoverTargetSelector) {
        AbstractStaticFailoverStrategy strategy = (AbstractStaticFailoverStrategy) ((FailoverTargetSelector) conduitSelector).getStrategy();
        assertTrue("unexpected strategy", clz.isInstance(strategy));
        List<String> alternates = strategy.getAlternateAddresses(null);
        assertNotNull("expected alternate addresses", alternates);
        assertEquals("unexpected alternate addresses", count, alternates.size());
    } else {
        fail("unexpected conduit selector: " + conduitSelector);
    }
}
Also used : AbstractStaticFailoverStrategy(org.apache.cxf.clustering.AbstractStaticFailoverStrategy) FailoverTargetSelector(org.apache.cxf.clustering.FailoverTargetSelector) ConduitSelector(org.apache.cxf.endpoint.ConduitSelector)

Aggregations

AbstractStaticFailoverStrategy (org.apache.cxf.clustering.AbstractStaticFailoverStrategy)1 FailoverTargetSelector (org.apache.cxf.clustering.FailoverTargetSelector)1 ConduitSelector (org.apache.cxf.endpoint.ConduitSelector)1