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