DependencyDescriptor[] dependencies = md.getDependencies();
assertNotNull(dependencies);
assertEquals(13, dependencies.length);
// no conf def => equivalent to *->*
DependencyDescriptor dd = getDependency(dependencies, "mymodule2");
assertNotNull(dd);
assertEquals("myorg", dd.getDependencyId().getOrganisation());
assertEquals("2.0", dd.getDependencyRevisionId().getRevision());
assertEquals(Arrays.asList(new String[] {"*"}), Arrays.asList(dd.getModuleConfigurations()));
assertEquals(Arrays.asList(new String[] {"*"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(
Arrays.asList(new String[] {"*"}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf2", "myconf3",
"myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
assertFalse(dd.isChanging());
assertTrue(dd.isTransitive());
// changing = true
dd = getDependency(dependencies, "mymodule3");
assertNotNull(dd);
assertTrue(dd.isChanging());
assertFalse(dd.isTransitive());
// conf="myconf1" => equivalent to myconf1->myconf1
dd = getDependency(dependencies, "yourmodule1");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("trunk", dd.getDependencyRevisionId().getBranch());
assertEquals("1.1", dd.getDependencyRevisionId().getRevision());
assertEquals("branch1", dd.getDynamicConstraintDependencyRevisionId().getBranch());
assertEquals("1+", dd.getDynamicConstraintDependencyRevisionId().getRevision());
assertEquals("yourorg#yourmodule1#branch1;1+", dd
.getDynamicConstraintDependencyRevisionId().toString());
assertEquals(Arrays.asList(new String[] {"myconf1"}),
Arrays.asList(dd.getModuleConfigurations()));
assertEquals(Arrays.asList(new String[] {"myconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(
Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf2", "myconf3",
"myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
// conf="myconf1->yourconf1"
dd = getDependency(dependencies, "yourmodule2");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("2+", dd.getDependencyRevisionId().getRevision());
assertEquals(Arrays.asList(new String[] {"myconf1"}),
Arrays.asList(dd.getModuleConfigurations()));
assertEquals(Arrays.asList(new String[] {"yourconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(
Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf2", "myconf3",
"myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
// conf="myconf1->yourconf1, yourconf2"
dd = getDependency(dependencies, "yourmodule3");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("3.1", dd.getDependencyRevisionId().getRevision());
assertEquals(Arrays.asList(new String[] {"myconf1"}),
Arrays.asList(dd.getModuleConfigurations()));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(
Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf2", "myconf3",
"myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
// conf="myconf1, myconf2->yourconf1, yourconf2"
dd = getDependency(dependencies, "yourmodule4");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("4.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"myconf1", "myconf2"})), new HashSet(
Arrays.asList(dd.getModuleConfigurations())));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf2")));
assertEquals(Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf3", "myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
// conf="myconf1->yourconf1;myconf2->yourconf1, yourconf2"
dd = getDependency(dependencies, "yourmodule5");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("5.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"myconf1", "myconf2"})), new HashSet(
Arrays.asList(dd.getModuleConfigurations())));
assertEquals(Arrays.asList(new String[] {"yourconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf2")));
assertEquals(Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf3", "myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
// conf="*->@"
dd = getDependency(dependencies, "yourmodule11");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("11.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"*"})),
new HashSet(Arrays.asList(dd.getModuleConfigurations())));
assertEquals(Arrays.asList(new String[] {"myconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(Arrays.asList(new String[] {"myconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf2")));
assertEquals(Arrays.asList(new String[] {"myconf3"}),
Arrays.asList(dd.getDependencyConfigurations("myconf3")));
assertEquals(Arrays.asList(new String[] {"myconf4"}),
Arrays.asList(dd.getDependencyConfigurations("myconf4")));
dd = getDependency(dependencies, "yourmodule6");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("latest.integration", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"myconf1", "myconf2"})), new HashSet(
Arrays.asList(dd.getModuleConfigurations())));
assertEquals(Arrays.asList(new String[] {"yourconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf2")));
assertEquals(Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf3", "myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
dd = getDependency(dependencies, "yourmodule7");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("7.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"myconf1", "myconf2"})), new HashSet(
Arrays.asList(dd.getModuleConfigurations())));
assertEquals(Arrays.asList(new String[] {"yourconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf2")));
assertEquals(Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf3", "myconf4"})));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1", "myconf2", "myconf3",
"myconf4"}, new String[0]);
dd = getDependency(dependencies, "yourmodule8");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("8.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"*"})),
new HashSet(Arrays.asList(dd.getModuleConfigurations())));
assertDependencyArtifacts(dd, new String[] {"myconf1"}, new String[] {"yourartifact8-1",
"yourartifact8-2"});
assertDependencyArtifacts(dd, new String[] {"myconf2"}, new String[] {"yourartifact8-1",
"yourartifact8-2"});
assertDependencyArtifacts(dd, new String[] {"myconf3"}, new String[] {"yourartifact8-1",
"yourartifact8-2"});
assertDependencyArtifacts(dd, new String[] {"myconf4"}, new String[] {"yourartifact8-1",
"yourartifact8-2"});
dd = getDependency(dependencies, "yourmodule9");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("9.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"myconf1", "myconf2", "myconf3"})),
new HashSet(Arrays.asList(dd.getModuleConfigurations())));
assertDependencyArtifacts(dd, new String[] {"myconf1"}, new String[] {"yourartifact9-1"});
assertDependencyArtifacts(dd, new String[] {"myconf2"}, new String[] {"yourartifact9-1",
"yourartifact9-2"});
assertDependencyArtifacts(dd, new String[] {"myconf3"}, new String[] {"yourartifact9-2"});
assertDependencyArtifacts(dd, new String[] {"myconf4"}, new String[] {});
assertDependencyArtifactExcludeRules(dd, new String[] {"myconf1"}, new String[] {});
assertDependencyArtifactExcludeRules(dd, new String[] {"myconf2"}, new String[] {});
assertDependencyArtifactExcludeRules(dd, new String[] {"myconf3"}, new String[] {});
assertDependencyArtifactExcludeRules(dd, new String[] {"myconf4"}, new String[] {});
dd = getDependency(dependencies, "yourmodule10");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("10.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"*"})),
new HashSet(Arrays.asList(dd.getModuleConfigurations())));
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf1"}, new String[] {"your.*",
PatternMatcher.ANY_EXPRESSION});
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf2"}, new String[] {"your.*",
PatternMatcher.ANY_EXPRESSION});
assertDependencyArtifactIncludeRules(dd, new String[] {"myconf3"}, new String[] {"your.*",