Skip to content

Instantly share code, notes, and snippets.

@qmx
Forked from bobmcwhirter/Process.java
Created May 8, 2012 19:43
Show Gist options
  • Save qmx/2638783 to your computer and use it in GitHub Desktop.
Save qmx/2638783 to your computer and use it in GitHub Desktop.
test
@Test
public void testTitleSetting() throws Exception {
DynThreadContext context = new DynThreadContext();
DynJSConfig config = new DynJSConfig();
DynJS runtime = new DynJS(config);
Process p = new Process();
context.getScope().define("process", p);
runtime.eval( context, "var result = process.title()" );
//runtime.eval( context, "var result = process;" );
Object result = context.getScope().resolve( "result" );
System.err.println( "result=" + result );
}
public class Process extends DynObject {
public Process() {
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return this.title;
}
public String title() {
return this.title;
}
public void title(String val) {
this.title = val;
}
private String title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment