Search in sources :

Example 1 with TestSizeResponse

use of org.infinispan.server.hotrod.test.TestSizeResponse 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 TestSizeResponse

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

the class HotRodFunctionalTest method testSize.

public void testSize(Method m) {
    TestSizeResponse sizeStart = client().size();
    assertStatus(sizeStart, Success);
    assertEquals(0, sizeStart.size);
    for (int i = 0; i < 20; i++) {
        client().assertPut(m, "k-" + i, "v-" + i);
    }
    TestSizeResponse sizeEnd = client().size();
    assertStatus(sizeEnd, Success);
    assertEquals(20, sizeEnd.size);
}
Also used : TestSizeResponse(org.infinispan.server.hotrod.test.TestSizeResponse)

Example 3 with TestSizeResponse

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

the class HotRodReplicationTest 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 = "repl-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(HotRodClient::stop);
    }
}
Also used : TestSizeResponse(org.infinispan.server.hotrod.test.TestSizeResponse) HotRodClient(org.infinispan.server.hotrod.test.HotRodClient)

Example 4 with TestSizeResponse

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

the class HotRodWithStoreTest method testSize.

public void testSize(Method m) {
    TestSizeResponse sizeStart = client().size();
    assertStatus(sizeStart, Success);
    assertEquals(0, sizeStart.size);
    for (int i = 0; i < 20; i++) client().assertPut(m, "k-" + i, "v-" + i);
    // Clear contents from memory
    advancedCache.withFlags(Flag.SKIP_CACHE_STORE).clear();
    TestSizeResponse sizeEnd = client().size();
    assertStatus(sizeEnd, Success);
    assertEquals(20, sizeEnd.size);
}
Also used : TestSizeResponse(org.infinispan.server.hotrod.test.TestSizeResponse)

Aggregations

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