File tree 2 files changed +57
-0
lines changed
2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,12 @@ gradlew clean build test
103
103
gradlew testWithStrictMode
104
104
```
105
105
106
+ * Optional* Execute the test suite in strict mode with Maven:
107
+
108
+ ``` shell
109
+ mvn test -P test-strict-mode
110
+ ```
111
+
106
112
# Notes
107
113
108
114
For more information, please see [ NOTES.md] ( https://github.com/stleary/JSON-java/blob/master/docs/NOTES.md )
Original file line number Diff line number Diff line change 200
200
</plugin >
201
201
</plugins >
202
202
</build >
203
+ <profiles >
204
+ <profile >
205
+ <id >test-strict-mode</id >
206
+ <build >
207
+ <plugins >
208
+ <plugin >
209
+ <groupId >com.google.code.maven-replacer-plugin</groupId >
210
+ <artifactId >replacer</artifactId >
211
+ <version >1.5.3</version >
212
+ <executions >
213
+ <!-- Enable strict mode -->
214
+ <execution >
215
+ <id >enable-strict-mode</id >
216
+ <phase >process-sources</phase >
217
+ <goals >
218
+ <goal >replace</goal >
219
+ </goals >
220
+ <configuration >
221
+ <file >src/main/java/org/json/JSONParserConfiguration.java</file >
222
+ <replacements >
223
+ <replacement >
224
+ <token >// this.strictMode = true;</token >
225
+ <value >this.strictMode = true;</value >
226
+ </replacement >
227
+ </replacements >
228
+ </configuration >
229
+ </execution >
230
+ <!-- Restore original code after tests -->
231
+ <execution >
232
+ <id >restore-original</id >
233
+ <phase >test</phase >
234
+ <goals >
235
+ <goal >replace</goal >
236
+ </goals >
237
+ <configuration >
238
+ <file >src/main/java/org/json/JSONParserConfiguration.java</file >
239
+ <replacements >
240
+ <replacement >
241
+ <token >this.strictMode = true;</token >
242
+ <value >// this.strictMode = true;</value >
243
+ </replacement >
244
+ </replacements >
245
+ </configuration >
246
+ </execution >
247
+ </executions >
248
+ </plugin >
249
+ </plugins >
250
+ </build >
251
+ </profile >
252
+ </profiles >
253
+
203
254
</project >
You can’t perform that action at this time.
0 commit comments