use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
the class ChangeStateCommandHandlerTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
GridClientConfiguration cfg = new GridClientConfiguration();
cfg.setProtocol(TCP);
cfg.setServers(Collections.singletonList("localhost:" + BINARY_PORT));
client = GridClientFactory.start(cfg);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project gridgain by gridgain.
the class RestProcessorStartSelfTest method testTcpStart.
/**
* @throws Exception If failed.
*/
@Test
public void testTcpStart() throws Exception {
GridClientConfiguration clCfg = new GridClientConfiguration();
clCfg.setProtocol(GridClientProtocol.TCP);
clCfg.setServers(Collections.singleton(HOST + ":" + TCP_PORT));
doTest(clCfg);
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientTcpSslDirectMultiNodeSelfTest method clientConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected GridClientConfiguration clientConfiguration() throws GridClientException {
assert NODES_CNT > 3 : "Too few nodes to execute direct multinode test";
GridClientConfiguration cfg = super.clientConfiguration();
cfg.setServers(Collections.<String>emptySet());
Collection<String> srvs = new ArrayList<>(3);
for (int i = 0; i < NODES_CNT / 2; i++) srvs.add(HOST + ':' + (REST_TCP_PORT_BASE + i));
cfg.setRouters(srvs);
return cfg;
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientFailedInitSelfTest method testRoutersAndServersAddressesProvided.
/**
*/
@Test
public void testRoutersAndServersAddressesProvided() {
try {
GridClientConfiguration c = new GridClientConfiguration();
c.setRouters(Collections.singleton("127.0.0.1:10000"));
c.setServers(Collections.singleton("127.0.0.1:10000"));
GridClientFactory.start(c);
assert false;
} catch (GridClientException e) {
info("Caught expected exception: " + e);
}
}
use of org.apache.ignite.internal.client.GridClientConfiguration in project ignite by apache.
the class ClientPreferDirectSelfTest method client.
/**
* @param b Balancer.
* @return Client.
* @throws Exception If failed.
*/
private GridClient client(GridClientLoadBalancer b) throws Exception {
GridClientConfiguration cfg = new GridClientConfiguration();
cfg.setBalancer(b);
cfg.setTopologyRefreshFrequency(TOP_REFRESH_FREQ);
Collection<String> rtrs = new ArrayList<>(3);
for (int i = 0; i < NODES_CNT / 2; i++) rtrs.add(HOST + ':' + (REST_TCP_PORT_BASE + i));
cfg.setRouters(rtrs);
return GridClientFactory.start(cfg);
}
Aggregations