Search in sources :

Example 1 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class DeleteBrokerTaskTest method testReceive.

//test receive
public void testReceive() throws Exception {
    //normal case 
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/broker/task/test.message/deletebroker_receive.txt");
    String msg = Tool.getFileContent(filepath);
    DeleteBrokerTask task = new DeleteBrokerTask(serverInfo);
    TreeNode node = MessageUtil.parseResponse(msg);
    task.setResponse(node);
    boolean success = task.isSuccess();
    assertTrue(success);
    assertEquals(task.getNote(), "none");
    //exception case
    filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/broker/task/test.message/deletebrokerFailure_receive.txt");
    msg = Tool.getFileContent(filepath);
    node = MessageUtil.parseResponse(msg);
    task.setResponse(node);
    boolean failure = task.isSuccess();
    assertFalse(failure);
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 2 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class GetBrokerConfParameterTaskTest method testGetContents.

public void testGetContents() throws Exception {
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/broker/task/test.message/getbrokerconfpara_receive");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    GetBrokerConfParameterTask task = new GetBrokerConfParameterTask(serverInfo);
    task.setResponse(node);
    task.getConfContents();
    assertEquals("success", node.getValue("status"));
    task.setResponse(null);
    List<String> list = task.getConfContents();
    assertNull(list);
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 3 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class AddCMUserTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/common/task/test.message/addcmuser_receive");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    //compare 
    assertEquals("success", node.getValue("status"));
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 4 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class StartBrokerTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/broker/task/test.message/startbrokerenv_receive.txt");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    StartBrokerEnvTask task = new StartBrokerEnvTask(serverInfo);
    task.setResponse(node);
    //compare 
    assertEquals(task.getNote(), "none");
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 5 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class StopSingleBrokerTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/broker/task/test.message/stopbroker_receive.txt");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    //compare 
    assertEquals("success", node.getValue("status"));
}
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