SessionAwareCache<PreparedPlan> cache = new SessionAwareCache<PreparedPlan>();
//Try before plan is cached.
//If this doesn't throw an exception, assume it was successful.
RequestMessage message = new RequestMessage(QUERY);
DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.example1VDB());
message.setStatementType(StatementType.PREPARED);
message.setParameterValues(new ArrayList());
helpProcessMessage(message, cache, workContext);
//Try again, now that plan is already cached.
//If this doesn't throw an exception, assume it was successful.
message = new RequestMessage(QUERY);
message.setStatementType(StatementType.PREPARED);
message.setParameterValues(new ArrayList());
helpProcessMessage(message, cache, workContext);
}