Created
August 7, 2014 20:17
-
-
Save okram/2365ed5f9c12365635d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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