{
Resource base = newResource();
Resource relative = newResource();
Location l = newLocation();
IComponentSpecification spec = newMock(IComponentSpecification.class);
WebContext context = newMock(WebContext.class);
trainGetRelativeResource(base, "/", base);
trainGetRelativeResource(base, "asset.png", relative);
trainGetLocalization(relative, Locale.FRENCH, null);
trainGetRelativeResource(base, "asset.png", relative);
trainGetLocalization(relative, Locale.FRENCH, null);
expect(spec.getLocation()).andReturn(l);
expect(l.getResource()).andReturn(null);
expect(context.getResource("/asset_fr.png")).andReturn(null);
expect(context.getResource("/asset.png")).andReturn(null);
replay();
ContextAssetFactory factory = new ContextAssetFactory();
factory.setLocalizer(new DefaultResourceLocalizer());