use of org.apache.ignite.logger.java.JavaLogger in project ignite by apache.
the class GridStartupWithUndefinedIgniteHomeSelfTest method testStartStopWithUndefinedIgniteHome.
/**
* @throws Exception If failed.
*/
public void testStartStopWithUndefinedIgniteHome() throws Exception {
IgniteUtils.nullifyHomeDirectory();
// We can't use U.getIgniteHome() here because
// it will initialize cached value which is forbidden to override.
String igniteHome = IgniteSystemProperties.getString(IGNITE_HOME);
assert igniteHome != null;
U.setIgniteHome(null);
String igniteHome0 = U.getIgniteHome();
assert igniteHome0 == null;
IgniteLogger log = new JavaLogger();
log.info(">>> Test started: " + getName());
log.info("Grid start-stop test count: " + GRID_COUNT);
for (int i = 0; i < GRID_COUNT; i++) {
TcpDiscoverySpi disc = new TcpDiscoverySpi();
disc.setIpFinder(IP_FINDER);
IgniteConfiguration cfg = new IgniteConfiguration();
// Default console logger is used
cfg.setGridLogger(log);
cfg.setDiscoverySpi(disc);
cfg.setConnectorConfiguration(null);
try (Ignite ignite = G.start(cfg)) {
assert ignite != null;
igniteHome0 = U.getIgniteHome();
assert igniteHome0 == null;
X.println("Stopping grid " + ignite.cluster().localNode().id());
}
}
}
Aggregations