use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.
the class FunctionsSupportedInfoProviderTest method testIsSupportCMServer.
/**
* Test method for
* {@link com.cubrid.common.core.util.CompatibleUtil#isSupportCMServer(com.cubrid.cubridmanager.core.common.model.ServerInfo, java.lang.String)}
* .
*/
public void testIsSupportCMServer() {
EnvInfo envInfo = new EnvInfo();
envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.2.1150)");
ServerInfo serverInfo = new ServerInfo();
serverInfo.setConnected(true);
serverInfo.setEnvInfo(envInfo);
boolean support = CompatibleUtil.isSupportCMServer(serverInfo, "8.2.0");
assertFalse(support);
}
use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.
the class GetEnvInfoTask method loadEnvInfo.
/**
*
* Load CUBRID Server environment information
*
* @return EnvInfo The instance of EnvInfo
*/
public EnvInfo loadEnvInfo() {
TreeNode response = getResponse();
if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
if (this.getErrorMsg() == null || getErrorMsg().trim().length() <= 0) {
errorMsg = Messages.error_invalidRequest;
}
return null;
}
String rootDir = response.getValue("CUBRID");
String databaseDir = response.getValue("CUBRID_DATABASES");
String cmServerDir = response.getValue("CUBRID_DBMT");
String serverVersion = response.getValue("CUBRIDVER");
String brokerVersion = response.getValue("BROKERVER");
int i = 0;
List<String> hostMonTabStatusList = new ArrayList<String>();
while (true) {
String value = response.getValue("HOSTMONTAB" + i);
if (value == null) {
break;
} else if (value.trim().equals("ON") || value.trim().equals("OFF")) {
hostMonTabStatusList.add(value.trim());
} else {
break;
}
i++;
}
String osInfo = response.getValue("osinfo");
EnvInfo envInfo = new EnvInfo();
envInfo.setRootDir(rootDir);
envInfo.setDatabaseDir(databaseDir);
envInfo.setCmServerDir(cmServerDir);
envInfo.setServerVersion(serverVersion);
envInfo.setBrokerVersion(brokerVersion);
envInfo.setOsInfo(osInfo);
int size = hostMonTabStatusList.size();
String[] hostMonTabArr = new String[size];
envInfo.setHostMonTabStatus(hostMonTabStatusList.toArray(hostMonTabArr));
return envInfo;
}
use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.
the class FunctionsSupportedInfoProviderTest method testgetHAModeValue.
/**
* Test method for
* {@link com.cubrid.common.core.util.CompatibleUtil#getHAModeValue(ServerInfo)
* )} .
*/
public void testgetHAModeValue() {
EnvInfo envInfo = new EnvInfo();
envInfo.setServerVersion("CUBRID 2008 R2.0(8.3.0.1150)");
ServerInfo serverInfo = new ServerInfo();
serverInfo.setConnected(true);
serverInfo.setEnvInfo(envInfo);
String mode = CompatibleUtil.getHAModeValue(serverInfo);
assertEquals(mode, "string(on|off|yes|no)");
envInfo.setServerVersion("CUBRID 2008 R2.0(8.4.0.1150)");
envInfo.setOsInfo(FileUtil.OsInfoType.LINUX.toString());
mode = CompatibleUtil.getHAModeValue(serverInfo);
assertEquals(mode, "string(on|off|yes|no|replica)");
}
use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.
the class FunctionsSupportedInfoProviderTest method testIsQueryOrTransTimeUseMs.
/**
* Test method for
* {@link com.cubrid.common.core.util.CompatibleUtil#isQueryOrTransTimeUseMs(com.cubrid.cubridmanager.core.common.model.ServerInfo)}
* .
*/
public void testIsQueryOrTransTimeUseMs() {
EnvInfo envInfo = new EnvInfo();
envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.0.1150)");
ServerInfo serverInfo = new ServerInfo();
serverInfo.setConnected(true);
serverInfo.setEnvInfo(envInfo);
boolean support = CompatibleUtil.isQueryOrTransTimeUseMs(serverInfo);
assertFalse(support);
envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.2.1150)");
support = CompatibleUtil.isQueryOrTransTimeUseMs(serverInfo);
assertTrue(support);
}
use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.
the class FunctionsSupportedInfoProviderTest method testIsSupportBrokerPort.
/**
* Test method for
* {@link com.cubrid.common.core.util.CompatibleUtil#isSupportBrokerPort(com.cubrid.cubridmanager.core.common.model.ServerInfo)}
* .
*/
public void testIsSupportBrokerPort() {
EnvInfo envInfo = new EnvInfo();
envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.0.1150)");
ServerInfo serverInfo = new ServerInfo();
serverInfo.setConnected(true);
serverInfo.setEnvInfo(envInfo);
boolean support = CompatibleUtil.isSupportBrokerPort(serverInfo);
assertFalse(support);
envInfo.setServerVersion("CUBRID 2008 R2.0(8.3.2.1150)");
envInfo.setOsInfo(FileUtil.OsInfoType.NT.toString());
support = CompatibleUtil.isSupportBrokerPort(serverInfo);
assertTrue(support);
support = CompatibleUtil.isSupportBrokerPort(null);
assertFalse(support);
}
Aggregations