fix all RepositoryManager implementations

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1423879 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-19 15:21:20 +00:00
parent 58afcb1114
commit e92fede155
12 changed files with 66 additions and 1 deletions

View File

@ -214,4 +214,10 @@ public class TestMetadataRepository
throw new UnsupportedOperationException();
}
public boolean hasMetadataFacet( String repositoryId, String facetId )
throws MetadataRepositoryException
{
return false;
}
}

View File

@ -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

View File

@ -219,4 +219,9 @@ public class TestMetadataRepository
throw new UnsupportedOperationException();
}
public boolean hasMetadataFacet( String repositoryId, String facetId )
throws MetadataRepositoryException
{
return false;
}
}

View File

@ -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
{

View File

@ -377,6 +377,11 @@ public class RepositoryContentConsumersTest
this.invalidRepositoryContentConsumers = invalidRepositoryContentConsumers;
}
public String getApplicationName()
{
return "foo";
}
public AutowireCapableBeanFactory getAutowireCapableBeanFactory( )
throws IllegalStateException
{

View File

@ -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
{

View File

@ -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();

View File

@ -254,4 +254,10 @@ public class TestMetadataRepository
throw new UnsupportedOperationException();
}
public boolean hasMetadataFacet( String repositoryId, String facetId )
throws MetadataRepositoryException
{
return false;
}
}

View File

@ -215,4 +215,10 @@ public class TestMetadataRepository
throw new UnsupportedOperationException();
}
public boolean hasMetadataFacet( String repositoryId, String facetId )
throws MetadataRepositoryException
{
return false;
}
}

View File

@ -230,4 +230,10 @@ public class TestMetadataRepository
throw new UnsupportedOperationException();
}
public boolean hasMetadataFacet( String repositoryId, String facetId )
throws MetadataRepositoryException
{
return false;
}
}

View File

@ -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<String> facets, String prefix, File directory )
{
File[] list = directory.listFiles();

View File

@ -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 )
{