Search in sources :

Example 31 with TreeNode

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();
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 32 with TreeNode

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());
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 33 with TreeNode

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());
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 34 with TreeNode

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");
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 35 with TreeNode

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");
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Aggregations

TreeNode (com.cubrid.cubridmanager.core.common.socket.TreeNode)142 ArrayList (java.util.ArrayList)20 HashMap (java.util.HashMap)7 Map (java.util.Map)6 Trigger (com.cubrid.common.core.common.model.Trigger)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)2 DbBackupInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DbBackupInfo)2 DbUnloadInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DbUnloadInfo)2 DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)2 GetExecuteCasRunnerResultInfo (com.cubrid.cubridmanager.core.logs.model.GetExecuteCasRunnerResultInfo)2 ManagerLogInfoList (com.cubrid.cubridmanager.core.logs.model.ManagerLogInfoList)2 ManagerLogInfos (com.cubrid.cubridmanager.core.logs.model.ManagerLogInfos)2 DbProcessStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.DbProcessStatusInfo)2 HADatabaseStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HADatabaseStatusInfo)2 HAHostStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HAHostStatusInfo)2 ReplicationInfo (com.cubrid.cubridmanager.core.replication.model.ReplicationInfo)2 ReplicationParamInfo (com.cubrid.cubridmanager.core.replication.model.ReplicationParamInfo)2 TransFileProgressInfo (com.cubrid.cubridmanager.core.replication.model.TransFileProgressInfo)2 CasAuthType (com.cubrid.cubridmanager.core.common.model.CasAuthType)1