Search in sources :

Example 1 with AppDesc

use of com.sohu.cache.entity.AppDesc in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckWrongFormatAppInstanceInfo5.

/**
     * 应用实例详情格式有问题5
     */
@Test
public void testCheckWrongFormatAppInstanceInfo5() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu5");
    // 实例信息
    String appInstanceInfo = "10.10.53.162:ab:1024";
    ImportAppResult importAppResult = importAppCenter.check(appDesc, appInstanceInfo);
    logger.info("importAppResult: {}", importAppResult);
}
Also used : ImportAppResult(com.sohu.cache.constant.ImportAppResult) AppDesc(com.sohu.cache.entity.AppDesc) BaseTest(com.sohu.test.BaseTest) Test(org.junit.Test)

Example 2 with AppDesc

use of com.sohu.cache.entity.AppDesc in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckNotRunInstance.

/**
     * 已经存在实例信息
     */
@Test
public void testCheckNotRunInstance() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu7");
    // 实例信息
    String appInstanceInfo = "10.10.53.162:6399:1024";
    ImportAppResult importAppResult = importAppCenter.check(appDesc, appInstanceInfo);
    logger.info("importAppResult: {}", importAppResult);
}
Also used : ImportAppResult(com.sohu.cache.constant.ImportAppResult) AppDesc(com.sohu.cache.entity.AppDesc) BaseTest(com.sohu.test.BaseTest) Test(org.junit.Test)

Example 3 with AppDesc

use of com.sohu.cache.entity.AppDesc in project cachecloud by sohutv.

the class ImportAppCenterTest method testImport.

@Test
public void testImport() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("my-old-sentinel");
    appDesc.setIntro("my-old-sentinel desc");
    appDesc.setOfficer("付磊");
    appDesc.setCreateTime(new Date());
    appDesc.setPassedTime(new Date());
    appDesc.setIsTest(1);
    appDesc.setType(ConstUtils.CACHE_TYPE_REDIS_CLUSTER);
    appDesc.setMemAlertValue(80);
    appDesc.setStatus(2);
    appDesc.setUserId(1);
    appDesc.setVerId(1);
    // 实例信息
    String appInstanceInfo = "10.10.53.159:7000:512\n" + "10.10.53.159:7001:512\n" + "10.10.53.159:26379:mymaster\n" + "10.10.53.159:26380:mymaster\n" + "10.10.53.159:26381:mymaster";
    boolean result = importAppCenter.importAppAndInstance(appDesc, appInstanceInfo);
    logger.info("result: {}", result);
}
Also used : AppDesc(com.sohu.cache.entity.AppDesc) Date(java.util.Date) BaseTest(com.sohu.test.BaseTest) Test(org.junit.Test)

Example 4 with AppDesc

use of com.sohu.cache.entity.AppDesc in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckSentinelAllNodes.

/**
     * 检测sentinel节点
     */
@Test
public void testCheckSentinelAllNodes() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu12");
    // 实例信息
    String appInstanceInfo = "10.10.53.159:7000:512\n" + "10.10.53.159:7001:512\n" + "10.10.53.159:26379:mymaster\n" + "10.10.53.159:26380:mymaster\n" + "10.10.53.159:26381:mymaster";
    ImportAppResult importAppResult = importAppCenter.check(appDesc, appInstanceInfo);
    logger.info("importAppResult: {}", importAppResult);
}
Also used : ImportAppResult(com.sohu.cache.constant.ImportAppResult) AppDesc(com.sohu.cache.entity.AppDesc) BaseTest(com.sohu.test.BaseTest) Test(org.junit.Test)

Example 5 with AppDesc

use of com.sohu.cache.entity.AppDesc in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckExistInstanceInfo.

/**
     * 已经存在实例信息
     */
@Test
public void testCheckExistInstanceInfo() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu6");
    // 实例信息
    String appInstanceInfo = "10.10.53.162:6379:1024";
    ImportAppResult importAppResult = importAppCenter.check(appDesc, appInstanceInfo);
    logger.info("importAppResult: {}", importAppResult);
}
Also used : ImportAppResult(com.sohu.cache.constant.ImportAppResult) AppDesc(com.sohu.cache.entity.AppDesc) BaseTest(com.sohu.test.BaseTest) Test(org.junit.Test)

Aggregations

AppDesc (com.sohu.cache.entity.AppDesc)47 BaseTest (com.sohu.test.BaseTest)18 Test (org.junit.Test)18 ImportAppResult (com.sohu.cache.constant.ImportAppResult)15 InstanceInfo (com.sohu.cache.entity.InstanceInfo)11 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)7 ModelAndView (org.springframework.web.servlet.ModelAndView)7 Date (java.util.Date)5 Jedis (redis.clients.jedis.Jedis)5 AppAudit (com.sohu.cache.entity.AppAudit)4 InstanceStats (com.sohu.cache.entity.InstanceStats)3 IdempotentConfirmer (com.sohu.cache.util.IdempotentConfirmer)3 ParseException (java.text.ParseException)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 AppUser (com.sohu.cache.entity.AppUser)2 AppDetailVO (com.sohu.cache.web.vo.AppDetailVO)2 JSONObject (com.alibaba.fastjson.JSONObject)1 AppClientCostTimeTotalStat (com.sohu.cache.entity.AppClientCostTimeTotalStat)1 AppClientExceptionStat (com.sohu.cache.entity.AppClientExceptionStat)1