use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.
the class BoundsBuilderTest method testDatelinePoints.
@Test
public void testDatelinePoints() {
BoundsBuilder bldr = new BoundsBuilder();
bldr.extend(40, -170);
bldr.extend(30, 170);
assertEquals(new GWTBounds(30, 170, 40, -170), bldr.getBounds());
}
use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.
the class BoundsBuilderTest method testExtendWestThenEast.
@Test
public void testExtendWestThenEast() {
BoundsBuilder bldr = new BoundsBuilder();
bldr.extend(0.0, 0.0);
bldr.extend(0.0, -170.0);
assertEquals(new GWTBounds(0.0, -170, 0, 0), bldr.getBounds());
bldr.extend(0.0, 90.0);
assertEquals(new GWTBounds(0, -170, 0, 90), bldr.getBounds());
}
use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.
the class BoundsBuilderTest method testDistanceFromWesternHemi.
@Test
public void testDistanceFromWesternHemi() {
BoundsBuilder bldr = new BoundsBuilder();
bldr.extend(10, -170);
bldr.extend(0, -160);
assertEquals(335.0, bldr.distanceEast(175), 0.0);
assertEquals(35.0, bldr.distanceWest(155), 0.0);
assertEquals(345.0, bldr.distanceEast(-175), 0.0);
assertEquals(5.0, bldr.distanceWest(-175), 0.0);
}
use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.
the class BoundsBuilderTest method testAddManyPoints.
@Test
public void testAddManyPoints() {
BoundsBuilder bldr = new BoundsBuilder();
for (int i = 0; i <= 10; i++) {
bldr.extend(0.0 + i, 0.0);
bldr.extend(0.0, 0.0 - i);
}
assertEquals(new GWTBounds(0.0, -10.0, 10.0, 0.0), bldr.getBounds());
}
use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.
the class BoundsBuilderTest method testAddInteriorPoint.
@Test
public void testAddInteriorPoint() {
BoundsBuilder bldr = new BoundsBuilder();
bldr.extend(0.0, 0.0);
bldr.extend(2.0, 2.0);
assertEquals(new GWTBounds(0.0, 0.0, 2.0, 2.0), bldr.getBounds());
bldr.extend(1.0, 1.0);
// nothing happens because its in the interior
assertEquals(new GWTBounds(0.0, 0.0, 2.0, 2.0), bldr.getBounds());
}
Aggregations