Search in sources :

Example 1 with MockAbstractDataAdapter

use of org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter in project geowave by locationtech.

the class DataStoreAddTest method addIndex_SameIndexVarArgs.

@Test
public void addIndex_SameIndexVarArgs() {
    final NullIndex index1 = new NullIndex("index1");
    final NullIndex index2 = new NullIndex("index2");
    final MockAbstractDataAdapter adapter = new MockAbstractDataAdapter(MOCK_DATA_TYPE_1);
    dataStore.addType(adapter, index1);
    dataStore.addIndex(MOCK_DATA_TYPE_1, index2, index2, index2);
    assertEquals(2, dataStore.getIndices(MOCK_DATA_TYPE_1).length);
}
Also used : MockAbstractDataAdapter(org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter) NullIndex(org.locationtech.geowave.core.store.index.NullIndex) Test(org.junit.Test)

Example 2 with MockAbstractDataAdapter

use of org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter in project geowave by locationtech.

the class DataStoreAddTest method addIndex_IndexAlreadyAdded.

@Test
public void addIndex_IndexAlreadyAdded() {
    final NullIndex index1 = new NullIndex("index1");
    final MockAbstractDataAdapter adapter = new MockAbstractDataAdapter(MOCK_DATA_TYPE_1);
    dataStore.addType(adapter, index1);
    dataStore.addIndex(MOCK_DATA_TYPE_1, index1);
    assertEquals(1, dataStore.getIndices(MOCK_DATA_TYPE_1).length);
}
Also used : MockAbstractDataAdapter(org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter) NullIndex(org.locationtech.geowave.core.store.index.NullIndex) Test(org.junit.Test)

Example 3 with MockAbstractDataAdapter

use of org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter in project geowave by locationtech.

the class DataStoreAddTest method createWriter_SeenTypeWriteNoError.

@Test
public void createWriter_SeenTypeWriteNoError() {
    final NullIndex index = new NullIndex("myIndex");
    final MockAbstractDataAdapter adapter = new MockAbstractDataAdapter(MOCK_DATA_TYPE_1);
    dataStore.addType(adapter, index);
    final Writer<Integer> writer = dataStore.createWriter(MOCK_DATA_TYPE_1);
    writer.write(15);
    writer.write(0);
    writer.close();
}
Also used : MockAbstractDataAdapter(org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter) NullIndex(org.locationtech.geowave.core.store.index.NullIndex) Test(org.junit.Test)

Example 4 with MockAbstractDataAdapter

use of org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter in project geowave by locationtech.

the class DataStoreAddTest method createWriter_NonNullForSeenType.

@Test
public void createWriter_NonNullForSeenType() {
    final NullIndex index = new NullIndex("myIndex");
    final MockAbstractDataAdapter adapter = new MockAbstractDataAdapter(MOCK_DATA_TYPE_1);
    dataStore.addType(adapter, index);
    final Writer<Integer> writer = dataStore.createWriter(MOCK_DATA_TYPE_1);
    assertNotNull(writer);
}
Also used : MockAbstractDataAdapter(org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter) NullIndex(org.locationtech.geowave.core.store.index.NullIndex) Test(org.junit.Test)

Example 5 with MockAbstractDataAdapter

use of org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter in project geowave by locationtech.

the class DataStoreAddTest method addType_Basic.

@Test
public void addType_Basic() {
    final NullIndex index = new NullIndex("myIndex");
    final MockAbstractDataAdapter adapter = new MockAbstractDataAdapter(MOCK_DATA_TYPE_1);
    dataStore.addType(adapter, index);
    final DataTypeAdapter<?>[] registeredTypes = dataStore.getTypes();
    assertEquals(1, registeredTypes.length);
    assertTrue(registeredTypes[0] instanceof MockAbstractDataAdapter);
}
Also used : MockAbstractDataAdapter(org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter) NullIndex(org.locationtech.geowave.core.store.index.NullIndex) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 MockAbstractDataAdapter (org.locationtech.geowave.core.store.adapter.MockComponents.MockAbstractDataAdapter)11 NullIndex (org.locationtech.geowave.core.store.index.NullIndex)11