use of org.apache.archiva.metadata.repository.jcr.JcrMetadataRepository in project archiva by apache.
the class JcrRepositoryStatisticsGatheringTest method setUp.
@Before
public void setUp() throws Exception {
Map<String, MetadataFacetFactory> factories = AbstractMetadataRepositoryTest.createTestMetadataFacetFactories();
assertNotNull(jcrRepository);
// TODO: probably don't need to use Spring for this
JcrMetadataRepository jcrMetadataRepository = new JcrMetadataRepository(factories, jcrRepository);
session = jcrMetadataRepository.getJcrSession();
try {
session = jcrMetadataRepository.getJcrSession();
// set up namespaces, etc.
JcrMetadataRepository.initialize(session);
// removing content is faster than deleting and re-copying the files from target/jcr
session.getRootNode().getNode("repositories").remove();
} catch (RepositoryException e) {
// ignore
}
this.repository = jcrMetadataRepository;
}
Aggregations