requestContext.expects.getEnvironmentContext().returns(envContext);
envContext.expects.getCachingDirectives().returns(null);
strategy.expects.getCharacterData().returns(null);
XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
XFActionAttributes actionAttributes =
(XFActionAttributes) submitElement.getProtocolAttributes();
FieldDescriptor fd = new FieldDescriptor();
actionAttributes.setFieldDescriptor(fd);
context.pushElement(submitElement);
// Run test.
assertNull(actionAttributes.getInitial());
assertNull(actionAttributes.getValue());
assertNull(actionAttributes.getFieldDescriptor().getInitialValue());
XFSetValueElementImpl setValue =
new XFSetValueElementImpl(context, strategy);
setValue.callOpenOnProtocol(context, attributes);
setValue.callCloseOnProtocol(context);
assertEquals(VALUE_FROM_ATTRIBUTE, actionAttributes.getInitial().getText(
TextEncoding.PLAIN));
assertEquals(VALUE_FROM_ATTRIBUTE, actionAttributes.getValue());
assertEquals(VALUE_FROM_ATTRIBUTE,
actionAttributes.getFieldDescriptor().getInitialValue());
}