* de.hpi.eworld.model.db.data.event.PolygonLocation
*/
@Test
public void testPolygonLocation () {
PolygonLocationModel pl = new PolygonLocationModel();
List<GlobalPosition> positions = new ArrayList<GlobalPosition>();
Point2D p1 = new Point2D.Double(3,4);
GlobalPosition gp1 = GlobalPosition.from(p1);
positions.add(gp1);
Point2D p2 = new Point2D.Double(13,14);
GlobalPosition gp2 = GlobalPosition.from(p2);
positions.add(gp2);
Point2D p3 = new Point2D.Double(22,23);
GlobalPosition gp3 = GlobalPosition.from(p3);
positions.add(gp3);
Point2D p4 = new Point2D.Double(12,9);
GlobalPosition gp4 = GlobalPosition.from(p4);
positions.add(gp4);
Point2D p5 = new Point2D.Double(3,34);
GlobalPosition gp5 = GlobalPosition.from(p5);
positions.add(gp5);
pl.setPoints(positions);
Assert.assertEquals(5, pl.getPoints().size());
pl.removePointAt(5);
Assert.assertEquals(5, pl.getPoints().size());
pl.removePointAt(-12);
Assert.assertEquals(5, pl.getPoints().size());
pl.removePointAt(3);
Assert.assertEquals(4, pl.getPoints().size());
pl.removePoint(gp1);
Assert.assertEquals(3, pl.getPoints().size());
Assert.assertNotSame(gp1, pl.getPoints().get(0));
Assert.assertEquals(gp2, pl.getPoints().get(0));
Point2D p6 = new Point2D.Double(33,16);
GlobalPosition gp6 = GlobalPosition.from(p6);
pl.addPoint(gp6);
Assert.assertEquals(4, pl.getPoints().size());
Point2D p7 = new Point2D.Double(33,16);
GlobalPosition gp7 = GlobalPosition.from(p7);
pl.addPointAt(2, gp7);
Assert.assertEquals(gp7, pl.getPoints().get(2));
}