Skip to content

Commit 787c688

Browse files
committed
Now removing characters in feature file that cannot form an acceptable term in Java
1 parent 94ac7dd commit 787c688

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1752
-1624
lines changed

.idea/workspace.xml

Lines changed: 84 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/gherkinexecutor/Translate.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static String filterWord(String input) {
158158
if (input == null) {
159159
return "";
160160
}
161-
return input.replaceAll("[^0-9a-zA-Z_]", "");
161+
return input.replaceAll("[^0-9a-zA-Z_\\*]", "");
162162
}
163163
private static String wordWithOutColon(String word) {
164164
return word.replaceAll("^:+|:+$", "");
@@ -171,7 +171,8 @@ private static String wordWithOutHash(String word) {
171171
private void actOnKeyword(String keyword, List<String> words,
172172
List<String> comment, int pass) {
173173
String fullName = makeFullName(words);
174-
trace("Act on keyword " + keyword + " " + fullName + " pass " + pass);
174+
trace("Act on keyword " + keyword + " " + fullName + " words " + words + " pass " + pass);
175+
175176
if (keyword.equals("Star")) {
176177
switch (words.get(1)) {
177178
case "Data":
@@ -258,7 +259,7 @@ private void actOnKeyword(String keyword, List<String> words,
258259

259260
void writeInputFeature(String filename) {
260261
String fullFilename = filename + "feature.txt";
261-
System.out.println("Logging to " + fullFilename);
262+
printFlow("Logging to " + fullFilename);
262263
try {
263264
FileWriter myLog = new FileWriter(fullFilename);
264265
myLog.write(dataIn.toString());

src/test/java/full_test.feature.sav

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ Include "data_definition_error.feature"
66
Include "define.feature"
77
Include "examples.feature"
88
Include "import.feature"
9-
Include "include.feature"
10-
Include "parse_CSV.feature"
9+
Include "include.feature"
1110
Include "simple_test.feature"
1211
Include "tables_and_strings.feature"
1312
Include "tic_tac_toe.feature

src/test/java/gherkinexecutor/Feature_Examples/FilterValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static String listToJson(List<FilterValue> list) {
110110
public static List<FilterValue> listFromJson(String json) {
111111
List<FilterValue> list = new ArrayList<>();
112112
json = json.replaceAll("\\s", "");
113-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
113+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
114114

115115
for (String jsonObject : jsonObjects) {
116116
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

src/test/java/gherkinexecutor/Feature_Examples/LabelValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static String listToJson(List<LabelValue> list) {
110110
public static List<LabelValue> listFromJson(String json) {
111111
List<LabelValue> list = new ArrayList<>();
112112
json = json.replaceAll("\\s", "");
113-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
113+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
114114

115115
for (String jsonObject : jsonObjects) {
116116
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

src/test/java/gherkinexecutor/Feature_Examples/ResultValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static String listToJson(List<ResultValue> list) {
9191
public static List<ResultValue> listFromJson(String json) {
9292
List<ResultValue> list = new ArrayList<>();
9393
json = json.replaceAll("\\s", "");
94-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
94+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
9595

9696
for (String jsonObject : jsonObjects) {
9797
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

src/test/java/gherkinexecutor/Feature_Examples/TemperatureCalculation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static String listToJson(List<TemperatureCalculation> list) {
129129
public static List<TemperatureCalculation> listFromJson(String json) {
130130
List<TemperatureCalculation> list = new ArrayList<>();
131131
json = json.replaceAll("\\s", "");
132-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
132+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
133133

134134
for (String jsonObject : jsonObjects) {
135135
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

src/test/java/gherkinexecutor/Feature_Examples/ValueValid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static String listToJson(List<ValueValid> list) {
129129
public static List<ValueValid> listFromJson(String json) {
130130
List<ValueValid> list = new ArrayList<>();
131131
json = json.replaceAll("\\s", "");
132-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
132+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
133133

134134
for (String jsonObject : jsonObjects) {
135135
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

src/test/java/gherkinexecutor/Feature_Full_Test/ATest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public static class Builder {
4040
private String anInt = "0";
4141
private String aString = " ";
4242
private String aDouble = "4.0";
43-
public Builder anInt(String anInt) {
43+
public Builder setAnInt(String anInt) {
4444
this.anInt = anInt;
4545
return this;
4646
}
47-
public Builder aString(String aString) {
47+
public Builder setAString(String aString) {
4848
this.aString = aString;
4949
return this;
5050
}
51-
public Builder aDouble(String aDouble) {
51+
public Builder setADouble(String aDouble) {
5252
this.aDouble = aDouble;
5353
return this;
5454
}
@@ -131,7 +131,7 @@ public static String listToJson(List<ATest> list) {
131131
public static List<ATest> listFromJson(String json) {
132132
List<ATest> list = new ArrayList<>();
133133
json = json.replaceAll("\\s", "");
134-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
134+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
135135

136136
for (String jsonObject : jsonObjects) {
137137
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

src/test/java/gherkinexecutor/Feature_Full_Test/ATest0.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public static class Builder {
4040
private String anInt = "0";
4141
private String aString = "^";
4242
private String aDouble = "1.2";
43-
public Builder anInt(String anInt) {
43+
public Builder setAnInt(String anInt) {
4444
this.anInt = anInt;
4545
return this;
4646
}
47-
public Builder aString(String aString) {
47+
public Builder setAString(String aString) {
4848
this.aString = aString;
4949
return this;
5050
}
51-
public Builder aDouble(String aDouble) {
51+
public Builder setADouble(String aDouble) {
5252
this.aDouble = aDouble;
5353
return this;
5454
}
@@ -131,7 +131,7 @@ public static String listToJson(List<ATest0> list) {
131131
public static List<ATest0> listFromJson(String json) {
132132
List<ATest0> list = new ArrayList<>();
133133
json = json.replaceAll("\\s", "");
134-
String[] jsonObjects = json.replace("[", "").replace("]", "").split("\\},\\{");
134+
String[] jsonObjects = json.replace("[", "").replace("]", "").split("[},{]");
135135

136136
for (String jsonObject : jsonObjects) {
137137
jsonObject = "{" + jsonObject.replace("{", "").replace("}", "") + "}";

0 commit comments

Comments
 (0)