Skip to content

Commit

Permalink
Complete junit test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-parasoft committed Dec 20, 2024
1 parent 3693c6c commit b86f576
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 175 deletions.
26 changes: 23 additions & 3 deletions src/test/java/edu/hm/hafner/analysis/parser/ValeParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,31 @@ class ValeParserTest extends AbstractParserTest {

@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {
softly.assertThat(report).hasSize(12).hasDuplicatesSize(0);
softly.assertThat(report).hasSize(3).hasDuplicatesSize(0);
softly.assertThat(report.get(0))
.hasFileName("file3.adoc")
.hasDescription("RedHat.SimpleWords")
.hasFileName("file1.adoc")
.hasDescription("RedHat.SentenceLength")
.hasMessage("Try to keep sentences to an average of 32 words or fewer.")
.hasLineStart(10)
.hasColumnStart(1)
.hasColumnEnd(5)
.hasSeverity(Severity.WARNING_LOW);
softly.assertThat(report.get(1))
.hasFileName("file2.adoc")
.hasDescription("RedHat.TermsWarnings")
.hasMessage("Consider using 'might' or 'can' rather than 'may' unless updating existing content that uses the term.")
.hasLineStart(39)
.hasColumnStart(143)
.hasColumnEnd(145)
.hasSeverity(Severity.WARNING_NORMAL);
softly.assertThat(report.get(2))
.hasFileName("file2.adoc")
.hasDescription("RedHat.Using")
.hasMessage("Use 'by using' instead of 'using' when it follows a noun for clarity and grammatical correctness.")
.hasLineStart(51)
.hasColumnStart(44)
.hasColumnEnd(64)
.hasSeverity(Severity.ERROR);
}

@Override
Expand Down
174 changes: 2 additions & 172 deletions src/test/resources/edu/hm/hafner/analysis/parser/vale-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,179 +56,9 @@
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/using/",
"Message": "Use 'by using' instead of 'using' when it follows a noun for clarity and grammatical correctness.",
"Severity": "warning",
"Severity": "error",
"Match": "functionalities using",
"Line": 51
},
{
"Action": {
"Name": "replace",
"Params": [
"might",
"can"
]
},
"Span": [
24,
26
],
"Check": "RedHat.TermsWarnings",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/termswarnings/",
"Message": "Consider using 'might' or 'can' rather than 'may' unless updating existing content that uses the term.",
"Severity": "warning",
"Match": "may",
"Line": 65
}
],
"file3.adoc": [
{
"Action": {
"Name": "replace",
"Params": [
"give",
"offer"
]
},
"Span": [
11,
17
],
"Check": "RedHat.SimpleWords",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/simplewords/",
"Message": "Use simple language. Consider using 'give' or 'offer' rather than 'provide'.",
"Severity": "suggestion",
"Match": "provide",
"Line": 170
},
{
"Action": {
"Name": "replace",
"Params": [
"complete",
"finish"
]
},
"Span": [
29,
36
],
"Check": "RedHat.SimpleWords",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/simplewords/",
"Message": "Use simple language. Consider using 'complete' or 'finish' rather than 'finalize'.",
"Severity": "suggestion",
"Match": "finalize",
"Line": 212
},
{
"Action": {
"Name": "replace",
"Params": [
"complete",
"finish"
]
},
"Span": [
5,
12
],
"Check": "RedHat.SimpleWords",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/simplewords/",
"Message": "Use simple language. Consider using 'complete' or 'finish' rather than 'finalize'.",
"Severity": "suggestion",
"Match": "finalize",
"Line": 451
},
{
"Action": {
"Name": "replace",
"Params": [
"give",
"offer"
]
},
"Span": [
16,
22
],
"Check": "RedHat.SimpleWords",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/simplewords/",
"Message": "Use simple language. Consider using 'give' or 'offer' rather than 'provide'.",
"Severity": "suggestion",
"Match": "provide",
"Line": 530
},
{
"Action": {
"Name": "",
"Params": null
},
"Span": [
1,
4
],
"Check": "RedHat.SentenceLength",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/sentencelength/",
"Message": "Try to keep sentences to an average of 32 words or fewer.",
"Severity": "suggestion",
"Match": "When",
"Line": 533
},
{
"Action": {
"Name": "",
"Params": null
},
"Span": [
1,
4
],
"Check": "RedHat.SentenceLength",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/sentencelength/",
"Message": "Try to keep sentences to an average of 32 words or fewer.",
"Severity": "suggestion",
"Match": "When",
"Line": 535
},
{
"Action": {
"Name": "",
"Params": null
},
"Span": [
1,
3
],
"Check": "RedHat.SentenceLength",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/sentencelength/",
"Message": "Try to keep sentences to an average of 32 words or fewer.",
"Severity": "suggestion",
"Match": "The",
"Line": 571
},
{
"Action": {
"Name": "",
"Params": null
},
"Span": [
1,
12
],
"Check": "RedHat.SentenceLength",
"Description": "",
"Link": "https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/sentencelength/",
"Message": "Try to keep sentences to an average of 32 words or fewer.",
"Severity": "suggestion",
"Match": "Additionally",
"Line": 717
}
]
}
}

0 comments on commit b86f576

Please sign in to comment.