use of org.geosdi.geoplatform.request.viewport.InsertViewportRequest in project geo-platform by geosdi.
the class RSViewportTest method updateViewportTestRest.
@Test
public void updateViewportTestRest() throws Exception {
Long idViewportDefault = gpWSClient.insertViewport(new InsertViewportRequest(idAccountProject, new GPViewport("Viewport-To-Save-RS", "This is the viewport to save", 22, new GPBBox(10, 10, 20, 20), Boolean.TRUE)));
Assert.assertNotNull(idViewportDefault);
Long idViewport = gpWSClient.insertViewport(new InsertViewportRequest(idAccountProject, new GPViewport("Viewport-To-Save-New-RS", "This is the viewport to save New", 18, new GPBBox(18, 20, 40, 29), Boolean.FALSE)));
Assert.assertNotNull(idViewport);
Long idViewport1 = gpWSClient.insertViewport(new InsertViewportRequest(idAccountProject, new GPViewport("Viewport-To-Save-New-1-RS", "This is the viewport to save New", 31, new GPBBox(21, 33, 50, 79), Boolean.FALSE)));
Assert.assertNotNull(idViewport1);
Collection<GPViewport> viewports = gpWSClient.getAccountProjectViewports(idAccountProject).getViewports();
Assert.assertEquals(3, viewports.size());
GPViewport viewport = gpWSClient.getDefaultViewport(idAccountProject);
Assert.assertEquals(Boolean.TRUE, viewport.isIsDefault());
Assert.assertEquals("Viewport-To-Save-RS", viewport.getName());
viewport.setName("Viewport-Updated-RS");
viewport.setDescription("New Description");
viewport.setIsDefault(Boolean.FALSE);
gpWSClient.updateViewport(viewport);
GPViewport v = gpWSClient.getViewportById(idViewport1);
v.setIsDefault(Boolean.TRUE);
gpWSClient.updateViewport(v);
GPViewport df = gpWSClient.getDefaultViewport(idAccountProject);
Assert.assertEquals(idViewport1, df.getId());
}
use of org.geosdi.geoplatform.request.viewport.InsertViewportRequest in project geo-platform by geosdi.
the class RSViewportTest method deleteViewportTestRest.
@Test
public void deleteViewportTestRest() throws Exception {
Long idViewport = gpWSClient.insertViewport(new InsertViewportRequest(idAccountProject, new GPViewport("Viewport-To-Delete-RS", "This is the viewport to Delete", 26, new GPBBox(15, 15, 22, 30), Boolean.TRUE)));
Assert.assertNotNull(idViewport);
GPViewport viewport = gpWSClient.getViewportById(idViewport);
Assert.assertNotNull(viewport);
logger.trace("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@VIEWPORT_FOUND :" + " {}\n\n", viewport);
Assert.assertTrue(gpWSClient.deleteViewport(idViewport));
}
Aggregations