public void test() {
   try {
     policy.initialize((AbstractSession) getSession());
   } catch (EclipseLinkException exception) {
     caughtException = exception;
   }
 }
  protected void setup() {
    descriptor = new RelationalDescriptor();
    descriptor.setJavaClass(ClassWithProblemConstructor.class);
    //   descriptor.setJavaClass(TargetInvocationWhileConstructorInstantiationOfFactoryTest.class);
    //  //no problems
    descriptor.addTableName("EMPLOYEE");
    policy = descriptor.getInstantiationPolicy();
    policy.setMethodName("method");
    policy.useFactoryInstantiationPolicy(ClassWithProblemConstructor.class, "method");

    orgIntegrityChecker = getSession().getIntegrityChecker();
    getSession().setIntegrityChecker(new IntegrityChecker()); // moved into setup
    getSession().getIntegrityChecker().dontCatchExceptions(); // moved into setup

    expectedException =
        DescriptorException.targetInvocationWhileConstructorInstantiationOfFactory(
            descriptor, new Exception());
  }