use of com.cubrid.cubridmanager.core.common.socket.ClientSocket in project cubrid-manager by CUBRID.
the class TestRawScript method execute.
public static void execute(String aFilename) {
String basepath = TestRawScript.class.getResource(".").getPath() + "scripts/";
String filename = basepath + aFilename;
String message = MockTaskServer.getFileText(new File(filename));
ClientSocket clientSocket = new ClientSocket(serverInfo.getHostAddress(), serverInfo.getHostJSPort(), serverInfo.getUserName());
clientSocket.setUsingSpecialDelimiter(false);
clientSocket.sendRequest(message);
clientSocket.tearDownConnection();
String errorMsg = clientSocket.getErrorMsg();
if (errorMsg != null)
System.out.println("ERROR MSG:" + errorMsg);
String warningMsg = clientSocket.getWarningMsg();
if (warningMsg != null)
System.out.println("WARN MSG:" + warningMsg);
}
use of com.cubrid.cubridmanager.core.common.socket.ClientSocket in project cubrid-manager by CUBRID.
the class TestTask method main.
/**
* TODO: how to write comments What and why the member function does what it
* does What a member function must be passed as parameters What a member
* function re turns Known bugs Any exceptions that a member function throws
* Visibility decisions How a member function changes the object Include a
* history of any code changes Examples of how to invoke th e member
* function if appropriate Applicable preconditions and postconditions
* Document all concurrency
*
* @param args
*/
public static void main(String[] args) {
ClientSocket hostsocket = new ClientSocket("localhost", 8001, "admin");
String message = "id:admin\npassword:1111\n" + "clientver:8.1.4\n\n";
// send login message
hostsocket.sendRequest(message);
// get the latest token
TreeNode node = hostsocket.getResponse();
String token = node.getValue("token");
System.out.println(token);
}
Aggregations