Search in sources :

Example 1 with HotRodTestingUtil

use of org.infinispan.server.hotrod.test.HotRodTestingUtil in project infinispan by infinispan.

the class HotRodDistributionTest method testSize.

public void testSize(Method m) {
    // Cache contents not cleared between methods to avoid deleting
    // topology information, so just use a different cache
    String newCacheName = "dist-size";
    startCaches(newCacheName);
    List<HotRodClient> newClients = createClients(newCacheName);
    try {
        TestSizeResponse sizeStart = newClients.get(0).size();
        assertStatus(sizeStart, Success);
        assertEquals(0, sizeStart.size);
        for (int i = 0; i < 20; i++) {
            newClients.get(1).assertPut(m, "k-" + i, "v-" + i);
        }
        TestSizeResponse sizeEnd = newClients.get(1).size();
        assertStatus(sizeEnd, Success);
        assertEquals(20, sizeEnd.size);
    } finally {
        newClients.forEach(HotRodTestingUtil::killClient);
    }
}
Also used : TestSizeResponse(org.infinispan.server.hotrod.test.TestSizeResponse) HotRodClient(org.infinispan.server.hotrod.test.HotRodClient) HotRodTestingUtil(org.infinispan.server.hotrod.test.HotRodTestingUtil)

Example 2 with HotRodTestingUtil

use of org.infinispan.server.hotrod.test.HotRodTestingUtil in project infinispan by infinispan.

the class TopologyChangeFunctionalTest method addNewNode.

private void addNewNode() {
    int nextServerPort = findHighestPort().orElseGet(HotRodTestingUtil::serverPort);
    nextServerPort += 50;
    // it waits for view
    HotRodServer server = startClusteredServer(nextServerPort);
    servers().add(server);
    clients().add(createClient(server, cacheName()));
}
Also used : HotRodServer(org.infinispan.server.hotrod.HotRodServer) HotRodTestingUtil(org.infinispan.server.hotrod.test.HotRodTestingUtil)

Aggregations

HotRodTestingUtil (org.infinispan.server.hotrod.test.HotRodTestingUtil)2 HotRodServer (org.infinispan.server.hotrod.HotRodServer)1 HotRodClient (org.infinispan.server.hotrod.test.HotRodClient)1 TestSizeResponse (org.infinispan.server.hotrod.test.TestSizeResponse)1