public void activate_false_passivate_default()
{
ClassTransformation ct = mockClassTransformation();
MutableComponentModel model = mockMutableComponentModel();
PageActivationContext annotation = newMock(PageActivationContext.class);
ComponentClassTransformWorker worker = new PageActivationContextWorker();
train_findFieldsWithAnnotation(ct, PageActivationContext.class,
"myfield");
train_getFieldAnnotation(ct, "myfield", PageActivationContext.class,
annotation);
train_getFieldType(ct, "myfield", CLASS_NAME);
expect(annotation.activate()).andReturn(false);
expect(annotation.passivate()).andReturn(true);
TransformMethodSignature sig = new TransformMethodSignature(
Modifier.PROTECTED | Modifier.FINAL, "java.lang.Object",
"onPassivate", null, null);
ct.addTransformedMethod(sig, "return ($w) myfield;");
replay();
worker.transform(ct, model);
verify();
}