Skip to content

Commit

Permalink
Use fully classified name for PendingException
Browse files Browse the repository at this point in the history
  • Loading branch information
mlvandijk authored and mpkorstanje committed Jun 16, 2018
1 parent bda09c6 commit 4c9b6f1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion java/src/main/java/cucumber/runtime/java/Java8Snippet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public String template() {
return "" +
"{0}(\"{1}\", ({3}) -> '{'\n" +
" // {4}\n" +
"{5} throw new PendingException();\n" +
"{5} throw new cucumber.api.PendingException();\n" +
"'}');\n";
}
}
2 changes: 1 addition & 1 deletion java/src/main/java/cucumber/runtime/java/JavaSnippet.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public String template() {
"@{0}(\"{1}\")\n" +
"public void {2}({3}) '{'\n" +
" // {4}\n" +
"{5} throw new PendingException();\n" +
"{5} throw new cucumber.api.PendingException();\n" +
"'}'\n";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void generatesPlainSnippet() {
String expected = "" +
"Given(\"I have {int} cukes in my {string} belly\", (Integer int1, String string) -> {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"});\n";
System.out.println(expected);
assertEquals(expected, snippetFor("I have 4 cukes in my \"big\" belly"));
Expand Down
32 changes: 16 additions & 16 deletions java/src/test/java/cucumber/runtime/java/JavaSnippetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void generatesPlainSnippet() {
"@Given(\"I have {int} cukes in my {string} belly\")\n" +
"public void i_have_cukes_in_my_belly(Integer int1, String string) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4 cukes in my \"big\" belly"));
}
Expand All @@ -60,7 +60,7 @@ public Size transform(String... strings) {
"@Given(\"I have {double} cukes in my {size} belly\")\n" +
"public void i_have_cukes_in_my_belly(Double double1, Size size) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4.2 cukes in my large belly", customParameterType));
}
Expand All @@ -85,7 +85,7 @@ public List<Size> transform(String... strings) {
"@Given(\"I have {sizes} bellies\")\n" +
"public void i_have_bellies(java.util.List<cucumber.runtime.java.JavaSnippetTest$Size> sizes) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have large and small bellies", customParameterType));
}
Expand All @@ -96,7 +96,7 @@ public void generatesCopyPasteReadyStepSnippetForNumberParameters() {
"@Given(\"before {int} after\")\n" +
"public void before_after(Integer int1) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("before 5 after"));
}
Expand All @@ -107,7 +107,7 @@ public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars(
"@Given(\"I have {int} cukes in: my {string} red-belly!\")\n" +
"public void i_have_cukes_in_my_red_belly(Integer int1, String string) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4 cukes in: my \"big\" red-belly!"));
}
Expand All @@ -118,7 +118,7 @@ public void generatesCopyPasteReadySnippetWhenStepHasIntegersInsideStringParamet
"@Given(\"the DI system receives a message saying {string}\")\n" +
"public void the_DI_system_receives_a_message_saying(String string) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("the DI system receives a message saying \"{ dataIngestion: { feeds: [ feed: { merchantId: 666, feedId: 1, feedFileLocation: feed.csv } ] }\""));
}
Expand All @@ -129,7 +129,7 @@ public void generatesSnippetWithDollarSigns() {
"@Given(\"I have ${int}\")\n" +
"public void i_have_$(Integer int1) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have $5"));
}
Expand All @@ -140,7 +140,7 @@ public void generatesSnippetWithQuestionMarks() {
"@Given(\"is there an error?:\")\n" +
"public void is_there_an_error() {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("is there an error?:"));
}
Expand All @@ -151,7 +151,7 @@ public void generatesSnippetWithLotsOfNonIdentifierCharacters() {
"@Given(\"\\\\([a-z]*)?.+\")\n" +
"public void a_z() {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("([a-z]*)?.+"));
}
Expand All @@ -162,7 +162,7 @@ public void generatesSnippetWithParentheses() {
"@Given(\"I have {int} cukes \\\\(maybe more)\")\n" +
"public void i_have_cukes_maybe_more(Integer int1) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have 5 cukes (maybe more)"));
}
Expand All @@ -173,7 +173,7 @@ public void generatesSnippetWithBrackets() {
"@Given(\"I have {int} cukes [maybe more]\")\n" +
"public void i_have_cukes_maybe_more(Integer int1) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetFor("I have 5 cukes [maybe more]"));
}
Expand All @@ -184,7 +184,7 @@ public void generatesSnippetWithDocString() {
"@Given(\"I have:\")\n" +
"public void i_have(String docString) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetForDocString("I have:", new PickleString(null, "hello")));
}
Expand All @@ -208,7 +208,7 @@ public String transform(String... strings) {
"@Given(\"I have a {docString}:\")\n" +
"public void i_have_a(String docString, String docString1) {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
assertEquals(expected, snippetForDocString("I have a \"Documentation String\":", new PickleString(null, "hello"), customParameterType));
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public void generatesSnippetWithDataTable() {
" // Double, Byte Short, Long, BigInteger or BigDecimal.\n" +
" //\n" +
" // For other transformations you can register a DataTableType.\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
PickleTable dataTable = new PickleTable(asList(new PickleRow(asList(new PickleCell(null, "col1")))));
assertEquals(expected, snippetForDataTable("I have:", dataTable));
Expand Down Expand Up @@ -270,7 +270,7 @@ public String transform(String... strings) {
" // For other transformations you can register a DataTableType.\n" +
// " //\n" +
// " // See: TODO URL\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";
PickleTable dataTable = new PickleTable(asList(new PickleRow(asList(new PickleCell(null, "col1")))));
assertEquals(expected, snippetForDataTable("I have in table \"M6\":", dataTable, customParameterType));
Expand All @@ -282,7 +282,7 @@ public void generateSnippetWithOutlineParam() {
"@Given(\"Then it responds <param>\")\n" +
"public void then_it_responds_param() {\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException();\n" +
" throw new cucumber.api.PendingException();\n" +
"}\n";

assertEquals(expected, snippetFor("Then it responds <param>"));
Expand Down

0 comments on commit 4c9b6f1

Please sign in to comment.