Search in sources :

Example 1 with Dependencies

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

the class EnhancedDependenciesManagerTest method testAddByPOM.

@Test
public void testAddByPOM() throws Exception {
    final Dependency defaultDependency = makeDependency("artifactId", "groupId", "1.0");
    final Dependency compileDependency = makeDependency("artifactId", "groupId", "2.0", "compile");
    final Dependency testDependency = makeDependency("artifactId", "groupId", "3.0", "test");
    final Dependencies dependencies = new Dependencies(Arrays.asList(defaultDependency, compileDependency, testDependency));
    final ArgumentCaptor<Dependency> argumentCaptor = ArgumentCaptor.forClass(Dependency.class);
    pom.setDependencies(dependencies);
    enhancedDependenciesManager.init(pom, callback);
    verify(dependencyLoader, times(2)).addToQueue(argumentCaptor.capture());
    assertEquals(Arrays.asList(defaultDependency, compileDependency), argumentCaptor.getAllValues());
}
Also used : NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) Dependency(org.guvnor.common.services.project.model.Dependency) Dependencies(org.guvnor.common.services.project.model.Dependencies) EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) Test(org.junit.Test)

Example 2 with Dependencies

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

the class EnhancedDependenciesManagerTest method setUp.

@Before
public void setUp() throws Exception {
    originalSetOfDependencies = new Dependencies();
    pom = new POM();
    pom.setDependencies(originalSetOfDependencies);
    enhancedDependenciesManager.init(pom, callback);
}
Also used : Dependencies(org.guvnor.common.services.project.model.Dependencies) EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) POM(org.guvnor.common.services.project.model.POM) Before(org.junit.Before)

Example 3 with Dependencies

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

the class EnhancedDependenciesManager_onEchancedDependenciesLoadedTest method setUp.

@Before
public void setUp() throws Exception {
    shownDependencies = null;
    originalSetOfDependencies = new Dependencies();
    junit = makeDependency("org.junit", "junit", "1.0");
    originalSetOfDependencies.add(junit);
    originalSetOfDependencies.add(makeDependency("org.drools", "drools-core", "4.0"));
    final POM pom = new POM();
    pom.setDependencies(originalSetOfDependencies);
    enhancedDependenciesManager.init(pom, new Callback<EnhancedDependencies>() {

        @Override
        public void callback(final EnhancedDependencies result) {
            shownDependencies = result;
        }
    });
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) Dependencies(org.guvnor.common.services.project.model.Dependencies) EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) POM(org.guvnor.common.services.project.model.POM) Before(org.junit.Before)

Aggregations

Dependencies (org.guvnor.common.services.project.model.Dependencies)3 EnhancedDependencies (org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies)3 POM (org.guvnor.common.services.project.model.POM)2 Before (org.junit.Before)2 Dependency (org.guvnor.common.services.project.model.Dependency)1 Test (org.junit.Test)1 NormalEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency)1