Пример #1
0
 private static Object createTestObject(TestClass testClass) throws InitializationError {
   try {
     return testClass.getOnlyConstructor().newInstance();
   } catch (Exception ex) {
     throw new InitializationError(ex);
   }
 }
Пример #2
0
 public Suite2(Class<?> testClass) throws InitializationError {
   fTestClass = new TestClass(testClass);
   try {
     fInstance = fTestClass.getOnlyConstructor().newInstance();
   } catch (Exception e) {
     throw new InitializationError(e);
   }
 }