Search in sources :

Example 6 with ImportAppResult

use of com.sohu.cache.constant.ImportAppResult in project cachecloud by sohutv.

the class ImportAppController method check.

@RequestMapping(value = "/check")
public ModelAndView check(HttpServletRequest request, HttpServletResponse response, Model model) {
    AppDesc appDesc = genAppDesc(request);
    String appInstanceInfo = request.getParameter("appInstanceInfo");
    ImportAppResult importAppResult = importAppCenter.check(appDesc, appInstanceInfo);
    model.addAttribute("status", importAppResult.getStatus());
    model.addAttribute("message", importAppResult.getMessage());
    return new ModelAndView("");
}
Also used : ImportAppResult(com.sohu.cache.constant.ImportAppResult) ModelAndView(org.springframework.web.servlet.ModelAndView) AppDesc(com.sohu.cache.entity.AppDesc) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with ImportAppResult

use of com.sohu.cache.constant.ImportAppResult in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckSentinelNodeMasterName.

/**
     * 测试sentinel的masterName
     */
@Test
public void testCheckSentinelNodeMasterName() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu10");
    // 实例信息
    String appInstanceInfo = "10.10.53.159:26379: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 8 with ImportAppResult

use of com.sohu.cache.constant.ImportAppResult in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckEmptyAppInstanceInfo1.

/**
     * 应用实例详情为空
     */
@Test
public void testCheckEmptyAppInstanceInfo1() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu1");
    // 实例信息
    String appInstanceInfo = "";
    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 9 with ImportAppResult

use of com.sohu.cache.constant.ImportAppResult in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckDataNode.

/**
     */
@Test
public void testCheckDataNode() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu9");
    // 实例信息
    String appInstanceInfo = "10.10.53.159: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)

Example 10 with ImportAppResult

use of com.sohu.cache.constant.ImportAppResult in project cachecloud by sohutv.

the class ImportAppCenterTest method testCheckSentinelNode.

/**
     * 检测sentinel节点
     */
@Test
public void testCheckSentinelNode() {
    // 应用信息
    AppDesc appDesc = new AppDesc();
    appDesc.setName("carlosfu11");
    // 实例信息
    String appInstanceInfo = "10.10.53.159:26379: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)

Aggregations

ImportAppResult (com.sohu.cache.constant.ImportAppResult)15 AppDesc (com.sohu.cache.entity.AppDesc)15 BaseTest (com.sohu.test.BaseTest)14 Test (org.junit.Test)14 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1