Search in sources :

Example 11 with Database

use of net.morimekta.test.providence.config.Database in project providence by morimekta.

the class ProvidenceConfigTest method testGetConfig.

@Test
public void testGetConfig() throws IOException {
    File f_stage_db = copyResourceTo("/net/morimekta/providence/config/files/stage_db.cfg", temp.getRoot());
    ProvidenceConfig config = new ProvidenceConfig(registry, null, true);
    Database stage_db = config.getConfig(f_stage_db);
    assertEquals("{\n" + "  uri = \"jdbc:h2:localhost:mem\"\n" + "  driver = \"org.h2.Driver\"\n" + "  credentials = {\n" + "    username = \"myuser\"\n" + "    password = \"MyP4s5w0rd\"\n" + "  }\n" + "}", debugString(stage_db));
}
Also used : Database(net.morimekta.test.providence.config.Database) File(java.io.File) Test(org.junit.Test)

Aggregations

Database (net.morimekta.test.providence.config.Database)11 Test (org.junit.Test)11 File (java.io.File)8 FileWatcher (net.morimekta.util.FileWatcher)3 Pair (net.morimekta.util.Pair)3 ProvidenceConfigException (net.morimekta.providence.config.ProvidenceConfigException)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Set (java.util.Set)1 TreeMap (java.util.TreeMap)1 ProvidenceConfigUtil.asCollection (net.morimekta.providence.config.impl.ProvidenceConfigUtil.asCollection)1 ProvidenceConfigUtil.asMap (net.morimekta.providence.config.impl.ProvidenceConfigUtil.asMap)1 ProvidenceConfigUtil.asString (net.morimekta.providence.config.impl.ProvidenceConfigUtil.asString)1 TestConfigSupplier (net.morimekta.providence.config.util.TestConfigSupplier)1 PMap (net.morimekta.providence.descriptor.PMap)1