Search in sources :

Example 1 with MediaObjectMetadataWriter

use of org.vitrivr.cineast.core.db.dao.writer.MediaObjectMetadataWriter in project cineast by vitrivr.

the class MetadataTest method setupTest.

@BeforeEach
void setupTest() {
    /* Open all readers. */
    this.objSelector = this.provider.getSelector();
    this.segSelector = this.provider.getSelector();
    this.objReader = new MediaObjectMetadataReader(this.objSelector, this.testObjMetaTableName);
    this.segReader = new MediaSegmentMetadataReader(this.segSelector, this.testSegMetaTableName);
    /* Test database connection. */
    LOGGER.info("Trying to establish connection to Database");
    if (!objSelector.ping()) {
        LOGGER.error("Connection to DB could not be established, failing test using assumeTrue()");
    }
    assumeTrue(objSelector.ping(), "Connection to database could not be established");
    LOGGER.info("Connection to Database established");
    /* Open all writers. */
    this.ec = provider.getEntityCreator();
    this.objPersWriter = provider.getPersistencyWriter();
    this.segPersWriter = provider.getPersistencyWriter();
    this.objWriter = new MediaObjectMetadataWriter(objPersWriter, testObjMetaTableName);
    this.segWriter = new MediaSegmentMetadataWriter(segPersWriter, testSegMetaTableName);
    /* Prepare databases. */
    dropTables();
    createTables();
    fillMetadata();
    finishSetup();
}
Also used : MediaSegmentMetadataReader(org.vitrivr.cineast.core.db.dao.reader.MediaSegmentMetadataReader) MediaSegmentMetadataWriter(org.vitrivr.cineast.core.db.dao.writer.MediaSegmentMetadataWriter) MediaObjectMetadataWriter(org.vitrivr.cineast.core.db.dao.writer.MediaObjectMetadataWriter) MediaObjectMetadataReader(org.vitrivr.cineast.core.db.dao.reader.MediaObjectMetadataReader) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)1 MediaObjectMetadataReader (org.vitrivr.cineast.core.db.dao.reader.MediaObjectMetadataReader)1 MediaSegmentMetadataReader (org.vitrivr.cineast.core.db.dao.reader.MediaSegmentMetadataReader)1 MediaObjectMetadataWriter (org.vitrivr.cineast.core.db.dao.writer.MediaObjectMetadataWriter)1 MediaSegmentMetadataWriter (org.vitrivr.cineast.core.db.dao.writer.MediaSegmentMetadataWriter)1