コード例 #1
0
 private ServerEnvironment generateSimpleEnvironment() {
   if (environment == null) {
     environment = new ServerEnvironment();
     environment.setId(TESTCASE_ENVIRONMENT_ID);
     environment.setRepositoryId(TESTCASE_REPOSITORY_ID);
   }
   return environment;
 }
コード例 #2
0
ファイル: XmlCreator.java プロジェクト: applicake/Beandroid
  public String createNewServerEnvironmentXML(ServerEnvironment serverEnvironment)
      throws IllegalArgumentException, IllegalStateException, IOException {
    serializer = Xml.newSerializer();
    writer = new StringWriter();
    serializer.setOutput(writer);

    serializer.startDocument("UTF-8", null);
    serializer.startTag("", "server-environment");

    addName(serverEnvironment.getName());
    addIsAutomatic(serverEnvironment.isAutomatic());

    serializer.endTag("", "server-environment");
    serializer.endDocument();
    return writer.toString();
  }
コード例 #3
0
 private PermissionsData generateWriteablePermissionsForRepository(
     Repository repository, ServerEnvironment environment) {
   PermissionsData permissionData = new PermissionsData();
   permissionData.setUser(generateUser());
   ArrayList<Permission> permissions = new ArrayList<Permission>();
   Permission permission = new Permission();
   permission.setRepositoryId(repository.getId());
   permission.setServerEnvironmentId(environment.getId());
   permissions.add(permission);
   permissionData.setPermissions(permissions);
   return permissionData;
 }