use of com.buschmais.jqassistant.core.rule.api.model.Group in project jqa-core-framework by buschmais.
the class XmlReportTestHelper method createXmlReportWithConstraints.
/**
* Creates a test report with {@link Constraint}.
*
* @return The test report.
* @throws ReportException
* If the test fails.
*/
public File createXmlReportWithConstraints() throws ReportException {
xmlReportWriter.begin();
Constraint constraint = Constraint.builder().id("my:Constraint").description("My constraint description").severity(Severity.BLOCKER).executable(new CypherExecutable("match...")).verification(ROW_COUNT_VERIFICATION).report(Report.builder().build()).build();
Map<String, Severity> constraints = new HashMap<>();
constraints.put("my:Constraint", Severity.INFO);
Group group = Group.builder().id("default").description("My group").constraints(constraints).build();
xmlReportWriter.beginGroup(group);
xmlReportWriter.beginConstraint(constraint);
List<Map<String, Object>> rows = new ArrayList<>();
rows.add(createRow());
Result<Constraint> result = Result.<Constraint>builder().rule(constraint).status(Result.Status.FAILURE).severity(Severity.CRITICAL).columnNames(Arrays.asList(C1, C2)).rows(rows).build();
xmlReportWriter.setResult(result);
xmlReportWriter.endConstraint();
xmlReportWriter.endGroup();
xmlReportWriter.end();
return xmlReportWriter.getXmlReportFile();
}
use of com.buschmais.jqassistant.core.rule.api.model.Group in project jqa-core-framework by buschmais.
the class XmlReportTestHelper method createXmlReport.
/**
* Creates a test report.
*
* @return The test report.
* @throws ReportException
* If the test fails.
*/
public File createXmlReport() throws ReportException {
xmlReportWriter.begin();
Concept concept = Concept.builder().id("my:concept").description("My concept description").severity(Severity.MAJOR).executable(new CypherExecutable("match...")).verification(ROW_COUNT_VERIFICATION).report(Report.builder().primaryColumn("c2").build()).build();
Map<String, Severity> concepts = new HashMap<>();
concepts.put("my:concept", Severity.INFO);
Group group = Group.builder().id("default").description("My group").concepts(concepts).build();
xmlReportWriter.beginGroup(group);
xmlReportWriter.beginConcept(concept);
List<Map<String, Object>> rows = new ArrayList<>();
rows.add(createRow());
Result<Concept> result = Result.<Concept>builder().rule(concept).status(Result.Status.SUCCESS).severity(Severity.CRITICAL).columnNames(Arrays.asList(C1, C2)).rows(rows).build();
xmlReportWriter.setResult(result);
xmlReportWriter.endConcept();
xmlReportWriter.endGroup();
xmlReportWriter.end();
return xmlReportWriter.getXmlReportFile();
}
use of com.buschmais.jqassistant.core.rule.api.model.Group in project jqa-core-framework by buschmais.
the class TransactionalVisitorTest method afterGroup.
@Test
void afterGroup() throws RuleException {
Group group = mock(Group.class);
visitor.afterGroup(group);
verify(delegate).afterGroup(group);
verifySuccessfulTransaction();
}
use of com.buschmais.jqassistant.core.rule.api.model.Group in project jqa-core-framework by buschmais.
the class XmlReportTestHelper method createXmlWithUmlauts.
public File createXmlWithUmlauts(String description) throws ReportException {
xmlReportWriter.begin();
Concept concept = Concept.builder().id("mein:Konzept").description(description).severity(Severity.MAJOR).executable(new CypherExecutable("match...")).verification(ROW_COUNT_VERIFICATION).report(Report.builder().primaryColumn("c2").build()).build();
Map<String, Severity> concepts = new HashMap<>();
concepts.put("mein:Konzept", Severity.INFO);
Group group = Group.builder().id("default").description("Meine Gruppe").concepts(concepts).build();
xmlReportWriter.beginGroup(group);
xmlReportWriter.beginConcept(concept);
List<Map<String, Object>> rows = new ArrayList<>();
rows.add(createRow());
Result<Concept> result = Result.<Concept>builder().rule(concept).status(Result.Status.SUCCESS).severity(Severity.CRITICAL).columnNames(Arrays.asList(C1, C2)).rows(rows).build();
xmlReportWriter.setResult(result);
xmlReportWriter.endConcept();
xmlReportWriter.endGroup();
xmlReportWriter.end();
return xmlReportWriter.getXmlReportFile();
}
use of com.buschmais.jqassistant.core.rule.api.model.Group in project jqa-core-framework by buschmais.
the class TransactionalVisitorTest method beforeGroup.
@Test
void beforeGroup() throws RuleException {
Group group = mock(Group.class);
visitor.beforeGroup(group, MAJOR);
verify(delegate).beforeGroup(group, MAJOR);
verifySuccessfulTransaction();
}
Aggregations