use of com.cubrid.cubridmanager.core.cubrid.database.model.lock.DatabaseLockInfo in project cubrid-manager by CUBRID.
the class LockDbTaskTest method testLockDbNoLock.
public void testLockDbNoLock() {
if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "n"))
return;
System.out.println("<database.lockdb.001.req.txt>");
CommonQueryTask<DatabaseLockInfo> task = new CommonQueryTask<DatabaseLockInfo>(ServerManager.getInstance().getServer(host, monport, userName), CommonSendMsg.getCommonDatabaseSendMsg(), new DatabaseLockInfo());
task.setDbName("unlockeddb");
task.execute();
assertTrue(task.isSuccess());
assertNull(task.getErrorMsg());
DatabaseLockInfo dli = task.getResultModel();
assertNotNull(dli);
assertEquals("lockdb", dli.getTaskName());
LockInfo li = dli.getLockInfo();
assertNotNull(li);
assertEquals(1, li.getDinterval());
assertEquals(100000, li.getEsc());
List<DatabaseTransaction> dtList = li.getTransaction();
assertNotNull(dtList);
assertEquals(2, dtList.size());
DatabaseTransaction dt = dtList.get(0);
assertEquals(0, dt.getIndex());
assertEquals("(unknown)", dt.getPname());
assertEquals("(unknown)", dt.getUid());
assertEquals("(unknown)", dt.getHost());
assertEquals("-1", dt.getPid());
assertEquals("REPEATABLE CLASSES AND READ UNCOMMITTED INSTANCES", dt.getIsolevel());
assertEquals(-1, dt.getTimeout());
dt = dtList.get(1);
assertEquals(1, dt.getIndex());
assertEquals("lockdb", dt.getPname());
assertEquals("dba", dt.getUid());
assertEquals("localhost.localdomain", dt.getHost());
assertEquals("5334", dt.getPid());
assertEquals("READ COMMITTED CLASSES AND READ UNCOMMITTED INSTANCES", dt.getIsolevel());
assertEquals(-2, dt.getTimeout());
DbLotInfo dbLotInfo = li.getDbLotInfo();
assertNotNull(dbLotInfo);
assertEquals(0, dbLotInfo.getNumlocked());
assertEquals(10000, dbLotInfo.getMaxnumlock());
assertNotNull(dbLotInfo.getDbLotEntryList());
assertEquals(0, dbLotInfo.getDbLotEntryList().size());
}
Aggregations