当前位置: 首页>>代码示例>>Java>>正文


Java Concept类代码示例

本文整理汇总了Java中com.buschmais.jqassistant.core.analysis.api.rule.Concept的典型用法代码示例。如果您正苦于以下问题:Java Concept类的具体用法?Java Concept怎么用?Java Concept使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Concept类属于com.buschmais.jqassistant.core.analysis.api.rule包,在下文中一共展示了Concept类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verify

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
private void verify(int developOffset) throws Exception {
    createGitHistory(Type.class, developOffset);
    Map<String, String> parameters = new HashMap<>();
    parameters.put("testImpactAnalysisGitBaseBranch", "develop");

    Result<Concept> result = applyConcept(CONCEPT, parameters);

    assertThat(result.getStatus(), equalTo(SUCCESS));
    List<Map<String, Object>> rows = result.getRows();
    assertThat(rows.size(), equalTo(1));
    Map<String, Object> row = rows.get(0);
    GitCommitDescriptor commit = (GitCommitDescriptor) row.get("Commit");
    assertThat(commit, notNullValue());
    List<String> filesChangedByCommit = (List<String>) row.get("FilesChangedByCommit");
    assertThat(filesChangedByCommit.size(), equalTo(1));
    String file = filesChangedByCommit.get(0);
    assertThat(file, endsWith(getSourceFileName(Type.class)));
}
 
开发者ID:jqassistant-contrib,项目名称:jqassistant-test-impact-analysis-plugin,代码行数:19,代码来源:FilesChangedByCommitsInCurrentGitBranchTest.java

示例2: noTestsAffectedInSameGitBranch

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Test
public void noTestsAffectedInSameGitBranch() throws Exception {
    scanClassPathDirectory("a1", getClassesDirectory(TestsAffectedByCurrentGitBranchTest.class));
    createGitHistory(Type.class);

    Result<Concept> result = applyConcept(CONCEPT, Collections.<String, String> emptyMap());

    assertThat(result.getStatus(), equalTo(FAILURE));
    List<Map<String, Object>> rows = result.getRows();
    assertThat(rows.size(), equalTo(0));
    store.beginTransaction();
    assertThat(store.executeQuery("MATCH (t:Type:Changed) RETURN count(t) as changedTypes").getSingleResult().get("changedTypes", Number.class).intValue(),
            equalTo(0));
    assertThat(store.executeQuery("MATCH (t:Type:Test:Affected) RETURN count(t) as affectedTests").getSingleResult().get("affectedTests", Number.class)
            .intValue(), equalTo(0));
    store.commitTransaction();
}
 
开发者ID:jqassistant-contrib,项目名称:jqassistant-test-impact-analysis-plugin,代码行数:18,代码来源:NoTestsAffectedInSameGitBranch.java

示例3: verify

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
protected void verify(Class<?> changedType, String concept, Map<String, String> parameters) throws Exception {
    scanClassPathDirectory("a1", getClassesDirectory(TestsAffectedByCurrentGitBranchTest.class));

    Result<Concept> result = applyConcept(concept, parameters);

    assertThat(result.getStatus(), equalTo(SUCCESS));
    List<Map<String, Object>> rows = result.getRows();
    assertThat(rows.size(), equalTo(1));
    Map<String, Object> row = rows.get(0);
    store.beginTransaction();
    ArtifactDescriptor artifact = (ArtifactDescriptor) row.get("Artifact");
    assertThat(artifact, notNullValue());
    assertThat(artifact.getFullQualifiedName(), equalTo("a1"));
    List<TypeDescriptor> tests = (List<TypeDescriptor>) row.get("Tests");
    assertThat(tests, notNullValue());
    assertThat(tests, hasItems(typeDescriptor(TypeTest.class)));
    assertThat(tests, not(hasItems(typeDescriptor(OtherTypeTest.class))));
    assertThat(store.executeQuery("MATCH (t:Type:Changed) RETURN t").getSingleResult().get("t", TypeDescriptor.class), typeDescriptor(changedType));
    List<TypeDescriptor> affectedTests = store.executeQuery("MATCH (t:Type:Test:Affected) RETURN collect(t) as affectedTests").getSingleResult()
            .get("affectedTests", List.class);
    assertThat(affectedTests, hasItems(typeDescriptor(TypeTest.class), typeDescriptor(TestsAffectedByCurrentGitBranchTest.class)));
    store.commitTransaction();
}
 
开发者ID:jqassistant-contrib,项目名称:jqassistant-test-impact-analysis-plugin,代码行数:24,代码来源:AbstractTestImpactAnalysisRuleTest.java

示例4: failedConcepts

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Test
public void failedConcepts() {
    Result<Concept> infoConceptResult = mockResult("test:infoConcept", Concept.class, Result.Status.FAILURE, Severity.INFO);
    Result<Concept> minorConceptResult = mockResult("test:minorConcept", Concept.class, Result.Status.FAILURE, Severity.MINOR);
    Result<Concept> majorConceptResult = mockResult("test:majorConcept", Concept.class, Result.Status.FAILURE, Severity.MAJOR);
    Map<String, Result<Concept>> conceptResults = new HashMap<>();
    conceptResults.put("test:infoConcept", infoConceptResult);
    conceptResults.put("test:minorConcept", minorConceptResult);
    conceptResults.put("test:majorConcept", majorConceptResult);
    when(inMemoryReportWriter.getConceptResults()).thenReturn(conceptResults);
    int violations = reportHelper.verifyConceptResults(Severity.MINOR, Severity.MAJOR, inMemoryReportWriter);
    assertThat(violations, equalTo(1));
    verifyMessages(debugMessages, ReportHelper.CONCEPT_FAILED_HEADER, "Concept: test:infoConcept", "Severity: INFO");
    verifyMessages(warnMessages, ReportHelper.CONCEPT_FAILED_HEADER, "Concept: test:minorConcept", "Severity: MINOR");
    verifyMessages(errorMessages, ReportHelper.CONCEPT_FAILED_HEADER, "Concept: test:majorConcept", "Severity: MAJOR");
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:17,代码来源:ReportHelperTest.java

示例5: failedConceptsWithOverriddenSeverity

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Test
public void failedConceptsWithOverriddenSeverity() {
    Result<Concept> infoConceptResult = mockResult("test:infoConcept", Concept.class, Result.Status.FAILURE, Severity.INFO, Severity.MINOR);
    Result<Concept> minorConceptResult = mockResult("test:minorConcept", Concept.class, Result.Status.FAILURE, Severity.MINOR, Severity.MAJOR);
    Result<Concept> majorConceptResult = mockResult("test:majorConcept", Concept.class, Result.Status.FAILURE, Severity.MAJOR, Severity.CRITICAL);
    Map<String, Result<Concept>> conceptResults = new HashMap<>();
    conceptResults.put("test:infoConcept", infoConceptResult);
    conceptResults.put("test:minorConcept", minorConceptResult);
    conceptResults.put("test:majorConcept", majorConceptResult);
    when(inMemoryReportWriter.getConceptResults()).thenReturn(conceptResults);
    int violations = reportHelper.verifyConceptResults(Severity.MAJOR, Severity.CRITICAL, inMemoryReportWriter);
    assertThat(violations, equalTo(1));
    verifyMessages(debugMessages, ReportHelper.CONCEPT_FAILED_HEADER, "Concept: test:infoConcept", "Severity: MINOR (from INFO)");
    verifyMessages(warnMessages, ReportHelper.CONCEPT_FAILED_HEADER, "Concept: test:minorConcept", "Severity: MAJOR (from MINOR)");
    verifyMessages(errorMessages, ReportHelper.CONCEPT_FAILED_HEADER, "Concept: test:majorConcept", "Severity: CRITICAL (from MAJOR)");
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:17,代码来源:ReportHelperTest.java

示例6: getResult

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
private Result<? extends ExecutableRule> getResult(List<Map<String, Object>> rows, Properties reportProperties) {
    Result<? extends ExecutableRule> result = mock(Result.class);

    Concept concept = mock(Concept.class);
    when(result.getRule()).thenReturn(concept);

    Report report = mock(Report.class);
    when(concept.getReport()).thenReturn(report);
    when(report.getSelectedTypes()).thenReturn(new HashSet<>(asList(REPORT_ID)));
    when(report.getProperties()).thenReturn(reportProperties);

    when(result.getRows()).thenReturn(rows);
    return result;
}
 
开发者ID:jqassistant-contrib,项目名称:jqassistant-test-impact-analysis-plugin,代码行数:15,代码来源:SurefireSuiteReportPluginTest.java

示例7: beginConcept

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Override
public void beginConcept(final Concept concept) throws ReportException {
    selectReportWriter(concept);
    run(new DelegateOperation() {
        @Override
        public void run(ReportPlugin reportWriter) throws ReportException {
            reportWriter.beginConcept(concept);
        }
    });
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:11,代码来源:CompositeReportPlugin.java

示例8: successfulConcept

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Test
public void successfulConcept() {
    Result<Concept> conceptResult = mockResult("test:concept", Concept.class, Result.Status.SUCCESS, Severity.MAJOR);
    Map<String, Result<Concept>> conceptResults = new HashMap<>();
    conceptResults.put("test:concept", conceptResult);
    when(inMemoryReportWriter.getConceptResults()).thenReturn(conceptResults);
    int violations = reportHelper.verifyConceptResults(Severity.MINOR, Severity.MAJOR, inMemoryReportWriter);
    assertThat(violations, equalTo(0));
    assertThat(warnMessages.size(), equalTo(0));
    assertThat(debugMessages.size(), equalTo(0));
    assertThat(errorMessages.size(), equalTo(0));
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:13,代码来源:ReportHelperTest.java

示例9: getStatus

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
protected <T extends ExecutableRule> Result.Status getStatus(T executable, int value, Integer min, Integer max) {
    if (min == null && max == null) {
        if (executable instanceof Concept) {
            min = 1;
        }
        if (executable instanceof Constraint) {
            max = 0;
        }
    }
    return (min == null || value >= min) && (max == null || value <= max) ? Result.Status.SUCCESS : Result.Status.FAILURE;
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:12,代码来源:AbstractMinMaxVerificationStrategy.java

示例10: beginConcept

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Override
public void beginConcept(Concept concept) throws ReportException {
}
 
开发者ID:buschmais,项目名称:jqa-maven-plugin,代码行数:4,代码来源:CustomReportPlugin.java

示例11: beginConcept

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
@Override
public void beginConcept(Concept concept) throws ReportException {

}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:5,代码来源:TestReportPlugin.java

示例12: ConceptMatcher

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param id
 *            The expected concept id.
 */
protected ConceptMatcher(String id) {
    super(Concept.class, id);
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:10,代码来源:ConceptMatcher.java

示例13: concept

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
/**
 * Return a {@link ConceptMatcher}.
 * 
 * @param id
 *            The concept id.
 * @return The {@link ConceptMatcher}.
 */
public static Matcher<? super Concept> concept(String id) {
    return new ConceptMatcher(id);
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:11,代码来源:ConceptMatcher.java

示例14: beginConcept

import com.buschmais.jqassistant.core.analysis.api.rule.Concept; //导入依赖的package包/类
void beginConcept(Concept concept) throws ReportException; 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:2,代码来源:ReportPlugin.java


注:本文中的com.buschmais.jqassistant.core.analysis.api.rule.Concept类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。