@Test
 public void shouldNotDeriveMemoryIfToldSo() throws Exception {
   final GiraphGraphProvider provider = new GiraphGraphProvider();
   final Map<String, Object> map =
       provider.getBaseConfiguration(
           "gremlin.giraph",
           GiraphGraphComputerIntegrateTest.class,
           "shouldNotDeriveMemoryIfToldSo");
   map.put(Constants.GREMLIN_DERIVE_MEMORY, false);
   final GiraphGraph g = (GiraphGraph) GraphFactory.open(map);
   provider.loadGraphData(g, LoadGraphWith.GraphData.CLASSIC);
   final ComputerResult result =
       g.compute()
           .program(
               LambdaVertexProgram.build()
                   .setup(memory -> {})
                   .execute((vertex, messenger, memory) -> {})
                   .terminate(memory -> memory.getIteration() > 2)
                   .create())
           .submit()
           .get();
   assertEquals(result.getMemory().getIteration(), -1);
 }
示例#2
0
 /**
  * Creates a new {@link com.tinkerpop.gremlin.structure.Graph} instance from the Configuration
  * object using {@link com.tinkerpop.gremlin.structure.util.GraphFactory}. The assumption here is
  * that the {@code Configuration} has been created by one of the {@link
  * #newGraphConfiguration(String, Class, String)} methods and has therefore already been modified
  * by the implementation as necessary for {@link Graph} creation.
  */
 public default Graph openTestGraph(final Configuration config, final GraphStrategy strategy) {
   return null == strategy ? GraphFactory.open(config) : GraphFactory.open(config, strategy);
 }
示例#3
0
 /**
  * Creates a new {@link com.tinkerpop.gremlin.structure.Graph} instance using the default {@link
  * org.apache.commons.configuration.Configuration} from {@link #standardGraphConfiguration(Class,
  * String)}. The default implementation converts the passes the
  */
 public default Graph standardTestGraph(final Class<?> test, final String testMethodName) {
   return GraphFactory.open(standardGraphConfiguration(test, testMethodName));
 }