Search in sources :

Example 26 with Dependency

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

the class DependencyValidatorTest method testGroupId.

@Test
public void testGroupId() throws Exception {
    DependencyValidator dependencyValidator = new DependencyValidator(new Dependency(new GAV(null, "artifactId", "1.0")));
    assertFalse(dependencyValidator.validate());
    assertEquals("DependencyIsMissingAGroupId", dependencyValidator.getMessage());
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) Test(org.junit.Test)

Example 27 with Dependency

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

the class EnhancedDependenciesAsListTest method addDroolsCompiler.

public void addDroolsCompiler() {
    droolsCompilerNormalDependency = new NormalEnhancedDependency(new Dependency(new GAV("org.drools:drools-compiler:1.3")), new HashSet<>());
    droolsApiTransitiveDependency2 = new TransitiveEnhancedDependency(new Dependency(new GAV("org.drools:drools-api:1.0")), new HashSet<>());
    droolsCompilerNormalDependency.addTransitiveDependency(droolsApiTransitiveDependency2);
    enhancedDependencies.add(droolsCompilerNormalDependency);
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) HashSet(java.util.HashSet)

Example 28 with Dependency

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

the class EnhancedDependenciesAsListTest method addXStream.

private void addXStream() {
    xstreamNormalDependency = new NormalEnhancedDependency(new Dependency(new GAV("org.xstream:xstream:1.0")), new HashSet<>());
    enhancedDependencies.add(xstreamNormalDependency);
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) HashSet(java.util.HashSet)

Example 29 with Dependency

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

the class EnhancedDependenciesTest method testUpdate.

@Test
public void testUpdate() throws Exception {
    enhancedDependencies.update(new NormalEnhancedDependency(new Dependency(new GAV("org.hamcrest", "hamcrest-core", "1.3")), new HashSet<String>()));
    NormalEnhancedDependency enhancedDependency = (NormalEnhancedDependency) enhancedDependencies.get(new GAV("org.hamcrest", "hamcrest-core", "1.3"));
    assertTrue(enhancedDependency.getTransitiveDependencies().isEmpty());
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 30 with Dependency

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

the class EnhancedDependenciesTest method testRemoveRemovesByDependencyGAV.

@Test
public void testRemoveRemovesByDependencyGAV() throws Exception {
    assertTrue(enhancedDependencies.remove(new NormalEnhancedDependency(new Dependency(new GAV("org.hamcrest", "hamcrest-core", "1.3")), new HashSet<String>())));
    assertTrue(enhancedDependencies.isEmpty());
}
Also used : Dependency(org.guvnor.common.services.project.model.Dependency) GAV(org.guvnor.common.services.project.model.GAV) 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