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));
}
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)));
}
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"));
}
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)));
}
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)));
}
Aggregations