Search in sources :

Example 6 with RepositoryStorageMetadataInvalidException

use of org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException in project archiva by apache.

the class Maven2RepositoryMetadataResolverTest method testGetProjectVersionMetadataForMislocatedPom.

@Test
public void testGetProjectVersionMetadataForMislocatedPom() throws Exception {
    try {
        storage.readProjectVersionMetadata(new ReadMetadataRequest(TEST_REPO_ID, "com.example.test", "mislocated-pom", "1.0"));
        fail("Should have received an exception due to mislocated POM");
    } catch (RepositoryStorageMetadataInvalidException e) {
        assertEquals("mislocated-pom", e.getId());
    }
}
Also used : ReadMetadataRequest(org.apache.archiva.metadata.repository.storage.ReadMetadataRequest) RepositoryStorageMetadataInvalidException(org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException) Test(org.junit.Test)

Aggregations

RepositoryStorageMetadataInvalidException (org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException)6 ReadMetadataRequest (org.apache.archiva.metadata.repository.storage.ReadMetadataRequest)5 ProjectVersionMetadata (org.apache.archiva.metadata.model.ProjectVersionMetadata)4 RepositoryStorageMetadataNotFoundException (org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException)4 RepositoryStorageRuntimeException (org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException)4 RepositoryListener (org.apache.archiva.repository.events.RepositoryListener)2 Test (org.junit.Test)2 FileNotFoundException (java.io.FileNotFoundException)1 NoSuchFileException (java.nio.file.NoSuchFileException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 RepositoryAdminException (org.apache.archiva.admin.model.RepositoryAdminException)1 NetworkProxy (org.apache.archiva.admin.model.beans.NetworkProxy)1 ProxyConnector (org.apache.archiva.admin.model.beans.ProxyConnector)1 ArtifactMetadata (org.apache.archiva.metadata.model.ArtifactMetadata)1 ProjectMetadata (org.apache.archiva.metadata.model.ProjectMetadata)1 ProjectVersionReference (org.apache.archiva.metadata.model.ProjectVersionReference)1 RepositoryProblemFacet (org.apache.archiva.metadata.model.facets.RepositoryProblemFacet)1