Guest User

Untitled

a guest
Nov 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. class Another
  2. {
  3. protected String name="";
  4. public Another() {}
  5. public main(String[] args) {}
  6. public boolean getResult() {return true;}
  7. public String getName() {return name;}
  8. public void setName(String value) {name=value;}
  9. }
  10.  
  11. evaluate(new File("autotest/sources/Another.groovy"))
  12. import support.tool.AutotestResult;
  13. public class Another2 extends obj.getClass
  14. {
  15. public Another2()
  16. {
  17. this.setName(this.name+"N");
  18. }
  19. public AutotestResult run()
  20. {
  21. return new AutotestResult(this.name+"123",this.getResult(),null,null)
  22. }
  23. }
  24. Another2 a = new Another2()
  25. a.run()
  26.  
  27. String[] paths = {"autotest\cases\test.groovy"};
  28. GroovyScriptEngine gse = new GroovyScriptEngine(paths);
  29. Binding binding = new Binding();
  30. binding.setVariable("args",null);
  31. System.out.println(((AutotestResult)gse.run("test.groovy", binding)).toJSON());
  32.  
  33. Exception in thread "main" org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  34. file:/.../autotest/cases/test.groovy: 6: unable to resolve class Another
  35. @ line 6, column 1.
  36. public class Another2 extends Another
  37. ^
Add Comment
Please, Sign In to add comment