Search in sources :

Example 6 with DefaultResultCallback

use of com.ctrip.platform.dal.dao.helper.DefaultResultCallback in project dal by ctripcorp.

the class BaseDalTableDaoShardByDbTableTest method assertFail.

private void assertFail(Object model, DalHints hints) {
    assertNull(model);
    DefaultResultCallback callback = (DefaultResultCallback) hints.get(DalHintEnum.resultCallback);
    try {
        callback.waitForDone();
    } catch (InterruptedException e) {
        fail(e.toString());
    }
    assertTrue(!callback.isSuccess());
}
Also used : DefaultResultCallback(com.ctrip.platform.dal.dao.helper.DefaultResultCallback)

Example 7 with DefaultResultCallback

use of com.ctrip.platform.dal.dao.helper.DefaultResultCallback in project dal by ctripcorp.

the class BaseDalTableDaoShardByDbTableTest method assertFail.

private void assertFail(int res, DalHints hints) {
    assertEquals(0, res);
    DefaultResultCallback callback = (DefaultResultCallback) hints.get(DalHintEnum.resultCallback);
    try {
        callback.waitForDone();
    } catch (InterruptedException e) {
        fail(e.toString());
    }
    assertTrue(!callback.isSuccess());
}
Also used : DefaultResultCallback(com.ctrip.platform.dal.dao.helper.DefaultResultCallback)

Aggregations

DefaultResultCallback (com.ctrip.platform.dal.dao.helper.DefaultResultCallback)7 DalHints (com.ctrip.platform.dal.dao.DalHints)5 Test (org.junit.Test)4 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)3 SQLException (java.sql.SQLException)2 DalRequestExecutor (com.ctrip.platform.dal.dao.task.DalRequestExecutor)1 ArrayList (java.util.ArrayList)1 ExecutionException (java.util.concurrent.ExecutionException)1