public void testRestoreGroovyBean1() throws Exception
{
GroovyClassLoader cl = new GroovyClassLoader();
Class c = cl.parseClass(Thread.currentThread().getContextClassLoader().getResourceAsStream("BookStorage.groovy"));
JsonParserImpl jsonParser = new JsonParserImpl();
JsonHandler jsonHandler = new JsonDefaultHandler();
jsonParser.parse(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(
"BookStorage.txt")), jsonHandler);
JsonValue jv = jsonHandler.getJsonObject();
GroovyObject o = (GroovyObject)ObjectBuilder.createObject(c, jv);
//System.out.println(o);
List<GroovyObject> books = (List<GroovyObject>)o.getProperty("books");
assertEquals(3, books.size());
assertEquals(books.get(0).getProperty("title"), "JUnit in Action");