@Ignore("todo")
@Test
public void test() throws Exception {
Context tlContext = Context.newTopLevelContext();
Namespace ns = tlContext.getNamespaceRegistry().createNamespace(new TestPackage());
Context ctx = tlContext.beginEvalContext(ns.getNamespaceEnvironment());
ctx.evaluate(RParser.parseSource("f <- function(x) x*x*42\n"));
File envFile = File.createTempFile("nstest", ".RData");
envFile.deleteOnExit();
LazyLoadFrameBuilder builder = new LazyLoadFrameBuilder(tlContext);
builder.outputTo(envFile);
builder.build(ns.getNamespaceEnvironment());
// now reload into a new context
tlContext = Context.newTopLevelContext();
tlContext.getNamespaceRegistry().createNamespace(new TestPackage());