Search in sources :

Example 1 with DslOriginDependencyMetadata

use of org.gradle.internal.component.local.model.DslOriginDependencyMetadata in project gradle by gradle.

the class ExternalModuleDependencyDescriptorFactoryTest method testAddWithNullGroupAndNullVersionShouldHaveEmptyStringModuleRevisionValues.

@Test
public void testAddWithNullGroupAndNullVersionShouldHaveEmptyStringModuleRevisionValues() {
    ModuleDependency dependency = new DefaultExternalModuleDependency(null, "gradle-core", null, TEST_DEP_CONF);
    DslOriginDependencyMetadata dependencyMetaData = externalModuleDependencyDescriptorFactory.createDependencyDescriptor(TEST_CONF, null, dependency);
    assertThat(dependencyMetaData.getRequested().getGroup(), equalTo(""));
    assertThat(dependencyMetaData.getRequested().getName(), equalTo("gradle-core"));
    assertThat(dependencyMetaData.getRequested().getVersion(), equalTo(""));
}
Also used : ExternalModuleDependency(org.gradle.api.artifacts.ExternalModuleDependency) DefaultExternalModuleDependency(org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency) ModuleDependency(org.gradle.api.artifacts.ModuleDependency) DslOriginDependencyMetadata(org.gradle.internal.component.local.model.DslOriginDependencyMetadata) DefaultExternalModuleDependency(org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency) Test(org.junit.Test)

Example 2 with DslOriginDependencyMetadata

use of org.gradle.internal.component.local.model.DslOriginDependencyMetadata in project gradle by gradle.

the class ExternalModuleDependencyDescriptorFactoryTest method testCreateFromModuleDependency.

@Test
public void testCreateFromModuleDependency() {
    DefaultExternalModuleDependency moduleDependency = new DefaultExternalModuleDependency("org.gradle", "gradle-core", "1.0", TEST_DEP_CONF);
    setUpDependency(moduleDependency);
    DslOriginDependencyMetadata dependencyMetaData = externalModuleDependencyDescriptorFactory.createDependencyDescriptor(TEST_CONF, null, moduleDependency);
    assertEquals(moduleDependency.isChanging(), dependencyMetaData.isChanging());
    assertEquals(moduleDependency.isForce(), dependencyMetaData.isForce());
    assertEquals(moduleDependency.getGroup(), dependencyMetaData.getRequested().getGroup());
    assertEquals(moduleDependency.getName(), dependencyMetaData.getRequested().getName());
    assertEquals(moduleDependency.getVersion(), dependencyMetaData.getRequested().getVersion());
    assertDependencyDescriptorHasCommonFixtureValues(dependencyMetaData);
}
Also used : DslOriginDependencyMetadata(org.gradle.internal.component.local.model.DslOriginDependencyMetadata) DefaultExternalModuleDependency(org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency) Test(org.junit.Test)

Aggregations

DefaultExternalModuleDependency (org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency)2 DslOriginDependencyMetadata (org.gradle.internal.component.local.model.DslOriginDependencyMetadata)2 Test (org.junit.Test)2 ExternalModuleDependency (org.gradle.api.artifacts.ExternalModuleDependency)1 ModuleDependency (org.gradle.api.artifacts.ModuleDependency)1