You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Invoker3.java 725B

123456789101112131415161718192021222324
  1. public class Invoker3 {
  2. public static void main(String[] args) throws Throwable {
  3. try {
  4. C3.main(null);
  5. }
  6. catch (Throwable t) {
  7. boolean failedCorrectly = t.toString().indexOf("Unresolved compilation") != -1;
  8. if (failedCorrectly)
  9. return;
  10. throw new RuntimeException("Call to main should have failed!", t);
  11. }
  12. try {
  13. new C3();
  14. }
  15. catch (Throwable t) {
  16. boolean failedCorrectly =
  17. t.toString().contains("Unresolved compilation problem") &&
  18. t.toString().contains("blahblahpackage cannot be resolved to a type");
  19. if (failedCorrectly)
  20. return;
  21. throw new RuntimeException("Constructor call should have failed!", t);
  22. }
  23. }
  24. }