当前位置: 首页>>代码示例>>Java>>正文


Java DependencyNode.setChildren方法代码示例

本文整理汇总了Java中org.eclipse.aether.graph.DependencyNode.setChildren方法的典型用法代码示例。如果您正苦于以下问题:Java DependencyNode.setChildren方法的具体用法?Java DependencyNode.setChildren怎么用?Java DependencyNode.setChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.aether.graph.DependencyNode的用法示例。


在下文中一共展示了DependencyNode.setChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testBasicParentChildRelations

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
/**
 * Ensures that the generated rules preserve dependency relations
 * (i.e. parent, child sets). This will be used to generate the deps field.
 */
@Test
public void testBasicParentChildRelations() {
  DependencyNode sentinel = dependencyNode("dummy:dummy:0");
  DependencyNode parentNode = dependencyNode("a:a:1");
  DependencyNode childNode = dependencyNode("a:2:1");

  sentinel.setChildren(ImmutableList.of(parentNode));
  parentNode.setChildren(ImmutableList.of(childNode));

  MavenJarRule parent = new MavenJarRule(parentNode);
  MavenJarRule child = new MavenJarRule(childNode);
  addDependency(parent, child);

  Set<MavenJarRule> actual = GraphSerializer.generateBuildRules(sentinel);

  assertRuleSetContainsExactly(actual, parent, child);
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:22,代码来源:GraphSerializerTest.java

示例2: testMultipleDirectDependencies

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@Test
public void testMultipleDirectDependencies() {
  DependencyNode sentinel = dependencyNode("dummy:dummy:0");
  DependencyNode nodeA = dependencyNode("a:a:1");
  DependencyNode nodeA1 = dependencyNode("a:1:1");
  DependencyNode nodeB = dependencyNode("b:b:1");
  DependencyNode nodeC = dependencyNode("c:c:1");

  sentinel.setChildren(ImmutableList.of(nodeA, nodeB, nodeC));
  nodeA.setChildren(ImmutableList.of(nodeA1));

  Set<MavenJarRule> rules = GraphSerializer.generateBuildRules(sentinel);

  MavenJarRule ruleA = new MavenJarRule(nodeA);
  MavenJarRule ruleA1 = new MavenJarRule(nodeA1);
  MavenJarRule ruleB = new MavenJarRule(nodeB);
  MavenJarRule ruleC = new MavenJarRule(nodeC);
  addDependency(ruleA, ruleA1);

  assertRuleSetContainsExactly(rules, ruleA, ruleA1, ruleB, ruleC);
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:22,代码来源:GraphSerializerTest.java

示例3: testSharedChild

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@Test
public void testSharedChild() {
  DependencyNode sentinel = dependencyNode("dummy:dummy:0");
  DependencyNode nodeA = dependencyNode("a:a:1");
  DependencyNode nodeB = dependencyNode("b:b:1");
  DependencyNode child = dependencyNode("child:child:1");

  sentinel.setChildren(ImmutableList.of(nodeA, nodeB));
  nodeA.setChildren(ImmutableList.of(child));
  nodeB.setChildren(ImmutableList.of(child));

  Set<MavenJarRule> rules = GraphSerializer.generateBuildRules(sentinel);

  MavenJarRule ruleA = new MavenJarRule(nodeA);
  MavenJarRule ruleB = new MavenJarRule(nodeB);
  MavenJarRule childRule = new MavenJarRule(child);
  addDependency(ruleA, childRule);
  addDependency(ruleB, childRule);

  assertRuleSetContainsExactly(rules, ruleA, ruleB, childRule);

}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:23,代码来源:GraphSerializerTest.java

示例4: testBasicGraphConstruction

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
@Test
public void testBasicGraphConstruction() {
  DependencyNode root = dependencyNode("root:root:1");
  DependencyNode depA = dependencyNode("a:a:1");
  DependencyNode depB = dependencyNode("b:b:1");

  root.setChildren(ImmutableList.of(depA, depB));

  MavenJarRule rootRule = new MavenJarRule(root);
  MavenJarRule aRule = new MavenJarRule(depA);
  MavenJarRule bRule = new MavenJarRule(depB);

  MutableGraph<MavenJarRule> expected = newGraph();
  addEdge(expected, rootRule, aRule);
  addEdge(expected, rootRule, bRule);

  // Construct the graph
  MutableGraph<MavenJarRule> actual = newGraph();
  AetherGraphTraverser visitor = new AetherGraphTraverser(actual);
  root.accept(visitor);

  assertThatGraphsEqual(actual, expected);
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:24,代码来源:AetherGraphTraverserTest.java

示例5: testAccumulation

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
/**
 * Asserts that when the dependency visitor is accepted by multiple
 * nodes, the constructed graph contains nodes and edges from all visits.
 */
@Test
public void testAccumulation() {
  DependencyNode rootNodeA = dependencyNode("a:a1:1");
  DependencyNode childNodeA = dependencyNode("a:a2:1");
  DependencyNode rootNodeB = dependencyNode("b:b1:1");
  DependencyNode childNodeB = dependencyNode("b:b2:1");

  rootNodeA.setChildren(ImmutableList.of(childNodeA));
  rootNodeB.setChildren(ImmutableList.of(childNodeB));

  MavenJarRule rootRuleA = new MavenJarRule(rootNodeA);
  MavenJarRule childRuleA = new MavenJarRule(childNodeA);
  MavenJarRule rootRuleB = new MavenJarRule(rootNodeB);
  MavenJarRule childRuleB = new MavenJarRule(childNodeB);

  MutableGraph<MavenJarRule> expected = newGraph();
  addEdge(expected, rootRuleA, childRuleA);
  addEdge(expected, rootRuleB, childRuleB);

  // Construct the graph
  MutableGraph<MavenJarRule> actual = newGraph();
  AetherGraphTraverser visitor = new AetherGraphTraverser(actual);
  rootNodeA.accept(visitor);
  rootNodeB.accept(visitor);

  assertThatGraphsEqual(actual, expected);
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:32,代码来源:AetherGraphTraverserTest.java

示例6: testDuplicateChildren

import org.eclipse.aether.graph.DependencyNode; //导入方法依赖的package包/类
/**
 * Tests behavior when there is a duplicate dependency node within the graph, meaning
 * two nodes with the same maven coordinate. The generated graph should not contain
 * multiple instances of that node.
 */
@Test
public void testDuplicateChildren() {
  DependencyNode rootNodeA = dependencyNode("a:a:1");
  DependencyNode rootNodeB = dependencyNode("b:b:1");
  DependencyNode childNode = dependencyNode("c:c:1");
  DependencyNode childNodeDuplicate = dependencyNode("c:c:1");

  rootNodeA.setChildren(ImmutableList.of(childNode));
  rootNodeB.setChildren(ImmutableList.of(childNode));
  rootNodeA.setChildren(ImmutableList.of(childNodeDuplicate));
  rootNodeB.setChildren(ImmutableList.of(childNodeDuplicate));

  MavenJarRule rootRuleA = new MavenJarRule(rootNodeA);
  MavenJarRule childRule = new MavenJarRule(childNode);
  MavenJarRule rootRuleB = new MavenJarRule(rootNodeB);

  MutableGraph<MavenJarRule> expected = newGraph();
  addEdge(expected, rootRuleA, childRule);
  addEdge(expected, rootRuleB, childRule);

  // Construct the graph
  MutableGraph<MavenJarRule> actual = newGraph();
  AetherGraphTraverser visitor = new AetherGraphTraverser(actual);
  rootNodeA.accept(visitor);
  rootNodeB.accept(visitor);

  assertThatGraphsEqual(actual, expected);
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:34,代码来源:AetherGraphTraverserTest.java


注:本文中的org.eclipse.aether.graph.DependencyNode.setChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。