use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class SqlListenerProcessorValidationSelfTest 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(SqlListenerProcessorValidationSelfTest.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.getGridName(), cfg);
else {
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override
public Void call() throws Exception {
startGrid(cfg.getGridName(), cfg);
return null;
}
}, IgniteException.class, null);
}
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class MemoryPolicyInitializationTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setMemoryConfiguration(memCfg);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class GridCacheAtomicLateAffDisabledMultiNodeFullApiSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setLateAffinityAssignment(false);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class IgniteCacheP2pUnmarshallingTxErrorTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setLateAffinityAssignment(false);
if (!igniteInstanceName.endsWith("0"))
// Allows to check GridDhtLockRequest fail.
cfg.getCacheConfiguration()[0].setRebalanceDelay(-1);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class GridLog4j2InitializedTest method testLogInitialize.
/** */
public void testLogInitialize() {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("grid" + 1);
cfg.setNodeId(new UUID(1, 1));
// cfg.setIgniteHome("/home/glutters/Documenti/apache-ignite/ignite-master/ignite/");
URL xml = U.resolveIgniteUrl("config/ignite-log4j2.xml");
IgniteLogger log;
try {
log = new Log4J2Logger(xml);
// log.isQuiet();
cfg.setGridLogger(log);
} catch (IgniteCheckedException e) {
e.printStackTrace();
return;
}
assert log.isInfoEnabled() == true;
if (log.isDebugEnabled())
log.debug("This is 'debug' message.");
log.info("This is 'info' message.");
log.warning("This is 'warning' message.");
log.warning("This is 'warning' message.", new Exception("It's a test warning exception"));
log.error("This is 'error' message.");
assert log.getLogger(GridLog4j2InitializedTest.class.getName()) instanceof Log4J2Logger;
}
Aggregations