Search in sources :

Example 1 with EnhancedDependencies

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies in project kie-wb-common by kiegroup.

the class DependencyLoader method returnDefault.

private void returnDefault() {
    final EnhancedDependencies enhancedDependencies = new EnhancedDependencies();
    for (final Dependency dependency : updateQueue) {
        enhancedDependencies.add(new NormalEnhancedDependency(dependency, new HashSet<>()));
    }
    updateQueue.clear();
    manager.onEnhancedDependenciesUpdated(enhancedDependencies);
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) Dependency(org.guvnor.common.services.project.model.Dependency) NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) HashSet(java.util.HashSet)

Example 2 with EnhancedDependencies

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies in project kie-wb-common by kiegroup.

the class DependencyLoaderLoadFailureTest method testFailureOnLoad.

@Test
public void testFailureOnLoad() throws Exception {
    dependencyLoader.addToQueue(makeDependency("org.junit", "junit", "1.0"));
    dependencyLoader.load();
    failLoad();
    final EnhancedDependencies enhancedDependencies = getUpdatedEnhancedDependencies();
    verify(view).showBusyIndicator("Loading");
    verify(view).hideBusyIndicator();
    assertEquals(1, enhancedDependencies.size());
    assertNotNull(enhancedDependencies.get(new GAV("org.junit", "junit", "1.0")));
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) GAV(org.guvnor.common.services.project.model.GAV) Test(org.junit.Test)

Example 3 with EnhancedDependencies

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies in project kie-wb-common by kiegroup.

the class DependencyLoaderTest method testLoadEmptyQueue.

@Test
public void testLoadEmptyQueue() throws Exception {
    dependencyLoader.load();
    final EnhancedDependencies enhancedDependencies = getUpdatedEnhancedDependencies();
    assertTrue(enhancedDependencies.isEmpty());
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) Test(org.junit.Test)

Example 4 with EnhancedDependencies

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies in project kie-wb-common by kiegroup.

the class EnhancedDependenciesManager_onEchancedDependenciesLoadedTest method testShowEmpty.

@Test
public void testShowEmpty() throws Exception {
    originalSetOfDependencies.clear();
    enhancedDependenciesManager.onEnhancedDependenciesUpdated(new EnhancedDependencies());
    assertNotNull(shownDependencies);
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) Test(org.junit.Test)

Example 5 with EnhancedDependencies

use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies in project kie-wb-common by kiegroup.

the class DependencyLoaderTest method testAdd.

@Test
public void testAdd() throws Exception {
    final EnhancedDependencies enhancedDependencies = new EnhancedDependencies();
    when(dependencyService.loadEnhancedDependencies(anyCollection())).thenReturn(enhancedDependencies);
    dependencyLoader.addToQueue(makeDependency("artifactId", "groupId", "1.0"));
    dependencyLoader.load();
    verify(view).showBusyIndicator("Loading");
    verify(view).hideBusyIndicator();
    final EnhancedDependencies updatedEnhancedDependencies = getUpdatedEnhancedDependencies();
    assertEquals(enhancedDependencies, updatedEnhancedDependencies);
}
Also used : EnhancedDependencies(org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies) Test(org.junit.Test)

Aggregations

EnhancedDependencies (org.kie.workbench.common.services.shared.dependencies.EnhancedDependencies)11 Test (org.junit.Test)8 HashSet (java.util.HashSet)5 NormalEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency)5 Dependency (org.guvnor.common.services.project.model.Dependency)3 EnhancedDependency (org.kie.workbench.common.services.shared.dependencies.EnhancedDependency)2 Callback (org.uberfire.client.callbacks.Callback)2 Dependencies (org.guvnor.common.services.project.model.Dependencies)1 GAV (org.guvnor.common.services.project.model.GAV)1 POM (org.guvnor.common.services.project.model.POM)1 Before (org.junit.Before)1 Util.makeDependency (org.kie.workbench.common.screens.projecteditor.client.forms.dependencies.Util.makeDependency)1