@Test @SuppressWarnings("unchecked") public void testValidateGraph1() { final RuleManager ruleManager = graphTestHandler.getRuleManager(); final RuleSet ruleSet = graphTestHandler.ruleSet; final Graph<DefinitionSet, Node> graph = graphTestHandler.graph; final TestingGraphInstanceBuilder.TestGraph1 testGraph1 = TestingGraphInstanceBuilder.newGraph1(graphTestHandler); tested.validate(graph, ruleSet, this::assertNoError); final int evalCount = testGraph1.evaluationsCount + 10; final ArgumentCaptor<RuleEvaluationContext> contextCaptor = ArgumentCaptor.forClass(RuleEvaluationContext.class); verify(ruleManager, times(evalCount)).evaluate(eq(ruleSet), contextCaptor.capture()); final List<RuleEvaluationContext> contexts = contextCaptor.getAllValues(); assertEquals(evalCount, contexts.size()); int cindex = testGraph1.evaluationsCount; verifyCardinality((ElementCardinalityContext) contexts.get(cindex++), graph); verifyContainment((NodeContainmentContext) contexts.get(cindex++), graph, testGraph1.startNode); verifyConnection((GraphConnectionContext) contexts.get(cindex++), testGraph1.edge1, testGraph1.startNode, testGraph1.intermNode); verifyConnectorCardinality((ConnectorCardinalityContext) contexts.get(cindex++), graph, testGraph1.intermNode, testGraph1.edge1, EdgeCardinalityContext.Direction.INCOMING, Optional.empty()); verifyConnectorCardinality((ConnectorCardinalityContext) contexts.get(cindex++), graph, testGraph1.startNode, testGraph1.edge1, EdgeCardinalityContext.Direction.OUTGOING, Optional.empty()); verifyContainment((NodeContainmentContext) contexts.get(cindex++), graph, testGraph1.intermNode); verifyConnection((GraphConnectionContext) contexts.get(cindex++), testGraph1.edge2, testGraph1.intermNode, testGraph1.endNode); verifyConnectorCardinality((ConnectorCardinalityContext) contexts.get(cindex++), graph, testGraph1.endNode, testGraph1.edge2, EdgeCardinalityContext.Direction.INCOMING, Optional.empty()); verifyConnectorCardinality((ConnectorCardinalityContext) contexts.get(cindex++), graph, testGraph1.intermNode, testGraph1.edge2, EdgeCardinalityContext.Direction.OUTGOING, Optional.empty()); verifyContainment((NodeContainmentContext) contexts.get(cindex++), graph, testGraph1.endNode); }
@Override @SuppressWarnings("unchecked") public void validate(final Graph graph, final Consumer<Collection<RuleViolation>> callback) { validate(graph, null, callback); }
GraphValidatorImpl implements GraphValidator<Graph, RuleViolation> { @Override @SuppressWarnings("unchecked") public void validate(final Graph graph, final Consumer<Collection<RuleViolation>> callback) { validate(graph, null, callback); } }
GraphValidatorImpl implements GraphValidator<Graph, RuleViolation> { @Override @SuppressWarnings("unchecked") public void validate(final Graph graph, final Consumer<Collection<RuleViolation>> callback) { validate(graph, null, callback); } protected  GraphValidatorImpl(); @Inject  GraphValidatorImpl(final DefinitionManager definitionManager,
                              final RuleManager ruleManager,
                              final TreeWalkTraverseProcessor treeWalkTraverseProcessor); }
GraphValidatorImpl implements GraphValidator<Graph, RuleViolation> { @Override @SuppressWarnings("unchecked") public void validate(final Graph graph, final Consumer<Collection<RuleViolation>> callback) { validate(graph, null, callback); } protected  GraphValidatorImpl(); @Inject  GraphValidatorImpl(final DefinitionManager definitionManager,
                              final RuleManager ruleManager,
                              final TreeWalkTraverseProcessor treeWalkTraverseProcessor); @Override @SuppressWarnings("unchecked") void validate(final Graph graph,
                         final Consumer<Collection<RuleViolation>> callback); @Override void validate(final Graph graph,
                         final RuleSet ruleSet,
                         final Consumer<Collection<RuleViolation>> callback); }
GraphValidatorImpl implements GraphValidator<Graph, RuleViolation> { @Override @SuppressWarnings("unchecked") public void validate(final Graph graph, final Consumer<Collection<RuleViolation>> callback) { validate(graph, null, callback); } protected  GraphValidatorImpl(); @Inject  GraphValidatorImpl(final DefinitionManager definitionManager,
                              final RuleManager ruleManager,
                              final TreeWalkTraverseProcessor treeWalkTraverseProcessor); @Override @SuppressWarnings("unchecked") void validate(final Graph graph,
                         final Consumer<Collection<RuleViolation>> callback); @Override void validate(final Graph graph,
                         final RuleSet ruleSet,
                         final Consumer<Collection<RuleViolation>> callback);  }