@Test @LoadGraphWith(MODERN) public void shouldNotAllowBadGraphComputers() { try { graph.compute(BadGraphComputer.class); fail("Providing a bad graph computer class should fail"); } catch (Exception ex) { validateException(Graph.Exceptions.graphDoesNotSupportProvidedGraphComputer(BadGraphComputer.class), ex); } if (!new BadGraphComputer().features().supportsGraphFilter()) { try { new BadGraphComputer().vertices(__.hasLabel("software")); fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage()); } try { new BadGraphComputer().edges(__.bothE()); fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage()); } } else { fail("Should not support graph filter: " + BadGraphComputer.class); } }
fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage()); fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage());
@Test @LoadGraphWith(MODERN) public void shouldNotAllowBadGraphComputers() { try { graph.compute(BadGraphComputer.class); fail("Providing a bad graph computer class should fail"); } catch (Exception ex) { validateException(Graph.Exceptions.graphDoesNotSupportProvidedGraphComputer(BadGraphComputer.class), ex); } if (!new BadGraphComputer().features().supportsGraphFilter()) { try { new BadGraphComputer().vertices(__.hasLabel("software")); fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage()); } try { new BadGraphComputer().edges(__.bothE()); fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage()); } } else { fail("Should not support graph filter: " + BadGraphComputer.class); } }
fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage()); fail("Should throw an unsupported operation exception"); } catch (final UnsupportedOperationException e) { assertEquals(GraphComputer.Exceptions.graphFilterNotSupported().getMessage(), e.getMessage());
@Override public GraphComputer edges(final Traversal<Vertex, Edge> edgeFilter) { throw GraphComputer.Exceptions.graphFilterNotSupported(); }
@Override public GraphComputer vertices(final Traversal<Vertex, Vertex> vertexFilter) { throw GraphComputer.Exceptions.graphFilterNotSupported(); }
@Override public GraphComputer vertices(final Traversal<Vertex, Vertex> vertexFilter) { throw GraphComputer.Exceptions.graphFilterNotSupported(); }
@Override public GraphComputer edges(final Traversal<Vertex, Edge> edgeFilter) { throw GraphComputer.Exceptions.graphFilterNotSupported(); }