Examples of buildResult()


Examples of org.springside.examples.miniservice.ws.result.AuthUserResult.buildResult()

    try {
      Assert.hasText(loginName, "登录名参数为空");
      Assert.hasText(password, "密码参数为空");
    } catch (IllegalArgumentException e) {
      logger.error(e.getMessage());
      return result.buildResult(WSResult.PARAMETER_ERROR, e.getMessage());
    }

    //认证
    try {
      if (accountManager.authenticate(loginName, password)) {
View Full Code Here

Examples of org.springside.examples.miniservice.ws.result.CreateUserResult.buildResult()

      Assert.notNull(user, "用户参数为空");
      Assert.hasText(user.getLoginName(), "新建用户登录名参数为空");
      Assert.isNull(user.getId(), "新建用户ID参数必须为空");
    } catch (IllegalArgumentException e) {
      logger.error(e.getMessage());
      return result.buildResult(WSResult.PARAMETER_ERROR, e.getMessage());
    }

    //保存用户
    try {
      User userEntity = dozer.map(user, User.class);
View Full Code Here

Examples of org.springside.examples.miniservice.ws.result.CreateUserResult.buildResult()

      result.setUserId(userEntity.getId());
      return result;
    } catch (ConstraintViolationException e) {
      String message = "新建用户参数存在唯一性冲突(用户:" + user + ")";
      logger.error(message, e);
      return result.buildResult(WSResult.PARAMETER_ERROR, message);
    } catch (RuntimeException e) {
      logger.error(e.getMessage(), e);
      return result.buildDefaultErrorResult();
    }
  }
View Full Code Here

Examples of org.springside.examples.miniservice.ws.result.GetUserResult.buildResult()

    //校验请求参数
    try {
      Assert.notNull(id, "id参数为空");
    } catch (IllegalArgumentException e) {
      logger.error(e.getMessage());
      return result.buildResult(WSResult.PARAMETER_ERROR, e.getMessage());
    }

    //获取用户
    try {
      User entity = accountManager.getInitedUser(id);
View Full Code Here

Examples of org.springside.examples.miniservice.ws.result.GetUserResult.buildResult()

      result.setUser(dto);
      return result;
    } catch (ObjectNotFoundException e) {
      String message = "用户不存在(id:" + id + ")";
      logger.error(message, e);
      return result.buildResult(WSResult.PARAMETER_ERROR, message);
    } catch (RuntimeException e) {
      logger.error(e.getMessage(), e);
      return result.buildDefaultErrorResult();
    }
  }
View Full Code Here

Examples of org.stjs.testing.driver.browser.LongPollingBrowser.buildResult()

        }

        // notify JUnit of the result of this test. When the last browser notifies
        // the MultiTestMethod, the JUnit thread will become unblocked and the test result
        // will be reported
        TestResult result = browser.buildResult(params, exchange);
        completedMethod.notifyExecutionResult(result);
      } else {
        if (config.isDebugEnabled()) {
          System.out.println("Server received request for the first test from browser " + browserId);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.