@Override public Collection<ProjectVersionReference> resolveProjectReferences( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException { // TODO: is this assumption correct? could a storage mech. actually know all references in a non-Maven scenario? // not passed to the storage mechanism as resolving references would require iterating all artifacts MetadataRepository metadataRepository = session.getRepository(); return metadataRepository.getProjectReferences( repoId, namespace, projectId, projectVersion ); }
public void revert() { repository.revert(); dirty = false; }
@Override public void deleteAuditEvents( MetadataRepository metadataRepository, String repositoryId ) throws MetadataRepositoryException { metadataRepository.removeMetadataFacets( repositoryId, AuditEvent.FACET_ID ); }
@Override public void completeScan() { repositorySession.close(); }
@Test public void testGetMetadataFacet() throws Exception { repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); TestMetadataFacet test = (TestMetadataFacet) repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); assertEquals( new TestMetadataFacet( TEST_VALUE ), test ); }
@Test public void testGetMetadataFacetWhenUnknownName() throws Exception { repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); assertNull( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, UNKNOWN ) ); }
@Test public void testGetMetadataFacetWhenEmpty() throws Exception { assertNull( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); }
public void save() { repository.save(); dirty = false; }
@Override public boolean hasStatistics( MetadataRepository metadataRepository, String repositoryId ) throws MetadataRepositoryException { return metadataRepository.hasMetadataFacet( repositoryId, DefaultRepositoryStatistics.FACET_ID ); }
private void createArtifactWithMavenArtifactFacet( int artifacts ) throws MetadataRepositoryException, MetadataResolutionException { TestMetadataFacet facet = new TestMetadataFacet( TEST_METADATA_VALUE ); createArtifactWithFacet( artifacts, facet, null ); }
@Override public MetadataFacet createMetadataFacet() { return new TestMetadataFacet( TEST_METADATA_VALUE ); }
private void createArtifactWithMavenArtifactFacet() throws MetadataRepositoryException, MetadataResolutionException { createArtifactWithMavenArtifactFacet( 1 ); }
private void createArtifactWithGenericMetadataFacet() throws MetadataRepositoryException, MetadataResolutionException { createArtifactWithGenericMetadataFacet( 1 ); }
@Override public void completeScan( ) { repositorySession.close( ); }
@Test public void testGetMetadataFacetWhenDefaultValue() throws Exception { repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( null ) ); MetadataFacet metadataFacet = repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); assertEquals( new TestMetadataFacet( TEST_METADATA_VALUE ), metadataFacet ); }
@Override public void deleteStatistics( MetadataRepository metadataRepository, String repositoryId ) throws MetadataRepositoryException { metadataRepository.removeMetadataFacets( repositoryId, DefaultRepositoryStatistics.FACET_ID ); }
@Override public MetadataFacet createMetadataFacet() { return new TestMetadataFacet( "", TEST_VALUE ); }
@Override public void completeScan() { repositorySession.close(); }
@Override public MetadataFacet createMetadataFacet( String repositoryId, String name ) { return new TestMetadataFacet( TEST_METADATA_VALUE ); } } );
@Override public MetadataFacet createMetadataFacet( String repositoryId, String name ) { return new TestMetadataFacet( "", TEST_VALUE ); } } );