我正在做一个我必须执行自动化测试的项目.为此我正在使用Testng框架.
我给出testng.xml
了输入文件,有些方法会消耗它,但是现在我的阅读器方法无法检测到文件.
我在哪个目录中放置我的testng.xml
文件.....并且是否有任何maven规范我必须要pom.xml
检测该testng.xml
文件是否存在并且他们必须阅读它.
我有一个字符串,我想从中创建一个jsonobject
import org.json.JSONObject;
JSONObject json=new JSONObject("{success=false, errorMessage=Application with appId : [randomAppId] not registered, errorCode=102}");
System.out.println("JSON:"+json.toString());
Run Code Online (Sandbox Code Playgroud)
但现在我得到的例外,由于字符像:
,[
,]
这是里面的字符串.
堆栈跟踪:
Exception in thread "main" org.json.JSONException: Expected a ',' or '}' at character 53
at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
at org.json.JSONObject.<init>(JSONObject.java:222)
at org.json.JSONObject.<init>(JSONObject.java:402)
Run Code Online (Sandbox Code Playgroud)