Skip to content

Instantly share code, notes, and snippets.

@okram
Created August 7, 2014 20:17
Show Gist options
  • Save okram/2365ed5f9c12365635d1 to your computer and use it in GitHub Desktop.
Save okram/2365ed5f9c12365635d1 to your computer and use it in GitHub Desktop.
public class GraphComputerTest extends AbstractGremlinTest {
@Test
@FeatureRequirement(featureClass = Graph.Features.GraphFeatures.class, feature = Graph.Features.GraphFeatures.FEATURE_COMPUTER)
public void shouldHaveStandardStringRepresentation() {
final GraphComputer computer = g.compute();
assertEquals(StringFactory.computerString(computer), computer.toString());
}
@Test
@FeatureRequirement(featureClass = Graph.Features.GraphFeatures.class, feature = Graph.Features.GraphFeatures.FEATURE_COMPUTER)
public void shouldNotAllowBadGraphComputers() {
try {
g.compute(BadGraphComputer.class);
fail("Providing a bad graph computer class should fail");
} catch (IllegalArgumentException e) {
assertTrue(true);
} catch (Exception e) {
fail("Should provide an IllegalArgumentException");
}
}
class BadGraphComputer implements GraphComputer {
public GraphComputer isolation(final Isolation isolation) {
return null;
}
public GraphComputer program(final VertexProgram vertexProgram) {
return null;
}
public GraphComputer mapReduce(final MapReduce mapReduce) {
return null;
}
public Future<Pair<Graph, SideEffects>> submit() {
return null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment