@Test(timeout = 5000)
public void testRectangle() {
MapBean battle = getBattle();
MapElementSize width = new MapElementSizePixel(20.0);
MapElementSize height = new MapElementSizePixel(20.0);
Point position = new Point(5, 5);
RectangleElement targetRectangle = new RectangleElement(position,
Color.RED, width, height);
MapElementFactory.buildMapElement(targetRectangle, battle);
RectangleElement rectangle = CampaignClient.getInstance().getBean(
targetRectangle.getId(), 300L);
assertEquals("The position should be equals", position,
rectangle.getPosition());
assertEquals("The color should be equals", Color.RED,
rectangle.getColor());
assertEquals("The angle should be equals", Double.valueOf(0),
rectangle.getAngle());
assertEquals("The width should be equals", width.getPixels(battle
.getScale()), rectangle.getWidth().getPixels(battle.getScale()));
assertEquals("The height should be equals", height.getPixels(battle
.getScale()), rectangle.getHeight()
.getPixels(battle.getScale()));
MapElementSize newWidth = new MapElementSizeSquare(2.0);
MapElementSize newHeight = new MapElementSizeSquare(3.0);