use of com.baremaps.blob.ResourceBlobStore in project baremaps by baremaps.
the class ImportUpdateLiechtensteinTest method init.
@BeforeEach
void init() throws SQLException, IOException, URISyntaxException {
dataSource = initDataSource();
blobStore = new ResourceBlobStore();
headerRepository = new PostgresHeaderRepository(dataSource);
nodeRepository = new PostgresNodeRepository(dataSource);
wayRepository = new PostgresWayRepository(dataSource);
relationRepository = new PostgresRelationRepository(dataSource);
}
use of com.baremaps.blob.ResourceBlobStore in project baremaps by baremaps.
the class ImportUpdateDataTest method createRepository.
@BeforeEach
void createRepository() throws SQLException, IOException {
dataSource = initDataSource();
blobStore = new ResourceBlobStore();
headerRepository = new PostgresHeaderRepository(dataSource);
nodeRepository = new PostgresNodeRepository(dataSource);
wayRepository = new PostgresWayRepository(dataSource);
relationRepository = new PostgresRelationRepository(dataSource);
}
use of com.baremaps.blob.ResourceBlobStore in project baremaps by baremaps.
the class ImportUpdateMonacoTest method init.
@BeforeEach
void init() throws SQLException, IOException {
dataSource = initDataSource();
blobStore = new ResourceBlobStore();
headerRepository = new PostgresHeaderRepository(dataSource);
nodeRepository = new PostgresNodeRepository(dataSource);
wayRepository = new PostgresWayRepository(dataSource);
relationRepository = new PostgresRelationRepository(dataSource);
}
use of com.baremaps.blob.ResourceBlobStore in project baremaps by baremaps.
the class SaveBlockConsumerTest method test.
@Test
@Tag("integration")
void test() throws BlobStoreException, RepositoryException, URISyntaxException {
// Import data
SaveBlockConsumer dataImporter = new SaveBlockConsumer(headerRepository, nodeRepository, tableRepository, relationRepository);
InputStream inputStream = new ResourceBlobStore().get(new URI("res://simple/data.osm.pbf")).getInputStream();
new OsmPbfParser().blocks(inputStream).forEach(dataImporter);
// Check node importation
assertNull(nodeRepository.get(0l));
assertNotNull(nodeRepository.get(1l));
assertNotNull(nodeRepository.get(2l));
assertNotNull(nodeRepository.get(3l));
assertNull(nodeRepository.get(4l));
// Check way importation
assertNull(tableRepository.get(0l));
assertNotNull(tableRepository.get(1l));
assertNull(tableRepository.get(2l));
// Check relation importation
assertNull(relationRepository.get(0l));
assertNotNull(relationRepository.get(1l));
assertNull(relationRepository.get(2l));
}
Aggregations