use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class P2PUnsupportedClassVersionTest method beforeTestsStarted.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
lsnrLog = new ListeningTestLogger(false, log);
srv = startGrid("server");
cli = startClientGrid("client");
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class SqlMergeTest method testCheckKeysWarning.
/**
*/
@Test
public void testCheckKeysWarning() throws Exception {
LogListener logLsnr = LogListener.matches("The search row by explicit KEY isn't supported. The primary key is always used to search row").build();
ListeningTestLogger listeningTestLogger = testLog();
listeningTestLogger.registerListener(logLsnr);
sql("CREATE TABLE test2 (id INT, id2 INT, name VARCHAR, PRIMARY KEY (id, id2))");
checkMergeQuery("MERGE INTO test2 (id, id2, name) KEY(_key) VALUES (100, 1, 'Bob')", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 100", Arrays.asList(100, 1, "Bob"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (id2, id, name) KEY(_key) VALUES (2, 100, 'Alice')", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 100 AND id2 = 2", Arrays.asList(100, 2, "Alice"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (id, id2, name) KEY(id, id2) VALUES (3, 5, 'Stan')", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 3", Arrays.asList(3, 5, "Stan"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (id, id2, name) KEY(id2, id) VALUES (1, 100, 'Satan')", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 1", Arrays.asList(1, 100, "Satan"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (id2, id, name) KEY(id) VALUES (15, 32, 'Kyle')", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 32", Arrays.asList(32, 15, "Kyle"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (name, id, id2) KEY(id2) VALUES ('Morlock', 13, 12)", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 13", Arrays.asList(13, 12, "Morlock"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (id, name, id2) KEY(_key, id) VALUES (10, 'Warlock', 52)", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 10", Arrays.asList(10, 52, "Warlock"));
assertTrue(logLsnr.check());
logLsnr.reset();
checkMergeQuery("MERGE INTO test2 (id, id2, name) KEY(name) VALUES (10, -11, 'Sherlock')", 1L);
checkSqlResults("SELECT id, id2, name FROM test2 WHERE id = 10 and id2=-11", Arrays.asList(10, -11, "Sherlock"));
assertTrue(logLsnr.check());
logLsnr.reset();
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class IgniteQueryDedicatedPoolTest method beforeTestsStarted.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
testLog = new ListeningTestLogger(false, log);
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class GridTcpCommunicationInverseConnectionEstablishingTest method executeCacheTestWithUnreachableClient.
/**
* Executes cache test with "unreachable" client.
*
* @param forceClientToSrvConnections Flag for the client mode.
* @throws Exception If failed.
*/
private void executeCacheTestWithUnreachableClient(boolean forceClientToSrvConnections) throws Exception {
LogListener lsnr = LogListener.matches("Failed to send message to remote node").atMost(0).build();
for (int i = 0; i < SRVS_NUM; i++) {
ccfg = cacheConfiguration(CACHE_NAME, ATOMIC);
startGrid(i, (UnaryOperator<IgniteConfiguration>) cfg -> {
ListeningTestLogger log = new ListeningTestLogger(false, cfg.getGridLogger());
log.registerListener(lsnr);
return cfg.setGridLogger(log);
});
}
this.forceClientToSrvConnections = forceClientToSrvConnections;
startClientGrid(SRVS_NUM);
putAndCheckKey();
assertTrue(lsnr.check());
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class TcpDiscoveryMetricsWarnLogTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
super.beforeTest();
testLog = new ListeningTestLogger(false, log);
}
Aggregations