Search in sources :

Example 11 with MavenRepositoryCoordinates

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

the class GAVArtifactDescriptorTest method testSerializationOmitsDefaults.

@Test
public void testSerializationOmitsDefaults() {
    MavenRepositoryCoordinates coordinates = new MavenRepositoryCoordinates(TEST_GAV, DEFAULT_CLASSIFIER, DEFAULT_CLASSIFIER);
    subject = new GAVArtifactDescriptor(createP2Descriptor(), coordinates);
    ArtifactDescriptor serialized = new ArtifactDescriptor(subject);
    assertThat(serialized.getProperties().keySet(), not(hasItem("maven-classifier")));
    assertThat(serialized.getProperties().keySet(), not(hasItem("maven-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 12 with MavenRepositoryCoordinates

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

the class GAVArtifactDescriptorTest method testGetLocalRepositoryPathWithDefaults.

@Test
public void testGetLocalRepositoryPathWithDefaults() {
    MavenRepositoryCoordinates coordinates = new MavenRepositoryCoordinates(TEST_GAV, DEFAULT_CLASSIFIER, DEFAULT_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.jar"));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) Test(org.junit.Test)

Example 13 with MavenRepositoryCoordinates

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

the class GAVArtifactDescriptorTest method testCreationFromPlainP2DescriptorForPackedArtifact.

@Test
public void testCreationFromPlainP2DescriptorForPackedArtifact() {
    ArtifactDescriptor input = createP2Descriptor();
    input.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
    // 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", "pack200", "jar.pack.gz")));
}
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 14 with MavenRepositoryCoordinates

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

the class GAVArtifactDescriptorTest method testCreation.

@Test
public void testCreation() {
    MavenRepositoryCoordinates coordinates = new MavenRepositoryCoordinates(TEST_GAV, OTHER_CLASSIFIER, OTHER_EXTENSION);
    subject = new GAVArtifactDescriptor(createP2Descriptor(), coordinates);
    assertThat(subject.getArtifactKey(), is(TEST_KEY));
    assertThat(subject.getMavenCoordinates(), is(coordinates));
}
Also used : MavenRepositoryCoordinates(org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates) Test(org.junit.Test)

Example 15 with MavenRepositoryCoordinates

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

the class GAVArtifactDescriptorTest method testDeserializationWithRedundantDefaultExt.

@Test
public void testDeserializationWithRedundantDefaultExt() {
    ArtifactDescriptor input = createP2Descriptor();
    setGAVProperties(input);
    input.setProperty("maven-extension", DEFAULT_EXTENSION);
    subject = new GAVArtifactDescriptor(input);
    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)

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