use of org.eclipse.persistence.mappings.transformers.MethodBasedAttributeTransformer in project eclipselink by eclipse-ee4j.
the class TargetInvocationWhileInstantiatingMethodBasedProxyTest method setup.
@Override
protected void setup() throws NoSuchMethodException {
descriptor = new RelationalDescriptor();
descriptor.setJavaClass(TargetInvocationWhileInstantiatingMethodBasedProxyTest.class);
descriptor.addTableName("Dummy_Table");
row = new DatabaseRecord();
Class<?>[] parmClasses = { DatabaseRecord.class };
theMethod = TargetInvocationWhileInstantiatingMethodBasedProxyTest.class.getDeclaredMethod("invalidMethod", parmClasses);
theTransformer = new MethodBasedAttributeTransformer();
theTransformer.setAttributeTransformationMethod(theMethod);
theReceiver = new TargetInvocationWhileInstantiatingMethodBasedProxyTest();
valueHolder = new TransformerBasedValueHolder(theTransformer, theReceiver, row, (AbstractSession) getSession());
expectedException = DescriptorException.targetInvocationWhileInstantiatingMethodBasedProxy(new Exception());
}
use of org.eclipse.persistence.mappings.transformers.MethodBasedAttributeTransformer in project eclipselink by eclipse-ee4j.
the class IllegalArgumentWhileInstantiatingMethodBasedProxyTest method setup.
@Override
protected void setup() throws NoSuchMethodException {
descriptor = new RelationalDescriptor();
descriptor.setJavaClass(IllegalArgumentWhileInstantiatingMethodBasedProxyTest.class);
descriptor.addTableName("Dummy_Table");
row = new DatabaseRecord();
Class<?>[] parmClasses = { DatabaseRecord.class };
theTransformer = new MethodBasedAttributeTransformer();
theTransformer.setAttributeTransformationMethod(IllegalArgumentWhileInstantiatingMethodBasedProxyTest.class.getDeclaredMethod("invalidMethod", parmClasses));
// theReceiver = new IllegalArgumentWhileInstantiatingMethodBasedProxyTest(); //not correct error
// the following causes the correct error to occur.
// invalid Receiver causes correct error
theReceiver = new DatabaseRecord();
valueHolder = new TransformerBasedValueHolder(theTransformer, theReceiver, row, (AbstractSession) getSession());
expectedException = DescriptorException.illegalArgumentWhileInstantiatingMethodBasedProxy(new Exception());
}
Aggregations