Search in sources :

Example 11 with Dependency

use of org.guvnor.common.services.project.model.Dependency 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 12 with Dependency

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

the class EnhancedDependenciesManagerTest method testAdd.

@Test
public void testAdd() throws Exception {
    final Dependency dependency = makeDependency("artifactId", "groupId", "1.0");
    enhancedDependenciesManager.addNew(dependency);
    verify(dependencyLoader).load();
    assertEquals(1, originalSetOfDependencies.size());
}
Also used : NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) Dependency(org.guvnor.common.services.project.model.Dependency) Test(org.junit.Test)

Example 13 with Dependency

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

the class EnhancedDependenciesManagerTest method makeDependency.

private Dependency makeDependency(final String artifactId, final String groupId, final String version) {
    final Dependency dependency = new Dependency();
    dependency.setArtifactId(artifactId);
    dependency.setGroupId(groupId);
    dependency.setVersion(version);
    return dependency;
}
Also used : NormalEnhancedDependency(org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency) Dependency(org.guvnor.common.services.project.model.Dependency)

Example 14 with Dependency

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

the class NewDependencyPopupValidationTest method testFillValidDependency.

@Test
public void testFillValidDependency() throws Exception {
    fillInValidGAV();
    final Dependency dependency = userClicksOk();
    assertEquals("groupID", dependency.getGroupId());
    assertEquals("myArtifactID", dependency.getArtifactId());
    assertEquals("1.0", dependency.getVersion());
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) Test(org.junit.Test)

Example 15 with Dependency

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

the class Util method makeDependency.

public static Dependency makeDependency(final String artifactId, final String groupId, final String version) {
    final Dependency dependency = new Dependency();
    dependency.setArtifactId(artifactId);
    dependency.setGroupId(groupId);
    dependency.setVersion(version);
    return dependency;
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency)

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