ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.240 by jsr166, Tue Jan 23 22:56:37 2018 UTC vs.
Revision 1.241 by jsr166, Sun Jan 28 16:20:42 2018 UTC

# Line 418 | Line 418 | public class JSR166TestCase extends Test
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      }
# Line 599 | Line 598 | public class JSR166TestCase extends Test
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  
# Line 616 | Line 615 | public class JSR166TestCase extends Test
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();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines