use of org.apache.archiva.metadata.repository.DefaultMetadataResolver in project archiva by apache.
the class JcrRepositoryStatisticsGatheringTest method setupSpec.
@BeforeClass
public static void setupSpec() throws IOException, InvalidFileStoreVersionException {
Path directory = Paths.get("target/test-repositories");
if (Files.exists(directory)) {
org.apache.archiva.common.utils.FileUtils.deleteDirectory(directory);
}
directory = Paths.get("target/jcr");
if (Files.exists(directory)) {
org.apache.archiva.common.utils.FileUtils.deleteDirectory(directory);
}
List<MetadataFacetFactory> factories = AbstractMetadataRepositoryTest.createTestMetadataFacetFactories();
MetadataService metadataService = new MetadataService();
metadataService.setMetadataFacetFactories(factories);
JcrRepositorySessionFactory jcrSessionFactory = new JcrRepositorySessionFactory();
jcrSessionFactory.setMetadataResolver(new DefaultMetadataResolver());
jcrSessionFactory.setMetadataService(metadataService);
jcrSessionFactory.open();
sessionFactory = jcrSessionFactory;
repository = jcrSessionFactory.getMetadataRepository();
}
use of org.apache.archiva.metadata.repository.DefaultMetadataResolver in project archiva by apache.
the class JcrMetadataRepositoryTest method setupSpec.
@BeforeAll
public static void setupSpec() throws IOException, InvalidFileStoreVersionException {
Path directory = Paths.get("target/test-repositories");
if (Files.exists(directory)) {
org.apache.archiva.common.utils.FileUtils.deleteDirectory(directory);
}
List<MetadataFacetFactory> factories = createTestMetadataFacetFactories();
MetadataService metadataService = new MetadataService();
metadataService.setMetadataFacetFactories(factories);
JcrRepositorySessionFactory jcrSessionFactory = new JcrRepositorySessionFactory();
jcrSessionFactory.setMetadataResolver(new DefaultMetadataResolver());
jcrSessionFactory.setMetadataService(metadataService);
jcrSessionFactory.open();
sessionFactory = jcrSessionFactory;
repository = jcrSessionFactory.getMetadataRepository();
}
Aggregations