diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index fbb0cbc44..00cd4d241 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -214,4 +214,10 @@ public class TestMetadataRepository throw new UnsupportedOperationException(); } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java index ca541c130..66838594b 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java @@ -64,6 +64,12 @@ public class MockRepositorySessionFactory return new MetadataRepository() { + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + public void removeArtifact( String repositoryId, String namespace, String project, String projectVersion, MetadataFacet metadataFacet ) throws MetadataRepositoryException diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index 75c94ee99..d7c52cea3 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -219,4 +219,9 @@ public class TestMetadataRepository throw new UnsupportedOperationException(); } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java index a3135e68b..c594a9e75 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java @@ -64,6 +64,12 @@ public class MockRepositorySessionFactory return new MetadataRepository() { + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + public void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion ) throws MetadataRepositoryException { diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java index 301d056f1..b1ab0a727 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java @@ -377,6 +377,11 @@ public class RepositoryContentConsumersTest this.invalidRepositoryContentConsumers = invalidRepositoryContentConsumers; } + public String getApplicationName() + { + return "foo"; + } + public AutowireCapableBeanFactory getAutowireCapableBeanFactory( ) throws IllegalStateException { diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java index 8d54b996f..a42b6aeda 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java @@ -64,6 +64,12 @@ public class MockRepositorySessionFactory return new MetadataRepository() { + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + public void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion ) throws MetadataRepositoryException { diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java index fb867010e..b6f25bec5 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java @@ -234,6 +234,12 @@ public class NewArtifactsRssFeedProcessorTest throw new UnsupportedOperationException(); } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + public void revert() { throw new UnsupportedOperationException(); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java index 5d71b853f..02d428515 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java @@ -254,4 +254,10 @@ public class TestMetadataRepository throw new UnsupportedOperationException(); } + + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } } \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index 16a9795cb..b07884a74 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -215,4 +215,10 @@ public class TestMetadataRepository throw new UnsupportedOperationException(); } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + } diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index dc1e92bde..ba4cc6952 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -230,4 +230,10 @@ public class TestMetadataRepository throw new UnsupportedOperationException(); } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + } \ No newline at end of file diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index 91f148665..0e62fe375 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -309,6 +309,13 @@ public class FileMetadataRepository return facets; } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + // TODO could be improved a bit + return !getMetadataFacets( repositoryId, facetId ).isEmpty(); + } + private void recurse( List facets, String prefix, File directory ) { File[] list = directory.listFiles(); diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java index 7bff556f6..764387ee7 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java @@ -407,7 +407,7 @@ public class JcrMetadataRepository try { Node node = getJcrSession().getRootNode().getNode( getFacetPath( repositoryId, facetId ) ); - return JcrUtils.getChildNodes( node ).iterator().hasNext(); + return node.getNodes().hasNext(); } catch ( PathNotFoundException e ) {