public void test_putJSONObject() {
Exception ex = null;
try {
System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
JSONFactory factory = JSONFactory.newInstance();
JSONArray jArray = factory.createJSONArray();
jArray.put(factory.createJSONObject());
JSONObject obj = (JSONObject)jArray.get(0);
assertTrue(obj != null);
assertTrue(obj instanceof JSONObject);
assertTrue(((JSONObject)jArray.get(0)).toString().equals("{}"));
} catch (Exception ex1) {
ex = ex1;
ex.printStackTrace();
}
assertTrue(ex == null);