use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType in project sldeditor by robward-scisys.
the class WKTConversionTest method testCreateEmpty.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTConversion#createEmpty(com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType)}.
*/
@Test
public void testCreateEmpty() {
WKTType wktType = null;
WKTGeometry geometry = WKTConversion.createEmpty(wktType);
assertNull(geometry.getGeometryType());
wktType = new WKTType("name", false, 5, "", false, true);
geometry = WKTConversion.createEmpty(wktType);
assertEquals(wktType, geometry.getGeometryType());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType in project sldeditor by robward-scisys.
the class WKTGeometryTest method testHashCode.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#hashCode()}.
*/
@Test
public void testHashCode() {
WKTGeometry g = new WKTGeometry();
String expectedListItem = "listitem";
WKTType wktType = new WKTType("name", false, 5, expectedListItem, false, true);
g.setGeometryType(wktType);
g.addNewShape();
g.addNewShape();
g.addNewShape();
WKTGeometry g2 = new WKTGeometry();
g2.setGeometryType(wktType);
g2.addNewShape();
g2.addNewShape();
assertTrue(g.hashCode() != g2.hashCode());
assertTrue(g.equals(g));
assertFalse(g.equals(null));
assertFalse(g.equals(expectedListItem));
WKTGeometry g3 = new WKTGeometry();
WKTType wktType2 = new WKTType("name", false, 5, expectedListItem, true, true);
g3.setGeometryType(wktType2);
g3.addNewShape();
g3.addNewShape();
g3.addNewShape();
assertFalse(g.equals(g3));
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType in project sldeditor by robward-scisys.
the class WKTGeometryTest method testAddNewSegment.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#addNewSegment()}. Test
* method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#addNewSegment(int)}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#isEmpty()}. Test
* method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#getSegmentList(int)}.
*/
@Test
public void testAddNewSegment() {
WKTGeometry g = new WKTGeometry();
WKTType wktType = new WKTType("name", false, 5, "", false, true);
g.setGeometryType(wktType);
g.addNewSegment();
assertFalse(g.isEmpty());
assertEquals(1, g.getNoOfSegments());
assertEquals(-1, g.addNewSegment(-3));
assertFalse(g.isEmpty());
assertEquals(1, g.getNoOfSegments());
assertEquals(0, g.addNewSegment(3));
assertFalse(g.isEmpty());
assertEquals(2, g.getNoOfSegments());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType in project sldeditor by robward-scisys.
the class WKTConversionTest method testGetWKTTypeData.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTConversion#getWKTTypeData()}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTConversion#getWKTType(java.lang.String)}.
*/
@Test
public void testGetWKTTypeData() {
String geometryType = "POLYGON";
WKTType wktType = WKTConversion.getWKTType(geometryType);
assertNotNull(wktType);
List<WKTType> data = WKTConversion.getWKTTypeData();
assertFalse(data.isEmpty());
data = WKTConversion.getWKTTypeData();
assertFalse(data.isEmpty());
wktType = WKTConversion.getWKTType(geometryType);
assertNotNull(wktType);
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType in project sldeditor by robward-scisys.
the class WKTGeometryTest method testGetGeometryType.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#getGeometryType()}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTGeometry#setGeometryType(com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.WKTType)}.
*/
@Test
public void testGetGeometryType() {
WKTGeometry g = new WKTGeometry();
WKTType wktType = new WKTType("name", false, 5, "", false, true);
g.setGeometryType(wktType);
assertEquals(wktType, g.getGeometryType());
}
Aggregations