@Test
public void cached_primitive_write() throws Exception
{
InternalComponentResources resources = mockInternalComponentResources();
Component component = setupForIntegrationTest(resources);
train_isLoaded(resources, true);
train_isBound(resources, "primitive", true);
resources.writeParameter("primitive", 321);
train_isRendering(resources, false);
train_isLoaded(resources, true);
train_isBound(resources, "primitive", true);
train_readParameter(resources, "primitive", Integer.class, 123);
train_isRendering(resources, false);
replay();
access.set(component, "primitive", 321);
assertEquals(access.get(component, "primitive"), 123);
verify();
// Now try during rendering ...
train_isLoaded(resources, true);
train_isBound(resources, "primitive", true);
resources.writeParameter("primitive", 567);
train_isRendering(resources, true);
replay();
access.set(component, "primitive", 567);
assertEquals(access.get(component, "primitive"), 567);
verify();
// And the cached value is lost after rendering is complete.
train_isLoaded(resources, true);
train_isBound(resources, "primitive", true);
train_readParameter(resources, "primitive", Integer.class, 890);
train_isRendering(resources, false);
replay();
component.postRenderCleanup();
assertEquals(access.get(component, "primitive"), 890);
verify();
}