package org.opencb.opencga.storage.core.variant.dummy;

import org.opencb.opencga.storage.core.config.StorageConfiguration;
import org.opencb.opencga.storage.core.variant.VariantStorageEngine;
import org.opencb.opencga.storage.core.variant.VariantStorageTest;

import java.io.InputStream;

/**
 * Created on 07/09/17.
 *
 * @author Jacobo Coll &lt;jacobo167@gmail.com&gt;
 */
public interface DummyVariantStorageTest extends VariantStorageTest {

    @Override
    default VariantStorageEngine getVariantStorageEngine() throws Exception {
        try (InputStream is = DummyVariantStorageEngine.class.getClassLoader().getResourceAsStream("storage-configuration.yml")) {
            StorageConfiguration storageConfiguration = StorageConfiguration.load(is);
            DummyVariantStorageEngine storageManager = new DummyVariantStorageEngine();
            storageManager.setConfiguration(storageConfiguration, DummyVariantStorageEngine.STORAGE_ENGINE_ID);
            return storageManager;
        }
    }

    @Override
    default void clearDB(String dbName) throws Exception {
        DummyVariantStorageMetadataDBAdaptorFactory.clear();
    }

}

@@ -71,42 +71,168 @@
 ncb.
-opencga.storage.core.config.Storag
+commons.datastore.core.ObjectMap;%0Aimport org.opencb.opencga.storage.core.config.StorageConfiguration;%0Aimport org.opencb.opencga.storage.core.config.StorageEngin
 eCon
@@ -876,16 +876,431 @@
 ad(is);%0A
+            storageConfiguration.getVariant().setDefaultEngine(DummyVariantStorageEngine.STORAGE_ENGINE_ID);%0A            storageConfiguration.getVariant().getEngines().add(new StorageEngineConfiguration()%0A                    .setId(DummyVariantStorageEngine.STORAGE_ENGINE_ID)%0A                    .setEngine(DummyVariantStorageEngine.class.getName())%0A                    .setOptions(new ObjectMap())%0A            );%0A
         

Fix DummyVariantStorageTests. #1412