use of org.apache.archiva.metadata.repository.storage.ReadMetadataRequest in project archiva by apache.
the class Maven2RepositoryMetadataResolverManagedSnapshotTest method testModelWithJdkProfileActivation.
@Test(expected = RepositoryStorageRuntimeException.class)
@Override
public void testModelWithJdkProfileActivation() throws Exception {
// skygo IMHO must fail because TEST_REPO_ID ( is snap ,no release) and we seek for a snapshot
ReadMetadataRequest readMetadataRequest = new ReadMetadataRequest().repositoryId(TEST_REPO_ID).namespace("org.apache.maven").projectId("maven-archiver").projectVersion("2.4.1");
ProjectVersionMetadata metadata = storage.readProjectVersionMetadata(readMetadataRequest);
}
use of org.apache.archiva.metadata.repository.storage.ReadMetadataRequest in project archiva by apache.
the class Maven2RepositoryMetadataResolverTest method testGetProjectVersionMetadataForInvalidPom.
@Test
public void testGetProjectVersionMetadataForInvalidPom() throws Exception {
try {
storage.readProjectVersionMetadata(new ReadMetadataRequest(TEST_REPO_ID, "com.example.test", "invalid-pom", "1.0"));
fail("Should have received an exception due to invalid POM");
} catch (RepositoryStorageMetadataInvalidException e) {
assertEquals("invalid-pom", e.getId());
}
}
use of org.apache.archiva.metadata.repository.storage.ReadMetadataRequest in project archiva by apache.
the class Maven2RepositoryMetadataResolverTest method testGetProjectVersionMetadataForTimestampedSnapshot.
@Test
public void testGetProjectVersionMetadataForTimestampedSnapshot() throws Exception {
ProjectVersionMetadata metadata = storage.readProjectVersionMetadata(new ReadMetadataRequest(TEST_REPO_ID, "org.apache", "apache", "5-SNAPSHOT"));
MavenProjectFacet facet = MavenProjectFacet.class.cast(metadata.getFacet(MavenProjectFacet.FACET_ID));
assertEquals("pom", facet.getPackaging());
assertEquals("http://www.apache.org/", metadata.getUrl());
assertNull(facet.getParent());
assertEquals("org.apache", facet.getGroupId());
assertEquals("apache", facet.getArtifactId());
assertNull(metadata.getCiManagement());
assertNotNull(metadata.getDescription());
// TODO: this would be better
// assertEquals(
// "The Apache Software Foundation provides support for the Apache community of open-source software projects. " +
// "The Apache projects are characterized by a collaborative, consensus based development process, an open " +
// "and pragmatic software license, and a desire to create high quality software that leads the way in its " +
// "field. We consider ourselves not simply a group of projects sharing a server, but rather a community of " +
// "developers and users.", metadata.getDescription() );
assertEquals("5-SNAPSHOT", metadata.getId());
assertNull(metadata.getIssueManagement());
checkApacheLicense(metadata);
assertEquals("The Apache Software Foundation", metadata.getName());
String path = "maven/pom/trunk/asf";
assertEquals(ASF_SCM_CONN_BASE + path, metadata.getScm().getConnection());
assertEquals(ASF_SCM_DEV_CONN_BASE + path, metadata.getScm().getDeveloperConnection());
assertEquals(ASF_SCM_VIEWVC_BASE + path, metadata.getScm().getUrl());
checkOrganizationApache(metadata);
assertEquals(1, metadata.getMailingLists().size());
assertMailingList(metadata.getMailingLists().get(0), "Apache Announce List", "http://mail-archives.apache.org/mod_mbox/www-announce/", "announce@apache.org", "announce-subscribe@apache.org", "announce-unsubscribe@apache.org", Collections.<String>emptyList(), true);
assertEquals(Collections.<Dependency>emptyList(), metadata.getDependencies());
}
use of org.apache.archiva.metadata.repository.storage.ReadMetadataRequest in project archiva by apache.
the class Maven2RepositoryMetadataResolverTest method testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata.
@Test
public void testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata() throws Exception {
try {
storage.readProjectVersionMetadata(new ReadMetadataRequest(TEST_REPO_ID, "com.example.test", "incomplete-metadata", "1.0-SNAPSHOT"));
fail("Should not be found");
} catch (RepositoryStorageMetadataNotFoundException e) {
assertEquals("missing-pom", e.getId());
}
}
use of org.apache.archiva.metadata.repository.storage.ReadMetadataRequest in project archiva by apache.
the class Maven2RepositoryMetadataResolverTest method testGetProjectVersionMetadataForMissingPom.
@Test
public void testGetProjectVersionMetadataForMissingPom() throws Exception {
try {
storage.readProjectVersionMetadata(new ReadMetadataRequest(TEST_REPO_ID, "com.example.test", "missing-pom", "1.0"));
fail("Should not be found");
} catch (RepositoryStorageMetadataNotFoundException e) {
assertEquals("missing-pom", e.getId());
}
}
Aggregations