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);
}
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);
}
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"));
}
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");
}
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"));
}
Aggregations