Package org.apache.maven.index.treeview

Examples of org.apache.maven.index.treeview.TreeNode


    public void testRoot()
        throws Exception
    {
        TreeViewRequest req =
            new TreeViewRequest( new DefaultTreeNodeFactory( context.getRepositoryId() ), "/", context );
        TreeNode root = indexTreeView.listNodes( req );

        int leafsFound = prettyPrint( debug, root, 0 );

        assertEquals( "The group name should be here", "/", root.getNodeName() );
        assertEquals( 12, root.getChildren().size() );
        assertEquals( 49, leafsFound );
    }
View Full Code Here


    public void testPathIsAboveRealGroup()
        throws Exception
    {
        TreeViewRequest req =
            new TreeViewRequest( new DefaultTreeNodeFactory( context.getRepositoryId() ), "/org/", context );
        TreeNode root = indexTreeView.listNodes( req );

        int leafsFound = prettyPrint( debug, root, 0 );

        assertEquals( "The group name should be here", "org", root.getNodeName() );
        assertEquals( 4, root.getChildren().size() );
        assertEquals( 22, leafsFound );
    }
View Full Code Here

    public void testPathIsRealGroup()
        throws Exception
    {
        TreeViewRequest req =
            new TreeViewRequest( new DefaultTreeNodeFactory( context.getRepositoryId() ), "/org/slf4j/", context );
        TreeNode root = indexTreeView.listNodes( req );

        int leafsFound = prettyPrint( debug, root, 0 );

        assertEquals( "The group name should be here", "slf4j", root.getNodeName() );
        assertEquals( 3, root.getChildren().size() );
        assertEquals( 10, leafsFound );
    }
View Full Code Here

        throws Exception
    {
        TreeViewRequest req =
            new TreeViewRequest( new DefaultTreeNodeFactory( context.getRepositoryId() ), "/org/slf4j/slf4j-log4j12/",
                context );
        TreeNode root = indexTreeView.listNodes( req );

        int leafsFound = prettyPrint( debug, root, 0 );

        assertEquals( "slf4j-log4j12", root.getNodeName() );
        assertEquals( 1, root.getChildren().size() );
        assertEquals( 4, leafsFound );
    }
View Full Code Here

        throws Exception
    {
        TreeViewRequest req =
            new TreeViewRequest( new DefaultTreeNodeFactory( context.getRepositoryId() ),
                "/org/slf4j/slf4j-log4j12/1.4.1/", context );
        TreeNode root = indexTreeView.listNodes( req );

        int leafsFound = prettyPrint( debug, root, 0 );

        assertEquals( "The group name should be here", "1.4.1", root.getNodeName() );
        assertEquals( 1, root.getChildren().size() );
        assertEquals( 4, leafsFound );
    }
View Full Code Here

  @Override
  protected TreeNode createNode(IndexTreeView tview, TreeViewRequest req, String path, boolean leaf,
                                String nodeName, Type type)
  {
    final TreeNode result = super.createNode(tview, req, path, leaf, nodeName, type);
    result.setRepositoryId(getRepository().getId());
    return result;
  }
View Full Code Here

        if (StringUtils.isNotBlank(versionHint)) {
          hints.put(MAVEN.VERSION, versionHint);
        }

        TreeNode node = indexerManager.listNodes(factory, path, hints, null, repository.getId());

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

  public void testSearchIteratorAfterRepositoryDrop()
      throws Exception
  {
    fillInRepo();
    indexerManager.reindexAllRepositories("/", true);
    TreeNode node = indexerManager.listNodes(new DefaultTreeNodeFactory(central.getId()), "/", central.getId());
    indexerManager.removeRepositoryIndexContext(central, false);
    Assert.assertEquals(0, node.listChildren().size());
  }
View Full Code Here

  }

  private void assertRootGroups()
      throws NoSuchRepositoryException, IOException
  {
    TreeNode node = indexerManager.listNodes(new DefaultTreeNodeFactory(central.getId()), "/", central.getId());
    Assert.assertEquals(1, node.getChildren().size());
    Assert.assertEquals("/org/", node.getChildren().get(0).getPath());
  }
View Full Code Here

TOP

Related Classes of org.apache.maven.index.treeview.TreeNode

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.