Search in sources :

Example 1 with SimpleTransactionControlFilter

use of io.servicecomb.loadbalance.filter.SimpleTransactionControlFilter in project java-chassis by ServiceComb.

the class TestLoadBalancer method testFilter.

@Test
public void testFilter() {
    Assert.assertEquals(0, loadBalancer.getFilterSize());
    TransactionControlFilter filter = new SimpleTransactionControlFilter();
    loadBalancer.putFilter("test", filter);
    Assert.assertEquals(1, loadBalancer.getFilterSize());
    Assert.assertTrue(loadBalancer.containsFilter("test"));
    loadBalancer.removeFilter("test");
    Assert.assertEquals(0, loadBalancer.getFilterSize());
    Assert.assertFalse(loadBalancer.containsFilter("test"));
}
Also used : TransactionControlFilter(io.servicecomb.loadbalance.filter.TransactionControlFilter) SimpleTransactionControlFilter(io.servicecomb.loadbalance.filter.SimpleTransactionControlFilter) SimpleTransactionControlFilter(io.servicecomb.loadbalance.filter.SimpleTransactionControlFilter) Test(org.junit.Test)

Aggregations

SimpleTransactionControlFilter (io.servicecomb.loadbalance.filter.SimpleTransactionControlFilter)1 TransactionControlFilter (io.servicecomb.loadbalance.filter.TransactionControlFilter)1 Test (org.junit.Test)1