use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class SqlConnectorConfigurationValidationSelfTest method check.
/**
* Perform check.
*
* @param sqlCfg SQL configuration.
* @param success Success flag. * @throws Exception If failed.
*/
@SuppressWarnings({ "ThrowableResultOfMethodCallIgnored", "unchecked" })
private void check(SqlConnectorConfiguration sqlCfg, boolean success) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration();
cfg.setIgniteInstanceName(SqlConnectorConfigurationValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet());
cfg.setLocalHost("127.0.0.1");
cfg.setSqlConnectorConfiguration(sqlCfg);
cfg.setMarshaller(new BinaryMarshaller());
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(spi);
CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME).setIndexedTypes(SqlConnectorKey.class, SqlConnectorValue.class);
cfg.setCacheConfiguration(ccfg);
if (success)
startGrid(cfg.getIgniteInstanceName(), cfg);
else {
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override
public Void call() throws Exception {
startGrid(cfg.getIgniteInstanceName(), cfg);
return null;
}
}, IgniteException.class, null);
}
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class GridSpiAbstractTest method configureDiscovery.
/**
* @param spiTest SPI test annotation.
* @throws Exception If anything failed.
*/
private void configureDiscovery(GridSpiTest spiTest) throws Exception {
DiscoverySpi discoSpi = spiTest.discoverySpi().newInstance();
if (discoSpi instanceof TcpDiscoverySpi) {
TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi) discoSpi;
tcpDisco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
}
getTestData().setDiscoverySpi(discoSpi);
getTestResources().inject(discoSpi);
configure(discoSpi);
if (discoSpi.getNodeAttributes() != null)
getTestData().getAttributes().putAll(discoSpi.getNodeAttributes());
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class IgfsCacheSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME));
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class HibernateL2CacheStrategySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setCacheConfiguration(cacheConfiguration(ENTITY3_NAME), cacheConfiguration(ENTITY4_NAME), cacheConfiguration("cache1"), cacheConfiguration("cache2"), cacheConfiguration(TIMESTAMP_CACHE), cacheConfiguration(QUERY_CACHE));
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class OdbcConfigurationValidationSelfTest method check.
/**
* Perform check.
*
* @param odbcCfg ODBC configuration.
* @param success Success flag. * @throws Exception If failed.
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private void check(OdbcConfiguration odbcCfg, boolean success) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration();
cfg.setIgniteInstanceName(OdbcConfigurationValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet());
cfg.setLocalHost("127.0.0.1");
cfg.setOdbcConfiguration(odbcCfg);
cfg.setMarshaller(new BinaryMarshaller());
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(spi);
if (success)
startGrid(cfg.getIgniteInstanceName(), cfg);
else {
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override
public Void call() throws Exception {
startGrid(cfg.getIgniteInstanceName(), cfg);
return null;
}
}, IgniteException.class, null);
}
}
Aggregations