/**
* Expectations for device independent image processing
*/
private void addImageSrcExpectations(String imageSrc) {
VariantBuilder variantBuilder = POLICY_FACTORY
.createVariantBuilder(VariantType.IMAGE);
variantBuilder.setSelectionBuilder(POLICY_FACTORY
.createDefaultSelectionBuilder());
ImageMetaDataBuilder builder = POLICY_FACTORY
.createImageMetaDataBuilder();
builder.setWidth(100);
builder.setHeight(200);
builder.setImageEncoding(ImageEncoding.JPEG);
builder.setPixelDepth(24);
URLContentBuilder urlContentBuilder = POLICY_FACTORY
.createURLContentBuilder();
urlContentBuilder.setURL("/foo.jpeg");
variantBuilder.setContentBuilder(urlContentBuilder);
variantBuilder.setMetaDataBuilder(builder);
Variant variant = variantBuilder.getVariant();
final RuntimePolicyReferenceMock imageReferenceMock = new RuntimePolicyReferenceMock(
"imageReferenceMock", expectations);
referenceResolverMock.expects.resolveUnquotedPolicyExpression(imageSrc,