@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); } }
public void shouldSupportGraphFilter() throws Exception { if (!graphProvider.getGraphComputer(graph).features().supportsGraphFilter()) { try { graphProvider.getGraphComputer(graph).vertices(__.hasLabel("software"));
@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); } }
public void shouldSupportGraphFilter() throws Exception { if (!graphProvider.getGraphComputer(graph).features().supportsGraphFilter()) { try { graphProvider.getGraphComputer(graph).vertices(__.hasLabel("software"));