/**
* Test the construction from a reader.
*/
public void test_newFromReader() {
JSONArray jArray = null;
Exception ex = null;
// read in a basic JSON file of a toplevel array that has all the various types in it.
try {
Reader rdr = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("utf8_basic_array.json"), "UTF-8");
System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
JSONFactory factory = JSONFactory.newInstance();
jArray = factory.createJSONArray(rdr);
rdr.close();
} catch (Exception ex1) {
ex = ex1;
ex.printStackTrace();
}
assertTrue(jArray != null);
assertTrue(jArray.length() == 7);
assertTrue(ex == null);
}