Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove passedChecks number for rule from report #1380

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,7 @@ private boolean checkAllRules(Object checkObject, String checkContext) {
private boolean firstProcessObjectWithRule(Object checkObject, String checkContext, Rule rule) {
Boolean deferred = rule.getDeferred();
if (deferred != null && deferred.booleanValue()) {
List<ObjectWithContext> list = this.deferredRules.get(rule);
if (list == null) {
list = new ArrayList<>();
this.deferredRules.put(rule, list);
}
List<ObjectWithContext> list = this.deferredRules.computeIfAbsent(rule, k -> new ArrayList<>());
list.add(new ObjectWithContext(checkObject, checkContext));
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface RuleSummary {
public int getTestNumber();
public String getStatus();
public Status getRuleStatus();
public int getPassedChecks();
public Integer getPassedChecks();
public int getFailedChecks();
public Set<String> getTags();
public String getDescription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class RuleSummaryImpl implements RuleSummary {
@XmlAttribute
private final String status;
@XmlAttribute
private final int passedChecks;
private final Integer passedChecks;
@XmlAttribute
private final int failedChecks;
@XmlAttribute
Expand All @@ -64,7 +64,7 @@ final class RuleSummaryImpl implements RuleSummary {
@XmlElement(name = "check")
private final List<Check> checks;

private RuleSummaryImpl(final RuleId ruleId, final Status status, final int passedChecks, final int failedChecks,
private RuleSummaryImpl(final RuleId ruleId, final Status status, final Integer passedChecks, final int failedChecks,
final String tags, final String description, final String object, final String test, final List<Check> checks) {
PDFAFlavour.Specification specification = ruleId.getSpecification();
this.specification = specification == null ? null : specification.getId();
Expand Down Expand Up @@ -135,7 +135,7 @@ public int getTestNumber() {
* @return the passedChecks
*/
@Override
public int getPassedChecks() {
public Integer getPassedChecks() {
return this.passedChecks;
}

Expand All @@ -149,7 +149,7 @@ public int getFailedChecks() {

@Override
public Set<String> getTags() {
return tags != null ? new HashSet<>(Arrays.asList(tags.split(","))) : Collections.emptySet();
return tags != null ? new HashSet<>(Arrays.asList(tags.split(","))) : null;
}

/**
Expand Down Expand Up @@ -213,15 +213,13 @@ static final RuleSummary fromValues(final RuleId id, final String description, f
for (TestAssertion assertion : assertions) {
if (assertion.getStatus() == Status.PASSED) {
passedChecks++;
if (logPassedChecks) {
checks.add(CheckImpl.fromValue(assertion));
}
checks.add(CheckImpl.fromValue(assertion));
} else {
status = assertion.getStatus();
checks.add(CheckImpl.fromValue(assertion));
}
}
return new RuleSummaryImpl(id, status, passedChecks, failedChecks != null ? failedChecks : 0, tags, description, object, test, checks);
return new RuleSummaryImpl(id, status, logPassedChecks ? passedChecks : null, failedChecks != null ? failedChecks : 0, tags, description, object, test, checks);
}

static final RuleSummary uncheckedInstance(final RuleId id, final String description, final String object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class VeraPDFMeta {

public static final String PDFAID_PREFIX = "pdfaid";
public static final String PDFUAID_PREFIX = "pdfuaid";
public static final String CONFORMANCE = "conformance";
public static final String PART = "part";
public static final String REVISION_YEAR = "rev";
Expand Down