Search in sources :

Example 6 with GWTBounds

use of org.opennms.features.poller.remote.gwt.client.GWTBounds in project opennms by OpenNMS.

the class BoundsBuilderTest method testAddOnePoint.

@Test
public void testAddOnePoint() {
    BoundsBuilder bldr = new BoundsBuilder();
    GWTLatLng origin = new GWTLatLng(0.0, 0.0);
    bldr.extend(origin);
    assertEquals(new GWTBounds(origin, origin), bldr.getBounds());
}
Also used : GWTLatLng(org.opennms.features.poller.remote.gwt.client.GWTLatLng) GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 7 with GWTBounds

use of org.opennms.features.poller.remote.gwt.client.GWTBounds in project opennms by OpenNMS.

the class BoundsBuilderTest method testAddTwoCornerPoints.

@Test
public void testAddTwoCornerPoints() {
    BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(0.0, 0.0);
    bldr.extend(1.0, 1.0);
    assertEquals(new GWTBounds(0.0, 0.0, 1.0, 1.0), bldr.getBounds());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 8 with GWTBounds

use of org.opennms.features.poller.remote.gwt.client.GWTBounds 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());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 9 with GWTBounds

use of org.opennms.features.poller.remote.gwt.client.GWTBounds 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());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 10 with GWTBounds

use of org.opennms.features.poller.remote.gwt.client.GWTBounds 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());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 GWTBounds (org.opennms.features.poller.remote.gwt.client.GWTBounds)11 BoundsBuilder (org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder)11 GWTLatLng (org.opennms.features.poller.remote.gwt.client.GWTLatLng)1