Search in sources :

Example 1 with MavenRepositoryCoordinates

use of org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates in project tycho by eclipse.

the class GAVArtifactDescriptorTest method testExplicitCoordinatesOverwritesProperties.

@Test
public void testExplicitCoordinatesOverwritesProperties() {
    ArtifactDescriptor input = createP2Descriptor();
    setGAVProperties(input);
    input.setProperty("maven-classifier", OTHER_CLASSIFIER);
    input.setProperty("maven-extension", OTHER_EXTENSION);
    MavenRepositoryCoordinates explicitCoordinatesWithDefaults = new MavenRepositoryCoordinates(TEST_GAV, DEFAULT_CLASSIFIER, DEFAULT_EXTENSION);
    GAVArtifactDescriptor original = new GAVArtifactDescriptor(input, explicitCoordinatesWithDefaults);
    subject = serializeAndDeSerialize(original);
    assertThat(subject.getArtifactKey(), is(TEST_KEY));
    assertThat(subject.getMavenCoordinates(), is(explicitCoordinatesWithDefaults));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Example 2 with MavenRepositoryCoordinates

use of org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates in project tycho by eclipse.

the class GAVArtifactDescriptorTest method testDeserializationWithPartialGAV.

@Test
public void testDeserializationWithPartialGAV() {
    ArtifactDescriptor input = createP2Descriptor();
    input.setProperty("maven-groupId", TEST_GAV.getGroupId());
    input.setProperty("maven-artifactId", TEST_GAV.getArtifactId());
    subject = new GAVArtifactDescriptor(input);
    // treated like completely missing properties
    assertThat(subject.getMavenCoordinates(), is(new MavenRepositoryCoordinates("p2.p2.class", "p2.id", "4.3.0.20130614", DEFAULT_CLASSIFIER, DEFAULT_EXTENSION)));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Example 3 with MavenRepositoryCoordinates

use of org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates in project tycho by eclipse.

the class GAVArtifactDescriptorTest method testGetLocalRepositoryPath.

@Test
public void testGetLocalRepositoryPath() {
    MavenRepositoryCoordinates coordinates = new MavenRepositoryCoordinates(TEST_GAV, OTHER_CLASSIFIER, OTHER_EXTENSION);
    subject = new GAVArtifactDescriptor(createP2Descriptor(), coordinates);
    assertThat(subject.getMavenCoordinates().getLocalRepositoryPath(), is("mvn/group/mvn.id/4.3.0-SNAPSHOT/mvn.id-4.3.0-SNAPSHOT-mvn.classifier.mvn.fileextension"));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) Test(org.junit.Test)

Example 4 with MavenRepositoryCoordinates

use of org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates in project tycho by eclipse.

the class GAVArtifactDescriptorTest method testDeserialization.

@Test
public void testDeserialization() {
    // parsing to p2's implementation of IArtifactDescriptor is done elsewhere, so assume this is the input
    ArtifactDescriptor input = createP2Descriptor();
    input.setProperty("maven-groupId", TEST_GAV.getGroupId());
    input.setProperty("maven-artifactId", TEST_GAV.getArtifactId());
    input.setProperty("maven-version", TEST_GAV.getVersion());
    subject = new GAVArtifactDescriptor(input);
    assertThat(subject.getArtifactKey(), is(TEST_KEY));
    assertThat(subject.getMavenCoordinates(), is(new MavenRepositoryCoordinates(TEST_GAV, DEFAULT_CLASSIFIER, DEFAULT_EXTENSION)));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Example 5 with MavenRepositoryCoordinates

use of org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates in project tycho by eclipse.

the class GAVArtifactDescriptorTest method testCreationFromPlainP2Descriptor.

@Test
public void testCreationFromPlainP2Descriptor() {
    ArtifactDescriptor input = createP2Descriptor();
    // no maven properties set
    subject = new GAVArtifactDescriptor(input);
    assertThat(subject.getArtifactKey(), is(TEST_KEY));
    assertThat(subject.getMavenCoordinates(), is(new MavenRepositoryCoordinates("p2.p2.class", "p2.id", "4.3.0.20130614", DEFAULT_CLASSIFIER, DEFAULT_EXTENSION)));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) IArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor) ArtifactDescriptor(org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor) Test(org.junit.Test)

Aggregations

MavenRepositoryCoordinates (org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates)16 Test (org.junit.Test)12 IArtifactDescriptor (org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor)8 ArtifactDescriptor (org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor)8 GAV (org.eclipse.tycho.p2.repository.GAV)2 ModuleArtifactDescriptor (org.eclipse.tycho.repository.module.ModuleArtifactRepository.ModuleArtifactDescriptor)2 ProvisionException (org.eclipse.equinox.p2.core.ProvisionException)1 ClassifierAndExtension (org.eclipse.tycho.repository.publishing.WriteSessionContext.ClassifierAndExtension)1