Package org.sonatype.nexus.rest.indextreeview

Examples of org.sonatype.nexus.rest.indextreeview.IndexBrowserTreeViewResponseDTO


    xstream.processAnnotations(IndexBrowserTreeNode.class);
    xstream.processAnnotations(IndexBrowserTreeViewResponseDTO.class);

    XStreamRepresentation re = new XStreamRepresentation(xstream, responseText, MediaType.APPLICATION_XML);
    IndexBrowserTreeViewResponseDTO resourceResponse =
        (IndexBrowserTreeViewResponseDTO) re.getPayload(new IndexBrowserTreeViewResponseDTO());

    IndexBrowserTreeNodeDTO content = resourceResponse.getData();

    for (IndexBrowserTreeNodeDTO child : content.getChildren()) {
      Assert.assertEquals(child.getNodeName(), "nexus1961");
    }
  }
View Full Code Here


    xstream.processAnnotations(IndexBrowserTreeNodeDTO.class);
    xstream.processAnnotations(IndexBrowserTreeViewResponseDTO.class);

    XStreamRepresentation re = new XStreamRepresentation(xstream, content, MediaType.APPLICATION_XML);
    IndexBrowserTreeViewResponseDTO resourceResponse =
        (IndexBrowserTreeViewResponseDTO) re.getPayload(new IndexBrowserTreeViewResponseDTO());

    assertThat("without index downloaded root node does not have children", resourceResponse.getData().getChildren(),
        is(nullValue()));

    // I changed my mind, I do wanna remote index
    basic.setDownloadRemoteIndexes(true);
    repoUtil.updateRepo(basic);
View Full Code Here

  @Test
  @Category(INDEX.class)
  public void testTreeWithoutHint()
      throws Exception
  {
    IndexBrowserTreeViewResponseDTO response =
        getSearchMessageUtil().indexBrowserTreeView(REPO_TEST_HARNESS_REPO, "/");

    Assert.assertEquals("There is one \"nexus3670\" group!", response.getData().getChildren().size(), 1);

    // this is the G node of the "nexus3670" groupId (note: on G nodes, only the path is filled, but not the GAV!)
    IndexBrowserTreeNodeDTO node = (IndexBrowserTreeNodeDTO) response.getData().getChildren().get(0);

    // check path (note leading and trailing slashes!)
    Assert.assertEquals("The path does not correspond to group!", node.getPath(), "/nexus3670/");

    // get one level deeper
    // but this path is also Group ID, hence response will contain whole tree!
    response = getSearchMessageUtil().indexBrowserTreeView(REPO_TEST_HARNESS_REPO, node.getPath());

    Assert.assertEquals("There are four \"nexus3670\" artifacts in a group!", response.getData().getChildren().size(),
        4);

    // this is group node
    node = getNode(response, "known-artifact-a");
View Full Code Here

  public void testTreeWithHint()
      throws Exception
  {
    // here, we will omit the path (it is "root" anyway), but by giving G AND A hints, we actually end up with
    // complete subtree
    IndexBrowserTreeViewResponseDTO response =
        getSearchMessageUtil().indexBrowserTreeView(REPO_TEST_HARNESS_REPO, "nexus3670", "known-artifact-a");

    int artifactCount = countNodes(response.getData(), Collections.singleton(TreeNode.Type.artifact));

    Assert.assertEquals("Total of 3 distinct artifacts here!", artifactCount, 3);
  }
View Full Code Here

    xstream.processAnnotations(IndexBrowserTreeNode.class);
    xstream.processAnnotations(IndexBrowserTreeViewResponseDTO.class);

    XStreamRepresentation re = new XStreamRepresentation(xstream, responseText, MediaType.APPLICATION_XML);
    IndexBrowserTreeViewResponseDTO resourceResponse =
        (IndexBrowserTreeViewResponseDTO) re.getPayload(new IndexBrowserTreeViewResponseDTO());

    return resourceResponse.getData();
  }
View Full Code Here

    String entityText = RequestFacade.doGetForText(serviceURI);

    XStreamRepresentation re =
        new XStreamRepresentation(XStreamFactory.getXmlXStream(), entityText, MediaType.APPLICATION_XML);

    IndexBrowserTreeViewResponseDTO resourceResponse =
        (IndexBrowserTreeViewResponseDTO) re.getPayload(new IndexBrowserTreeViewResponseDTO());

    return resourceResponse;
  }
View Full Code Here

        if (node == null) {
          throw new PlexusResourceException(Status.CLIENT_ERROR_NOT_FOUND,
              "Unable to retrieve index tree nodes");
        }

        return new IndexBrowserTreeViewResponseDTO(((IndexBrowserTreeNode) node).toDTO());
      }
      else {
        throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND,
            "The index is disabled for this repository.");
      }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.indextreeview.IndexBrowserTreeViewResponseDTO

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.