Skip to content

Commit

Permalink
Split test into three tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivruix committed Jan 22, 2025
1 parent 5f99e9f commit cc97eaf
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions src/test/java/org/jpeek/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,56 @@ void createsXmlReports(@TempDir final Path output) throws IOException {
}

@Test
void canIncludeAllMethods(@TempDir final Path output) throws Exception {
void canIncludePrivateMethods(@TempDir final Path output) throws Exception {
final Path input = Paths.get(".");
final Map<String, Object> args = new HashMap<>();
args.put("include-ctors", 1);
args.put("include-static-methods", 1);
args.put("include-private-methods", 1);
new App(input, output, args).analyze();
new Assertion<>(
"Must contain all included methods",
"Must contain private method",
XhtmlMatchers.xhtml(
new TextOf(output.resolve("skeleton.xml")).asString()
),
XhtmlMatchers.hasXPaths(
"//method[@ctor='true']",
"//method[@static='true']",
"//method[@visibility='private']"
)
).affirm();
}

@Test
void canIncludeConstructors(@TempDir final Path output) throws Exception {
final Path input = Paths.get(".");
final Map<String, Object> args = new HashMap<>();
args.put("include-ctors", 1);
new App(input, output, args).analyze();
new Assertion<>(
"Must contain constructor",
XhtmlMatchers.xhtml(
new TextOf(output.resolve("skeleton.xml")).asString()
),
XhtmlMatchers.hasXPaths(
"//method[@ctor='true']"
)
).affirm();
}

@Test
void canIncludeStaticMethods(@TempDir final Path output) throws Exception {
final Path input = Paths.get(".");
final Map<String, Object> args = new HashMap<>();
args.put("include-static-methods", 1);
new App(input, output, args).analyze();
new Assertion<>(
"Must contain static method",
XhtmlMatchers.xhtml(
new TextOf(output.resolve("skeleton.xml")).asString()
),
XhtmlMatchers.hasXPaths(
"//method[@static='true']"
)
).affirm();
}

@Test
void createsIndexHtml(@TempDir final Path output) throws IOException {
final Path input = Paths.get(".");
Expand Down

0 comments on commit cc97eaf

Please sign in to comment.