Search in sources :

Example 11 with Concept

use of com.buschmais.jqassistant.core.rule.api.model.Concept 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();
}
Also used : Concept(com.buschmais.jqassistant.core.rule.api.model.Concept) Group(com.buschmais.jqassistant.core.rule.api.model.Group) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Severity(com.buschmais.jqassistant.core.rule.api.model.Severity) CypherExecutable(com.buschmais.jqassistant.core.rule.api.model.CypherExecutable) HashMap(java.util.HashMap) Map(java.util.Map)

Example 12 with Concept

use of com.buschmais.jqassistant.core.rule.api.model.Concept in project jqa-core-framework by buschmais.

the class TransactionalVisitorTest method visitConcept.

@Test
void visitConcept() throws RuleException {
    Concept concept = mock(Concept.class);
    visitor.visitConcept(concept, MINOR);
    verify(delegate).visitConcept(concept, MINOR);
    verifySuccessfulTransaction();
}
Also used : Concept(com.buschmais.jqassistant.core.rule.api.model.Concept) Test(org.junit.jupiter.api.Test)

Aggregations

Concept (com.buschmais.jqassistant.core.rule.api.model.Concept)12 Test (org.junit.jupiter.api.Test)8 Constraint (com.buschmais.jqassistant.core.rule.api.model.Constraint)6 Result (com.buschmais.jqassistant.core.report.api.model.Result)4 StringContains.containsString (org.hamcrest.core.StringContains.containsString)3 CypherExecutable (com.buschmais.jqassistant.core.rule.api.model.CypherExecutable)2 Group (com.buschmais.jqassistant.core.rule.api.model.Group)2 Severity (com.buschmais.jqassistant.core.rule.api.model.Severity)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ConceptDescriptor (com.buschmais.jqassistant.core.analysis.api.model.ConceptDescriptor)1 JavaSuppressDescriptor (com.buschmais.jqassistant.plugin.java.api.model.JavaSuppressDescriptor)1