public void testSetNonSequential() throws Exception { GeometryFactory gf = new GeometryFactory(); builder.set("float", new Float(2.0)); builder.set("point", gf.createPoint(new Coordinate(0, 0))); builder.set("integer", Integer.valueOf(1)); SimpleFeature feature = builder.buildFeature("fid"); assertNotNull(feature); assertEquals(3, feature.getAttributeCount()); assertTrue(gf.createPoint(new Coordinate(0, 0)).equals(feature.getAttribute(0))); assertEquals(Integer.valueOf(1), feature.getAttribute(1)); assertEquals(new Float(2.0), feature.getAttribute(2)); }
public void testSetSequential() throws Exception { GeometryFactory gf = new GeometryFactory(); builder.set("point", gf.createPoint(new Coordinate(0, 0))); builder.set("integer", Integer.valueOf(1)); builder.set("float", new Float(2.0)); SimpleFeature feature = builder.buildFeature("fid"); assertNotNull(feature); assertEquals(3, feature.getAttributeCount()); assertTrue(gf.createPoint(new Coordinate(0, 0)).equals(feature.getAttribute(0))); assertEquals(Integer.valueOf(1), feature.getAttribute(1)); assertEquals(new Float(2.0), feature.getAttribute(2)); }
public void testSanity() throws Exception { GeometryFactory gf = new GeometryFactory(); builder.add(gf.createPoint(new Coordinate(0, 0))); builder.add(Integer.valueOf(1)); builder.add(new Float(2.0)); SimpleFeature feature = builder.buildFeature("fid"); assertNotNull(feature); assertEquals(3, feature.getAttributeCount()); assertTrue(gf.createPoint(new Coordinate(0, 0)).equals(feature.getAttribute("point"))); assertEquals(Integer.valueOf(1), feature.getAttribute("integer")); assertEquals(new Float(2.0), feature.getAttribute("float")); }
public void testTooFewAttributes() throws Exception { GeometryFactory gf = new GeometryFactory(); builder.add(gf.createPoint(new Coordinate(0, 0))); builder.add(Integer.valueOf(1)); SimpleFeature feature = builder.buildFeature("fid"); assertNotNull(feature); assertEquals(3, feature.getAttributeCount()); assertTrue(gf.createPoint(new Coordinate(0, 0)).equals(feature.getAttribute("point"))); assertEquals(Integer.valueOf(1), feature.getAttribute("integer")); assertNull(feature.getAttribute("float")); }