-
-
Save qmx/2638783 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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