use of gov.usgs.cida.coastalhazards.model.summary.Tiny in project coastal-hazards by USGS-CIDA.
the class ShorelineTest method testGenerateSLDInfoSelected.
/**
* Test of generateSLDInfo method, of class Shoreline with an overriding
* selected item.
*/
@Test
public void testGenerateSLDInfoSelected() {
Item item = new Item();
Item selectedItem = new Item();
item.setAttr("Date_");
item.setId("abcd");
item.setType(Item.Type.historical);
selectedItem.setAttr("Date_");
selectedItem.setId("efg");
selectedItem.setType(Item.Type.historical);
selectedItem.setItemType(Item.ItemType.aggregation);
List<Service> services = new LinkedList<>();
Service wmsService = new Service();
wmsService.setEndpoint("http://test");
wmsService.setServiceParameter("0");
wmsService.setType(ServiceType.source_wms);
services.add(wmsService);
item.setServices(services);
selectedItem.setServices(services);
Summary summary = new Summary();
Tiny tiny = new Tiny();
tiny.setText("Shoreline");
summary.setTiny(tiny);
item.setSummary(summary);
selectedItem.setSummary(summary);
SLDGenerator shoreline = new SLDGenerator(item, selectedItem.getId(), null, Shorelines.shorelines);
Response response = shoreline.generateSLDInfo();
String json = (String) response.getEntity();
Map<String, Object> sldInfo = new Gson().fromJson(json, HashMap.class);
List<Object> bins = (List) sldInfo.get("bins");
Map<String, Object> bin = (Map) bins.get(0);
Double year0 = ((List<Double>) bin.get("years")).get(0);
String color = (String) bin.get("color");
assertEquals(year0, 0.0f, 0.01f);
assertEquals(color, "#ff0000");
}
use of gov.usgs.cida.coastalhazards.model.summary.Tiny in project coastal-hazards by USGS-CIDA.
the class ShorelineTest method testGenerateSLD.
@Test
public void testGenerateSLD() {
Item item = new Item();
item.setAttr("DATE_");
item.setId("abcde");
item.setType(Item.Type.historical);
List<Service> services = new LinkedList<>();
Service wmsService = new Service();
wmsService.setEndpoint("http://test");
wmsService.setServiceParameter("0");
wmsService.setType(ServiceType.source_wms);
services.add(wmsService);
item.setServices(services);
Summary summary = new Summary();
Tiny tiny = new Tiny();
tiny.setText("Shoreline");
summary.setTiny(tiny);
item.setSummary(summary);
SLDGenerator shoreline = new SLDGenerator(item, item.getId(), null, Shorelines.shorelines);
Response response = shoreline.generateSLD();
Viewable sld = (Viewable) response.getEntity();
}
use of gov.usgs.cida.coastalhazards.model.summary.Tiny in project coastal-hazards by USGS-CIDA.
the class StormUtil method buildTinyText.
private static Tiny buildTinyText(Map<String, String> titleParts) {
Tiny tiny = new Tiny();
tiny.setText(titleParts.get("name") + " Assessment of Potential Coastal-Change Impacts: NHC Adv. " + titleParts.get("advNum"));
return tiny;
}
Aggregations