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
8273544: Increase test coverage for snippets #6359
Closed
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
93f01b9
Leverage sealed classes in the implementation
pavelrappo 9acf1b6
Test the --snippet-path option
pavelrappo 511e62b
Refactor and clean up tests
pavelrappo 321b177
Test snippet markup
pavelrappo 74d3bc5
Further increase test coverage
pavelrappo fef073f
Rename test methods
pavelrappo 4acad75
Apply test a naming convention
pavelrappo baaf961
Encapsulate HTML representation of a snippet
pavelrappo c2f3514
Add tests that showcases */ and \uxxxx
pavelrappo 6acc9ed
Cover blank and valueless "region" attribute
pavelrappo 6bbc92a
Improve error handling in SnippetTaglet
pavelrappo 425e75e
Add TODO entries for FileManager-related issues
pavelrappo 92b8709
Test markup issues in an external snippet
pavelrappo c3bad64
Use the feature from JDK-8273154
pavelrappo 6fe8667
Add negative tests for next-line markup
pavelrappo 3975b0c
Remove trailing whitespace for jcheck
pavelrappo fd33d86
Test one more corner case example
pavelrappo 981cc30
Address feedback
pavelrappo b7c8c48
Repair a confusing commit 93f01b9
pavelrappo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -21,6 +21,18 @@ | |
* questions. | ||
*/ | ||
|
||
/* | ||
* @test | ||
* @bug 8266666 | ||
* @summary Implementation for snippets | ||
* @library /tools/lib ../../lib | ||
* @modules jdk.compiler/com.sun.tools.javac.api | ||
* jdk.compiler/com.sun.tools.javac.main | ||
* jdk.javadoc/jdk.javadoc.internal.tool | ||
* @build javadoc.tester.* toolbox.ToolBox toolbox.ModuleBuilder builder.ClassBuilder | ||
* @run main TestSnippetMarkup | ||
*/ | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.File; | ||
import java.io.IOException; | ||
|
@@ -58,23 +70,8 @@ | |
|
||
import static javax.tools.DocumentationTool.Location.DOCUMENTATION_OUTPUT; | ||
|
||
/* | ||
* @test | ||
* @bug 8266666 | ||
* @summary Implementation for snippets | ||
* @library /tools/lib ../../lib | ||
* @modules jdk.compiler/com.sun.tools.javac.api | ||
* jdk.compiler/com.sun.tools.javac.main | ||
* jdk.javadoc/jdk.javadoc.internal.tool | ||
* @build javadoc.tester.* toolbox.ToolBox toolbox.ModuleBuilder builder.ClassBuilder | ||
* @run main TestSnippetMarkup | ||
*/ | ||
public class TestSnippetMarkup extends SnippetTester { | ||
|
||
private final ToolBox tb = new ToolBox(); | ||
|
||
private TestSnippetMarkup() {} | ||
|
||
public static void main(String... args) throws Exception { | ||
new TestSnippetMarkup().runTests(m -> new Object[]{Paths.get(m.getName())}); | ||
} | ||
|
@@ -228,7 +225,7 @@ public void testCornerCases(Path base) throws Exception { | |
* next line. | ||
*/ | ||
// @Test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (minor) maybe add |
||
public void testPositiveInlineExternalTagMarkupNextLine(Path base) throws Exception { | ||
public void testPositiveInlineExternalTagMarkup_NextLine(Path base) throws Exception { | ||
throw new RuntimeException("Not yet implemented"); | ||
} | ||
|
||
|
@@ -237,7 +234,7 @@ public void testPositiveInlineExternalTagMarkupNextLine(Path base) throws Except | |
* an error occurs. | ||
*/ | ||
@Test | ||
public void testNegativeInlineExternalHybridTagMarkupNextLinePutOnLastLine(Path base) throws Exception { | ||
public void testNegativeInlineExternalHybridTagMarkup_NextLinePutOnLastLine(Path base) throws Exception { | ||
Path srcDir = base.resolve("src"); | ||
Path outDir = base.resolve("out"); | ||
var goodFile = "good.txt"; | ||
|
This file contains 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 works, and is a clever solution for now. Maybe "one of these days" we remove the
checkOutputEither
method.