Search in sources :

Example 1 with ResourceBlobStore

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);
}
Also used : ResourceBlobStore(com.baremaps.blob.ResourceBlobStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with ResourceBlobStore

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);
}
Also used : ResourceBlobStore(com.baremaps.blob.ResourceBlobStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with ResourceBlobStore

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);
}
Also used : ResourceBlobStore(com.baremaps.blob.ResourceBlobStore) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with ResourceBlobStore

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));
}
Also used : SaveBlockConsumer(com.baremaps.osm.repository.SaveBlockConsumer) ResourceBlobStore(com.baremaps.blob.ResourceBlobStore) InputStream(java.io.InputStream) URI(java.net.URI) OsmPbfParser(com.baremaps.osm.pbf.OsmPbfParser) Test(org.junit.jupiter.api.Test) Tag(org.junit.jupiter.api.Tag)

Aggregations

ResourceBlobStore (com.baremaps.blob.ResourceBlobStore)4 BeforeEach (org.junit.jupiter.api.BeforeEach)3 OsmPbfParser (com.baremaps.osm.pbf.OsmPbfParser)1 SaveBlockConsumer (com.baremaps.osm.repository.SaveBlockConsumer)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 Tag (org.junit.jupiter.api.Tag)1 Test (org.junit.jupiter.api.Test)1