use of org.apache.ignite.IgniteJdbcThinDataSource in project ignite by apache.
the class JdbcThinDataSourceSelfTest method testUrlCompose.
/**
* @throws Exception If failed.
*/
@Test
public void testUrlCompose() throws Exception {
IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource();
ids.setAddresses("127.0.0.1:" + ClientConnectorConfiguration.DFLT_PORT);
assertEquals("jdbc:ignite:thin://127.0.0.1:10800/PUBLIC", ids.getUrl());
ids.setSchema("test");
assertEquals("jdbc:ignite:thin://127.0.0.1:10800/test", ids.getUrl());
assertEquals("jdbc:ignite:thin://127.0.0.1:10800/test", ids.getURL());
ids.setAddresses("127.0.0.1:" + ClientConnectorConfiguration.DFLT_PORT + ".." + (ClientConnectorConfiguration.DFLT_PORT + 10), "myhost:10801..10802");
ids.setSchema("test2");
assertEquals("jdbc:ignite:thin://127.0.0.1:10800..10810,myhost:10801..10802/test2", ids.getURL());
}
use of org.apache.ignite.IgniteJdbcThinDataSource in project ignite by apache.
the class JdbcThinDataSourceSelfTest method testResetUrl.
/**
* @throws Exception If failed.
*/
@Test
public void testResetUrl() throws Exception {
IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource();
ids.setUrl("jdbc:ignite:thin://127.0.0.1:10800/test?lazy=true");
assertEquals("test", ids.getSchema());
assertTrue(ids.isLazy());
ids.setUrl("jdbc:ignite:thin://mydomain.org,localhost?collocated=true");
assertNull(ids.getSchema());
assertFalse(ids.isLazy());
assertTrue(ids.isCollocated());
}
Aggregations