public class TestGoraVertexOutputFormat {
@Test
public void getWritingDb() throws Exception {
Iterable<String> results;
GiraphConfiguration conf = new GiraphConfiguration();
GIRAPH_GORA_DATASTORE_CLASS.
set(conf, "org.apache.gora.memory.store.MemStore");
GIRAPH_GORA_KEYS_FACTORY_CLASS.
set(conf,"org.apache.giraph.io.gora.utils.DefaultKeyFactory");
GIRAPH_GORA_KEY_CLASS.set(conf,"java.lang.String");
GIRAPH_GORA_PERSISTENT_CLASS.
set(conf,"org.apache.giraph.io.gora.generated.GVertex");
GIRAPH_GORA_START_KEY.set(conf,"1");
GIRAPH_GORA_END_KEY.set(conf,"10");
GIRAPH_GORA_OUTPUT_DATASTORE_CLASS.
set(conf, "org.apache.gora.memory.store.MemStore");
GIRAPH_GORA_OUTPUT_KEY_CLASS.set(conf, "java.lang.String");
GIRAPH_GORA_OUTPUT_PERSISTENT_CLASS.
set(conf, "org.apache.giraph.io.gora.generated.GVertex");
conf.set("io.serializations",
"org.apache.hadoop.io.serializer.WritableSerialization," +
"org.apache.hadoop.io.serializer.JavaSerialization");
conf.setComputationClass(EmptyComputation.class);
conf.setVertexInputFormatClass(GoraTestVertexInputFormat.class);
// Parameters for output
GIRAPH_GORA_OUTPUT_DATASTORE_CLASS.
set(conf, "org.apache.gora.memory.store.MemStore");
GIRAPH_GORA_OUTPUT_KEY_CLASS.set(conf, "java.lang.String");
GIRAPH_GORA_OUTPUT_PERSISTENT_CLASS.
set(conf,"org.apache.giraph.io.gora.generated.GVertex");
conf.setVertexOutputFormatClass(GoraTestVertexOutputFormat.class);
results = InternalVertexRunner.run(conf, new String[0], new String[0]);
Assert.assertNotNull(results);
}