-
Notifications
You must be signed in to change notification settings - Fork 103
Iss54/extract asciidoc reporter #1940
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
025cf01
Issue: TNG#54 extract asciidoc report generator into separate module
hvennekate 0e1cc8e
Issue: TNG#54 add dependency to newly extracted asciidoc report
hvennekate 8a50fb5
Issue: TNG#54 Fix core code after extraction of asciidoc report
hvennekate 1aef9aa
Issue: TNG#54 Fix formatting and remove comment
hvennekate 3a17934
test: Rework test for reading corrupt JSON files for report generation
hvennekate 118d1d7
Issue: TNG#54 Extract mockito dependency to toml
hvennekate fc444c1
Issue: TNG#54 Fix formatting, wording, and directly instantiate HTML5…
hvennekate e1a2f14
Issue: TNG#54 Extend readme for AsciiDoc report generator
hvennekate 31774b0
Merge remote-tracking branch 'origin/master' into iss54/extract_ascii…
hvennekate ff33ab4
Merge branch 'master' into iss54/extract_asciidoc_reporter
hvennekate a20a5a7
fix version variable typography (fixing previous merge)
hvennekate c10eec1
add jgiven-publishing plugin to asciidoc-report
hvennekate abf222e
Merge branch 'master' into iss54/extract_asciidoc_reporter
hvennekate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # AsciiDoc Report | ||
|
|
||
| This plug-in will generate test reports in the [AsciiDoc](https://asciidoc.org/) format. | ||
| It thus combines the simplicity of plain text with lean markup elements for structure, links etc. | ||
| Easily convertible to formats like HTML or PDF. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| plugins { | ||
| id 'java-library' | ||
| id 'jgiven-publishing' | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation libs.guava | ||
| implementation libs.slf4j.api | ||
| implementation project(':jgiven-core') | ||
| } |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
jgiven-core/src/test/java/com/tngtech/jgiven/report/ReportConfigArgumentTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.tngtech.jgiven.report; | ||
|
|
||
| import com.tngtech.jgiven.report.config.ConfigOption; | ||
| import java.io.File; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import org.junit.Test; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| public class ReportConfigArgumentTest { | ||
|
|
||
| @Test | ||
| public void testArgumentParsing() { | ||
| var testConfig = new AbstractReportConfig("--sourceDir=source/dir", "--targetDir=target/dir") { | ||
|
|
||
| @Override | ||
| public void useConfigMap(Map<String, Object> configMap) { | ||
| } | ||
|
|
||
| @Override | ||
| public void additionalConfigOptions(List<ConfigOption> configOptions) { | ||
| } | ||
| }; | ||
|
|
||
| assertThat(testConfig.getSourceDir()).isEqualTo(new File("source/dir")); | ||
| assertThat(testConfig.getTargetDir()).isEqualTo(new File("target/dir")); | ||
| } | ||
| } | ||
22 changes: 0 additions & 22 deletions
22
jgiven-core/src/test/java/com/tngtech/jgiven/report/ReportGeneratorArgumentTest.java
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
jgiven-core/src/test/java/com/tngtech/jgiven/report/ReportGeneratorTest.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
jgiven-core/src/test/java/com/tngtech/jgiven/report/json/ReportModelReaderTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package com.tngtech.jgiven.report.json; | ||
|
|
||
| import com.google.common.base.Charsets; | ||
| import com.google.common.io.Files; | ||
| import com.tngtech.jgiven.exception.JGivenWrongUsageException; | ||
| import com.tngtech.jgiven.report.AbstractReportConfig; | ||
| import java.io.File; | ||
| import org.junit.Rule; | ||
| import org.junit.Test; | ||
| import org.junit.rules.TemporaryFolder; | ||
| import org.junit.runner.RunWith; | ||
| import org.mockito.Mock; | ||
| import org.mockito.junit.MockitoJUnitRunner; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
| import static org.mockito.Mockito.when; | ||
|
|
||
| @RunWith(MockitoJUnitRunner.class) | ||
| public class ReportModelReaderTest { | ||
|
|
||
| @Rule | ||
| public final TemporaryFolder tmpFolder = new TemporaryFolder(); | ||
|
|
||
| @Mock | ||
| private AbstractReportConfig config; | ||
|
|
||
| @Test | ||
| public void wrong_json_files_are_handled_gracefully() throws Exception { | ||
| var folder = tmpFolder.newFolder(); | ||
|
|
||
| Files.asCharSink( new File( folder, "wrong.json" ), Charsets.UTF_8 ).write( "no json"); | ||
|
|
||
| when(config.getSourceDir()).thenReturn(tmpFolder.getRoot()); | ||
| var reportModelReader = new ReportModelReader(config); | ||
|
|
||
| assertThatThrownBy(reportModelReader::readDirectory).isInstanceOf(JGivenWrongUsageException.class) | ||
| .hasMessageContaining("Error while reading file"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the former
ReportGeneratorArgumentTest(next file; deleted). Like the test further down after that, it does not really require the asciidoc reporter, so I replaced it with anonymous classes. It might be worthwhile extracting those or moving/renaming the tests to signify that they are really testing theAbstractReportConfigandAbstractReportGenerator, respectively.