use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesAsListTest method addDroolsCore.
private void addDroolsCore() {
droolsCoreNormalDependency = new NormalEnhancedDependency(new Dependency(new GAV("org.drools:drools-core:1.3")), new HashSet<>());
xstreamTransitiveDependency = new TransitiveEnhancedDependency(new Dependency(new GAV("org.xstream:xstream:1.0")), new HashSet<>());
droolsApiTransitiveDependency1 = new TransitiveEnhancedDependency(new Dependency(new GAV("org.drools:drools-api:1.0")), new HashSet<>());
droolsCoreNormalDependency.addTransitiveDependency(xstreamTransitiveDependency);
enhancedDependencies.add(droolsCoreNormalDependency);
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesTest method setUp.
@Before
public void setUp() throws Exception {
enhancedDependencies = new EnhancedDependencies();
final NormalEnhancedDependency enhancedDependency = new NormalEnhancedDependency(new Dependency(new GAV("org.hamcrest", "hamcrest-core", "1.3")), new HashSet<>());
enhancedDependency.addTransitiveDependency(new TransitiveEnhancedDependency(new Dependency(new GAV("hi:something:1.0")), new HashSet<String>()));
enhancedDependencies.add(enhancedDependency);
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class DependencyServiceImplTest method testDependenciesForGAVs.
@Test
public void testDependenciesForGAVs() throws Exception {
final Collection<GAV> gavs = new ArrayList<GAV>();
gavs.add(new GAV("junit", "junit", "4.11"));
gavs.add(new GAV("org.guvnor", "guvnor-web-app", "5.0"));
Collection<Dependency> dependencies = service.loadDependencies(gavs);
assertEquals(2, dependencies.size());
final Iterator<Dependency> iterator = dependencies.iterator();
Dependency dependency = iterator.next();
assertEquals("org.hamcrest", dependency.getGroupId());
assertEquals("hamcrest-core", dependency.getArtifactId());
assertEquals("1.3", dependency.getVersion());
dependency = iterator.next();
assertEquals("org.drools", dependency.getGroupId());
assertEquals("drools-core", dependency.getArtifactId());
assertEquals("5.0", dependency.getVersion());
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class DependencyServiceImplTest method testDependencies.
@Test
public void testDependencies() throws Exception {
Collection<Dependency> dependencies = service.loadDependencies(new GAV("junit", "junit", "4.11"));
assertEquals(1, dependencies.size());
Dependency dependency = dependencies.iterator().next();
assertEquals("org.hamcrest", dependency.getGroupId());
assertEquals("hamcrest-core", dependency.getArtifactId());
assertEquals("1.3", dependency.getVersion());
}
use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.
the class PackageNameSearchProviderTest method testLoadTopLevelDependenciesWhenIncompleteDependenciesInPOM.
@Test
public void testLoadTopLevelDependenciesWhenIncompleteDependenciesInPOM() throws Exception {
POM pom = new POM(new GAV("artifactID", "groupID", "version"));
pom.getDependencies().add(getDependency("drools-core", "org.drools", null));
pom.getDependencies().add(getDependency(null, null, null));
HashMap<Dependency, Set<String>> map = setUpDependencyService(pom);
map.put(getGAV("drools-core", "org.drools", "6.3.0"), toSet("org.drools.a", "org.drools.b", "org.drools.c"));
Set<String> packageNames = packageNameSearchProvider.newTopLevelPackageNamesSearch(pom).search();
assertEquals(3, packageNames.size());
assertTrue(packageNames.contains("org.drools.a"));
assertTrue(packageNames.contains("org.drools.b"));
assertTrue(packageNames.contains("org.drools.c"));
}
Aggregations