use of org.apache.ignite.client.IgniteClient in project ignite by apache.
the class BinaryArraySelfTest method testBinaryModeArray.
/**
*/
@Test
public void testBinaryModeArray() {
putInBinaryGetRegular(srvCache);
putInBinaryGetRegular(cliCache);
try (IgniteClient thinClient = thinClient()) {
putInBinaryGetRegular(new ClientCacheAdapter<>(thinClient.getOrCreateCache(DEFAULT_CACHE_NAME)));
}
}
use of org.apache.ignite.client.IgniteClient in project ignite by apache.
the class BinaryArraySelfTest method testArrayFieldInKey.
/**
*/
@Test
public void testArrayFieldInKey() {
doTestKeys(srvCache, TO_TEST_CLS);
doTestKeys(cliCache, TO_TEST_CLS);
try (IgniteClient thinClient = thinClient()) {
doTestKeys(new ClientCacheAdapter<>(thinClient.getOrCreateCache(DEFAULT_CACHE_NAME)), TO_TEST_CLS);
}
}
use of org.apache.ignite.client.IgniteClient in project ignite by apache.
the class ClientListenerMetricsTest method testClientListenerMetricsAccept.
/**
* Check that valid connections and disconnections to the grid affect metrics.
*/
@Test
public void testClientListenerMetricsAccept() throws Exception {
try (IgniteEx ignite = startGrid(0)) {
MetricRegistry mreg = ignite.context().metric().registry(CLIENT_CONNECTOR_METRICS);
checkConnectionsMetrics(mreg, 0, 0);
IgniteClient client0 = Ignition.startClient(getClientConfiguration());
checkConnectionsMetrics(mreg, 1, 1);
client0.close();
checkConnectionsMetrics(mreg, 1, 0);
IgniteClient client1 = Ignition.startClient(getClientConfiguration());
checkConnectionsMetrics(mreg, 2, 1);
IgniteClient client2 = Ignition.startClient(getClientConfiguration());
checkConnectionsMetrics(mreg, 3, 2);
client1.close();
checkConnectionsMetrics(mreg, 3, 1);
client2.close();
checkConnectionsMetrics(mreg, 3, 0);
}
}
use of org.apache.ignite.client.IgniteClient in project ignite by apache.
the class ClusterApiTest method testWalState.
/**
* Test change WAL state for cache operation by thin client.
*/
@Test
public void testWalState() throws Exception {
try (IgniteClient client = startClient(0)) {
ClientCluster clientCluster = client.cluster();
IgniteCluster igniteCluster = grid(0).cluster();
igniteCluster.state(ClusterState.ACTIVE);
grid(0).getOrCreateCache(DEFAULT_CACHE_NAME);
igniteCluster.disableWal(DEFAULT_CACHE_NAME);
// Check enable WAL operation.
assertTrue(clientCluster.enableWal(DEFAULT_CACHE_NAME));
assertTrue(clientCluster.isWalEnabled(DEFAULT_CACHE_NAME));
assertTrue(igniteCluster.isWalEnabled(DEFAULT_CACHE_NAME));
// Check enable WAL operation on already enabled WAL.
assertFalse(clientCluster.enableWal(DEFAULT_CACHE_NAME));
assertTrue(clientCluster.isWalEnabled(DEFAULT_CACHE_NAME));
assertTrue(igniteCluster.isWalEnabled(DEFAULT_CACHE_NAME));
// Check disable WAL operation.
assertTrue(clientCluster.disableWal(DEFAULT_CACHE_NAME));
assertFalse(clientCluster.isWalEnabled(DEFAULT_CACHE_NAME));
assertFalse(igniteCluster.isWalEnabled(DEFAULT_CACHE_NAME));
// Check disable WAL operation on already disabled WAL.
assertFalse(clientCluster.disableWal(DEFAULT_CACHE_NAME));
assertFalse(clientCluster.isWalEnabled(DEFAULT_CACHE_NAME));
assertFalse(igniteCluster.isWalEnabled(DEFAULT_CACHE_NAME));
}
}
use of org.apache.ignite.client.IgniteClient in project ignite by apache.
the class ComputeTaskTest method testExecuteWithCustomUserType.
/**
* Test that custom user type can be returned by task.
*/
@Test
public void testExecuteWithCustomUserType() throws Exception {
try (IgniteClient client = startClient(0)) {
Person val = client.compute().execute(TestTaskCustomType.class.getName(), "person");
assertEquals("person", val.getName());
}
}
Aggregations