418 |
|
for (String testClassName : testClassNames) { |
419 |
|
try { |
420 |
|
Class<?> testClass = Class.forName(testClassName); |
421 |
< |
Method m = testClass.getDeclaredMethod("suite", |
422 |
< |
new Class<?>[0]); |
421 |
> |
Method m = testClass.getDeclaredMethod("suite"); |
422 |
|
suite.addTest(newTestSuite((Test)m.invoke(null))); |
423 |
< |
} catch (Exception e) { |
424 |
< |
throw new Error("Missing test class", e); |
423 |
> |
} catch (ReflectiveOperationException e) { |
424 |
> |
throw new AssertionError("Missing test class", e); |
425 |
|
} |
426 |
|
} |
427 |
|
} |
598 |
|
for (String methodName : testMethodNames(testClass)) |
599 |
|
suite.addTest((Test) c.newInstance(data, methodName)); |
600 |
|
return suite; |
601 |
< |
} catch (Exception e) { |
602 |
< |
throw new Error(e); |
601 |
> |
} catch (ReflectiveOperationException e) { |
602 |
> |
throw new AssertionError(e); |
603 |
|
} |
604 |
|
} |
605 |
|
|
615 |
|
if (atLeastJava8()) { |
616 |
|
String name = testClass.getName(); |
617 |
|
String name8 = name.replaceAll("Test$", "8Test"); |
618 |
< |
if (name.equals(name8)) throw new Error(name); |
618 |
> |
if (name.equals(name8)) throw new AssertionError(name); |
619 |
|
try { |
620 |
|
return (Test) |
621 |
|
Class.forName(name8) |
622 |
< |
.getMethod("testSuite", new Class[] { dataClass }) |
622 |
> |
.getMethod("testSuite", dataClass) |
623 |
|
.invoke(null, data); |
624 |
< |
} catch (Exception e) { |
625 |
< |
throw new Error(e); |
624 |
> |
} catch (ReflectiveOperationException e) { |
625 |
> |
throw new AssertionError(e); |
626 |
|
} |
627 |
|
} else { |
628 |
|
return new TestSuite(); |
1088 |
|
for (long retries = LONG_DELAY_MS * 3 / 4; retries-->0; ) { |
1089 |
|
try { delay(1); } |
1090 |
|
catch (InterruptedException fail) { |
1091 |
< |
fail("Unexpected InterruptedException"); |
1091 |
> |
throw new AssertionError("Unexpected InterruptedException", fail); |
1092 |
|
} |
1093 |
|
Thread.State s = thread.getState(); |
1094 |
|
if (s == expected) |