fail("exception should'nt occur");
}
assertNotNull("Map should'nt be null", map);
BeanDocument doc = new BeanDocument(CampaignClient.getInstance()
.getRootDirectory(), targetName, "document-type", map);
doc = addBean(doc);
map = doc.getBean();
Scale newScale = new Scale(map.getScale().getPixels() + 5, map
.getScale().getMeter());
map.setScale(newScale);
Integer newWidth = map.getWidth() + 5;
map.setWidth(newWidth);
Integer newHeight = map.getHeight() + 5;
map.setHeight(newHeight);
ImageBean imageBean = createBeanImage();
CampaignClient.getInstance().addBean(imageBean);
UniqueID newImage = imageBean.getId();
map.setBackground(newImage);
UniqueID newFilter = new UniqueID();
map.setFilter(newFilter);
HashSet<UniqueID> set = new HashSet<UniqueID>();
set.add(new UniqueID());
set.add(new UniqueID());
map.setElements(set);
waitForChange(map, "getScale", newScale);
waitForChange(map, "getWidth", newWidth);
waitForChange(map, "getHeight", newHeight);
waitForChange(map, "getBackground", newImage);
waitForChange(map, "getFilter", newFilter);
waitForChange(map, "getElements", set);
// Remove the battle
CampaignClient.getInstance().removeBean(doc);
long begin = System.currentTimeMillis();
long current = System.currentTimeMillis();
while (CampaignClient.getInstance().getBean(doc.getBeanId()) != null
&& (current - begin) < timeout) {
sleep();
current = System.currentTimeMillis();
}
}