Examples of CodeGraphResponseImpl


Examples of com.google.collide.dto.client.DtoClientImpls.CodeGraphResponseImpl

      runCount++;
    }
  }

  public void testFreshFileTreeWontDestroyLinks() {
    CodeGraphResponseImpl response = DtoClientImpls.MockCodeGraphResponseImpl.make();
    response.setFreshness(createFreshness("0", "1", "1"));

    {
      CodeBlock fileBlock = createCodeBlock("0", "/foo.js", CodeBlock.Type.FILE, 0, 0, 10, 0);
      CodeBlock foo = createCodeBlock(fileBlock, "1", "foo", CodeBlock.Type.FIELD, 0, 0, 1, 0);
      CodeBlock bar = createCodeBlock(fileBlock, "2", "bar", CodeBlock.Type.FIELD, 1, 0, 2, 0);
      createCodeBlock(fileBlock, "3", "bar.doThis", CodeBlock.Type.FUNCTION, 1, 10, 2, 0);
      TypeAssociation typeLink = createTypeAssociation(fileBlock, foo, fileBlock, bar);
      CodeGraphImpl codeGraph = createCodeGraph(fileBlock);
      codeGraph.setTypeAssociations(JsoArray.<TypeAssociation>from(typeLink));

      response.setFullGraphJson(codeGraph.serialize());
    }
    {
      CodeBlockImpl freshFileBlock = createCodeBlock(
          "1", "/foo.js", CodeBlock.Type.FILE, 0, 0, 10, 0);
      createCodeBlock(freshFileBlock, "1", "foo", CodeBlock.Type.FIELD, 0, 0, 1, 0);
      createCodeBlock(freshFileBlock, "2", "foo.baz", CodeBlock.Type.FIELD, 1, 0, 2, 0);
      createCodeBlock(freshFileBlock, "3", "bar", CodeBlock.Type.FIELD, 2, 0, 3, 0);
      createCodeBlock(freshFileBlock, "4", "bar.doThis", CodeBlock.Type.FUNCTION, 2, 10, 3, 0);
      response.setFileTreeJson(Jso.serialize(freshFileBlock));
    }

    MockCubeClient cubeClient = MockCubeClient.create();
    UpdateReceiver updateListener = new UpdateReceiver();
View Full Code Here

Examples of com.google.collide.dto.client.DtoClientImpls.CodeGraphResponseImpl

        .setStartLineNumber(0)
        .setStartColumn(0)
        .setEndLineNumber(0)
        .setEndColumn(19);
    CodeGraphImpl codeGraph = createCodeGraph(fileCodeBlock);
    CodeGraphResponseImpl response = DtoClientImpls.MockCodeGraphResponseImpl.make();
    response.setFreshness(createFreshness("0", "1", "0"));
    response.setFullGraphJson(codeGraph.serialize());

    // This will immediately fire api call
    helper.cubeClient.setPath("/foo.js");
    assertEquals("one api call after setDocument", 1,
        helper.cubeClient.api.collectedCallbacks.size());
View Full Code Here

Examples of com.google.collide.dto.client.DtoClientImpls.CodeGraphResponseImpl

  /**
   * Tests that update notifications bring {@code false} for updates that
   * doesn't bring fresh data.
   */
  public void testStaleDataMakesNoUpdates() {
    CodeGraphResponseImpl response = MockCodeGraphResponseImpl.make();
    response.setFreshness(createFreshness("0", "0", "0"));
    response.setLibsSubgraphJson(Jso.serialize(createCodeGraph(
        createCodeBlock("0", "/foo.js", CodeBlock.Type.FILE, 0, 0, 1, 0))));

    final MockApi api = new MockApi();
    MockCubeClientDistributor distributor = new MockCubeClientDistributor();
    CubeState state = new CubeState(api, distributor);
View Full Code Here

Examples of com.google.collide.dto.client.DtoClientImpls.CodeGraphResponseImpl

  /**
   * Tests that {@link CubeState} fires update notification when it receives
   * data which is more fresh than stored one.
   */
  public void testFreshDataMakesUpdate() {
    CodeGraphResponseImpl response = MockCodeGraphResponseImpl.make();
    response.setFreshness(createFreshness("1", "0", "0"));
    response.setLibsSubgraphJson(Jso.serialize(createCodeGraph(
        createCodeBlock("0", "/foo.js", CodeBlock.Type.FILE, 0, 0, 1, 0))));

    final MockApi api = new MockApi();
    MockCubeClientDistributor distributor = new MockCubeClientDistributor();
    CubeState state = new CubeState(api, distributor);
View Full Code Here

Examples of com.google.collide.dto.client.DtoClientImpls.CodeGraphResponseImpl

  /**
   * Tests that consequent refresh requests for different data are served
   * sequentially.
   */
  public void testRefreshSequencing() {
    CodeGraphResponseImpl response = MockCodeGraphResponseImpl.make();
    response.setFreshness(createFreshness("1", "1", "1"));
    final MockApi api = new MockApi();
    MockCubeClientDistributor distributor = new MockCubeClientDistributor();
    CubeState state = new CubeState(api, distributor);

    state.setFilePath("a.js");
View Full Code Here

Examples of com.google.collide.dto.client.DtoClientImpls.CodeGraphResponseImpl

  /**
   * Tests that consequent refresh requests for different data do not cause
   * frontend request for data that is not required anymore.
   */
  public void testRefreshSequencingAndCollapsing() {
    CodeGraphResponseImpl response = MockCodeGraphResponseImpl.make();
    response.setFreshness(createFreshness("1", "1", "1"));
    final MockApi api = new MockApi();
    MockCubeClientDistributor distributor = new MockCubeClientDistributor();
    CubeState state = new CubeState(api, distributor);

    state.setFilePath("a.js");
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.