Package org.eclipse.orion.server.core

Examples of org.eclipse.orion.server.core.ServerStatus


    assertRemoteOrRemoteBranchLocation(remoteBranchLocation);

    // fetch
    WebRequest request = GitFetchTest.getPostGitRemoteRequest(remoteBranchLocation, true, force, userName, kh, privk, pubk, p);
    WebResponse response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(response);

    if (shouldBeOK) {
      assertTrue(status.toString(), status.isOK());
    }

    // get remote branch details again
    request = GitRemoteTest.getGetGitRemoteRequest(remoteBranchLocation);
    response = webConversation.getResponse(request);
View Full Code Here


  protected JSONObject fetch(String remoteLocation, boolean force) throws JSONException, IOException, SAXException {
    assertRemoteOrRemoteBranchLocation(remoteLocation);

    // fetch
    WebRequest request = GitFetchTest.getPostGitRemoteRequest(remoteLocation, true, force);
    ServerStatus status = waitForTask(webConversation.getResponse(request));
    assertTrue(status.toString(), status.isOK());

    // get remote (branch) details again
    request = GitRemoteTest.getGetGitRemoteRequest(remoteLocation);
    status = waitForTask(webConversation.getResponse(request));
    assertTrue(status.toString(), status.isOK());
    return status.getJsonData();
  }
View Full Code Here

  protected JSONObject pull(String cloneLocation) throws JSONException, IOException, SAXException, CoreException {
    assertCloneUri(cloneLocation);

    // pull
    WebRequest request = GitPullTest.getPostGitRemoteRequest(cloneLocation, false);
    ServerStatus status = waitForTask(webConversation.getResponse(request));
    assertTrue(status.toString(), status.isOK());
    return status.getJsonData();
  }
View Full Code Here

  protected JSONArray listTags(String gitTagUri) throws IOException, SAXException, JSONException {
    assertTagListUri(gitTagUri);
    WebRequest request = getGetGitTagRequest(gitTagUri);
    WebResponse response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(response);
    assertTrue(status.toString(), status.isOK());
    JSONObject tags = status.getJsonData();
    assertEquals(Tag.TYPE, tags.getString(ProtocolConstants.KEY_TYPE));
    return tags.getJSONArray(ProtocolConstants.KEY_CHILDREN);
  }
View Full Code Here

  private JSONObject logObject(String gitCommitUri, Integer page, Integer pageSize) throws IOException, SAXException, JSONException {
    assertCommitUri(gitCommitUri);
    WebRequest request = GitCommitTest.getGetGitCommitRequest(gitCommitUri, false, page, pageSize);
    setAuthentication(request);
    WebResponse response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(response);
    assertTrue(status.toString(), status.isOK());
    return status.getJsonData();
  }
View Full Code Here

  }

  JSONObject listBranches(final String branchesLocation) throws IOException, SAXException, JSONException {
    WebRequest request = getGetRequest(branchesLocation);
    WebResponse response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(response);
    assertTrue(status.toString(), status.isOK());
    JSONObject branches = status.getJsonData();
    assertEquals(Branch.TYPE, branches.getString(ProtocolConstants.KEY_TYPE));
    return branches;
  }
View Full Code Here

    return request;
  }

  protected String clone(WebRequest request) throws JSONException, IOException, SAXException {
    WebResponse response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(webConversation.getResponse(request));

    assertTrue(status.toString(), status.isOK());

    String cloneLocation = status.getJsonData().getString(ProtocolConstants.KEY_LOCATION);
    assertNotNull(cloneLocation);

    // validate the clone metadata
    response = webConversation.getResponse(getGetRequest(cloneLocation));
    JSONObject clones = new JSONObject(response.getText());
View Full Code Here

      assertTrue(HttpURLConnection.HTTP_OK == response.getResponseCode() || HttpURLConnection.HTTP_ACCEPTED == response.getResponseCode());

      // list branches again, make sure it's gone
      request = getGetRequest(branchesLocation);
      response = webConversation.getResponse(request);
      ServerStatus status = waitForTask(response);
      assertTrue(status.toString(), status.isOK());
      branches = status.getJsonData();
      branchesArray = branches.getJSONArray(ProtocolConstants.KEY_CHILDREN);
      assertEquals(1, branchesArray.length());
      JSONObject branch = branchesArray.getJSONObject(0);
      assertTrue(branch.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));
    }
View Full Code Here

      request = GitCommitTest.getPostGitCommitRequest(gitHeadUri, "commit1", false);
      response = webConversation.getResponse(request);
      assertEquals(HttpURLConnection.HTTP_OK, response.getResponseCode());

      // push
      ServerStatus pushStatus = push(gitRemoteUri, 1, 0, Constants.MASTER, Constants.HEAD, false);
      assertEquals(true, pushStatus.isOK());

      // TODO: replace with RESTful API for git pull when available
      // try to pull - up to date status is expected
      Git git = new Git(getRepositoryForContentLocation(cloneContentLocation));
      PullResult pullResults = git.pull().call();
View Full Code Here

    request = GitCommitTest.getPostGitCommitRequest(gitHeadUri1, "incoming change commit", false);
    response = webConversation.getResponse(request);
    assertEquals(HttpURLConnection.HTTP_OK, response.getResponseCode());

    // clone1: push
    ServerStatus pushStatus = push(gitRemoteUri1, 1, 0, Constants.MASTER, Constants.HEAD, false);
    assertEquals(true, pushStatus.isOK());

    // clone2: get remote branch location
    JSONObject remoteBranch = getRemoteBranch(gitRemoteUri2, 1, 0, Constants.MASTER);
    String remoteBranchLocation2 = remoteBranch.getString(ProtocolConstants.KEY_LOCATION);
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.core.ServerStatus

Copyright © 2018 www.massapicom. 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.