use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class PlanDumpTaskTest method testReceive.
public void testReceive() throws Exception {
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/cubrid/database/task/test.message/plandump_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
PlanDumpTask task = new PlanDumpTask(serverInfo);
task.setResponse(node);
task.getContent();
task.setErrorMsg("err");
task.getContent();
task.setResponse(null);
task.getContent();
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class RenameDbTaskTest method testReceive.
public void testReceive() throws Exception {
if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
return;
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/cubrid/database/task/test.message/renamedb_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
RenameDbTask task = new RenameDbTask(serverInfo);
task.setResponse(node);
assertTrue(task.isSuccess());
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetDbModeTaskTest method testReceive.
public void testReceive() throws Exception {
if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
return;
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/mondashboard/task/test.message/GetDbMode_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
GetDbModeTask task = new GetDbModeTask(serverInfo);
task.setResponse(node);
assertNotNull(task.getDbModes());
TreeNode child = new TreeNode();
child.add("open", "dbserver");
child.add("server_msg", "error");
node.addChild(child);
assertNotNull(task.getDbModes());
TreeNode child1 = new TreeNode();
node.addChild(child1);
//compare
assertEquals(task.getDbModes().size(), 3);
task.setErrorMsg("error");
assertNull(task.getDbModes());
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetHeartbeatNodeInfoTaskTest method testReceive.
public void testReceive() throws Exception {
if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
return;
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/mondashboard/task/test.message/GetHeartbeatNodeInfoTask_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
GetHeartbeatNodeInfoTask task = new GetHeartbeatNodeInfoTask(serverInfo);
task.setResponse(node);
//compare
assertTrue(task.getHostStatusInfo("192.168.1.222") != null);
assertTrue(task.getDatabaseStatusInfo("haha") == null);
assertTrue(task.getHAHostStatusList().size() > 0);
task.setErrorMsg("error");
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class HARoleChangeTaskTest method testReceive.
public void testReceive() throws Exception {
if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
return;
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/mondashboard/task/test.message/HARoleChange_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
HARoleChangeTask task = new HARoleChangeTask(serverInfo);
task.setResponse(node);
//compare
task.setErrorMsg("error");
}
Aggregations