// =====================================================================
VariablePolicyBuilder policyBuilder =
factory.createVariablePolicyBuilder(PolicyType.IMAGE);
VariantBuilder variantBuilder =
factory.createVariantBuilder(VariantType.IMAGE);
policyBuilder.addVariantBuilder(variantBuilder);
// Selection.
TargetedSelectionBuilder targeted =
factory.createTargetedSelectionBuilder();
targeted.addDevice("PC");
targeted.addDevice("Master");
variantBuilder.setSelectionBuilder(targeted);
// Meta Data.
ImageMetaDataBuilder imageBuilder =
factory.createImageMetaDataBuilder();
imageBuilder.setConversionMode(ImageConversionMode.NEVER_CONVERT);
imageBuilder.setImageEncoding(ImageEncoding.GIF);
imageBuilder.setWidth(10);
imageBuilder.setHeight(50);
imageBuilder.setPixelDepth(12);
variantBuilder.setMetaDataBuilder(imageBuilder);
// Content.
URLContentBuilder content = factory.createURLContentBuilder();
content.setURL("fred.gif");
variantBuilder.setContentBuilder(content);
Variant variant = variantBuilder.getVariant();
ActivatedVariablePolicy activatedVariablePolicy =
new ActivatedVariablePolicyImpl(
policyBuilder.getVariablePolicy(), actualProjectMock,
logicalProjectMock);