Search in sources :

Example 31 with Dependency

use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.

the class DependencyServiceImplTest method testNoDependencies.

@Test
public void testNoDependencies() throws Exception {
    GAV gav = new GAV("artifactID", "groupID", "version");
    Collection<Dependency> dependencies = service.loadDependencies(gav);
    assertTrue(dependencies.isEmpty());
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) Test(org.junit.Test)

Example 32 with Dependency

use of org.guvnor.common.services.project.model.Dependency in project kie-wb-common by kiegroup.

the class PackageNameSearchProviderTest method testLoadTopLevelDependencies.

@Test
public void testLoadTopLevelDependencies() throws Exception {
    POM pom = new POM(new GAV("artifactID", "groupID", "version"));
    pom.getDependencies().add(getDependency("drools-core", "org.drools", "6.3.0"));
    pom.getDependencies().add(getDependency("junit", "org.junit", "4.11"));
    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"));
    map.put(getGAV("junit", "org.junit", "4.11"), toSet("junit.a", "junit.b"));
    Set<String> packageNames = packageNameSearchProvider.newTopLevelPackageNamesSearch(pom).search();
    assertEquals(5, packageNames.size());
    assertTrue(packageNames.contains("org.drools.a"));
    assertTrue(packageNames.contains("org.drools.b"));
    assertTrue(packageNames.contains("org.drools.c"));
    assertTrue(packageNames.contains("junit.a"));
    assertTrue(packageNames.contains("junit.b"));
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) POM(org.guvnor.common.services.project.model.POM) Test(org.junit.Test)

Aggregations

Dependency (org.guvnor.common.services.project.model.Dependency)32 GAV (org.guvnor.common.services.project.model.GAV)17 Test (org.junit.Test)16 HashSet (java.util.HashSet)10 NormalEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency)8 EnhancedDependency (org.kie.workbench.common.services.shared.dependencies.EnhancedDependency)6 EnhancedDependencies (org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies)4 POM (org.guvnor.common.services.project.model.POM)3 Set (java.util.Set)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 Artifact (org.apache.maven.artifact.Artifact)1 MavenProject (org.apache.maven.project.MavenProject)1 Dependencies (org.guvnor.common.services.project.model.Dependencies)1 Before (org.junit.Before)1 Util.makeDependency (org.kie.workbench.common.screens.projecteditor.client.forms.dependencies.Util.makeDependency)1 DependencyValidator (org.kie.workbench.common.screens.projecteditor.client.forms.dependencies.validation.DependencyValidator)1 TransitiveEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.TransitiveEnhancedDependency)1