Search in sources :

Example 1 with DataFileAvroStore

use of org.apache.gora.avro.store.DataFileAvroStore in project gora by apache.

the class TestDataStoreFactory method testFindProperty.

@Test
public void testFindProperty() {
    Properties properties = DataStoreFactory.createProps();
    DataStore<String, MockPersistent> store = new DataFileAvroStore<>();
    String fooValue = DataStoreFactory.findProperty(properties, store, "foo_property", "foo_default");
    assertEquals("foo_value", fooValue);
    String bazValue = DataStoreFactory.findProperty(properties, store, "baz_property", "baz_default");
    assertEquals("baz_value", bazValue);
    String barValue = DataStoreFactory.findProperty(properties, store, "bar_property", "bar_default");
    assertEquals("bar_value", barValue);
    String capValue = DataStoreFactory.findProperty(properties, store, "cap_property", "cap_default");
    assertEquals("cap_value", capValue);
    String secondCapValue = DataStoreFactory.findProperty(properties, store, "CAP_property", "cap_default");
    assertEquals("cap_value", secondCapValue);
}
Also used : DataFileAvroStore(org.apache.gora.avro.store.DataFileAvroStore) Properties(java.util.Properties) MockPersistent(org.apache.gora.mock.persistency.MockPersistent) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 DataFileAvroStore (org.apache.gora.avro.store.DataFileAvroStore)1 MockPersistent (org.apache.gora.mock.persistency.MockPersistent)1 Test (org.junit.Test)1