use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.
the class DhtAndNearEvictionTest method beforeTest.
/**
*/
@Override
protected void beforeTest() throws Exception {
super.beforeTest();
strLog = new GridStringLogger(false, log);
strLog.logLength(1024 * 1024);
}
use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.
the class IgniteDevOnlyLogTest method testDevOnlyDisabledProperty.
/**
* Check that {@link IgniteUtils#warnDevOnly(IgniteLogger, Object)}
* doesn't print anything if {@link org.apache.ignite.IgniteSystemProperties#IGNITE_DEV_ONLY_LOGGING_DISABLED}
* is set to {@code true}.
*/
@Test
public void testDevOnlyDisabledProperty() throws Exception {
additionalArgs = Collections.singletonList("-D" + IgniteSystemProperties.IGNITE_DEV_ONLY_LOGGING_DISABLED + "=true");
log = new GridStringLogger(false, grid(0).log());
Ignite ignite = startGrid(1);
String msg = getMessage(ignite);
warnDevOnly(msg);
assertFalse(log.toString().contains(msg));
}
use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.
the class ContinuousQueryRemoteFilterMissingInClassPathSelfTest method testServerJoinsExtClassLoaderNoException.
/**
* @throws Exception If fail.
*/
@Test
public void testServerJoinsExtClassLoaderNoException() throws Exception {
setExternalLoader = true;
Ignite ignite0 = startGrid(1);
executeContinuousQuery(ignite0.cache(DEFAULT_CACHE_NAME));
log = new GridStringLogger();
startGrid(2);
assertTrue(!log.toString().contains("class org.apache.ignite.IgniteCheckedException: " + "Failed to find class with given class loader for unmarshalling"));
}
use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.
the class ContinuousQueryRemoteFilterMissingInClassPathSelfTest method testClientJoinsMissingClassWarning.
/**
* @throws Exception If fail.
*/
@Test
public void testClientJoinsMissingClassWarning() throws Exception {
setExternalLoader = true;
Ignite ignite0 = startGrid(1);
executeContinuousQuery(ignite0.cache(DEFAULT_CACHE_NAME));
log = new GridStringLogger();
setExternalLoader = false;
startClientGrid(2);
String logStr = log.toString();
assertTrue(logStr.contains("Failed to unmarshal continuous query remote filter on client node. " + "Can be ignored.") || logStr.contains("Failed to unmarshal continuous routine handler"));
}
use of org.apache.ignite.testframework.GridStringLogger in project ignite by apache.
the class IgniteDiagnosticMessagesTest method testRemoteTx.
/**
* @throws Exception If failed.
*/
public void testRemoteTx() throws Exception {
int timeout = 3500;
System.setProperty(IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT, String.valueOf(timeout));
try {
testSpi = true;
startGrid(0);
GridStringLogger strLog = this.strLog = new GridStringLogger();
strLog.logLength(1024 * 100);
startGrid(1);
awaitPartitionMapExchange();
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setCacheMode(PARTITIONED);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setBackups(1);
ccfg.setNearConfiguration(new NearCacheConfiguration());
final Ignite node0 = ignite(0);
final Ignite node1 = ignite(1);
node0.createCache(ccfg);
UUID id0 = node0.cluster().localNode().id();
TestRecordingCommunicationSpi.spi(node0).blockMessages(GridDhtTxPrepareResponse.class, node1.name());
int txCnt = 4;
final List<Integer> keys = primaryKeys(node1.cache(DEFAULT_CACHE_NAME), txCnt, 0);
final AtomicInteger idx = new AtomicInteger();
IgniteInternalFuture<Long> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
@Override
public Void call() throws Exception {
IgniteCache<Object, Object> cache = node1.cache(DEFAULT_CACHE_NAME);
try (Transaction tx = node1.transactions().txStart()) {
Integer key = keys.get(idx.getAndIncrement());
cache.getAndPut(key, "new-" + key);
tx.commit();
}
return null;
}
}, txCnt, "tx");
U.sleep(timeout * 2);
assertFalse(fut.isDone());
TestRecordingCommunicationSpi.spi(node0).stopBlock();
fut.get();
String log = strLog.toString();
assertTrue(log.contains("Related transactions ["));
assertTrue(log.contains("General node info [id=" + id0));
} finally {
System.clearProperty(IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT);
}
}
Aggregations