use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor 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));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor 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)));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class GAVArtifactDescriptorTest method serializeAndDeSerialize.
private static GAVArtifactDescriptor serializeAndDeSerialize(GAVArtifactDescriptor original) {
ArtifactDescriptor serialized = new ArtifactDescriptor(original);
GAVArtifactDescriptor deserialized = new GAVArtifactDescriptor(serialized);
return deserialized;
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor 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)));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor 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)));
}
Aggregations