@Test public void testNullTable() throws Exception { DescribeOp describe = new DescribeOp(); describe.setDataStore(TestHelper.createEmptyTestFactory().createDataStore(null)); exception.expect(GeoToolsOpException.class); describe.call(); }
@Test public void testNullDataStore() throws Exception { DescribeOp describe = new DescribeOp(); describe.setTable("table1"); exception.expect(GeoToolsOpException.class); describe.call(); }
@Test public void testTypeNameException() throws Exception { DescribeOp describe = new DescribeOp(); describe.setDataStore(TestHelper.createFactoryWithGetNamesException().createDataStore(null)); describe.setTable("table1"); exception.expect(GeoToolsOpException.class); describe.call(); }
@Test public void testEmptyDataStore() throws Exception { DescribeOp describe = new DescribeOp(); describe.setDataStore(TestHelper.createEmptyTestFactory().createDataStore(null)); describe.setTable("table1"); Optional<Map<String, String>> features = describe.call(); assertFalse(features.isPresent()); }
@Test public void testDescribe() throws Exception { DescribeOp describe = new DescribeOp(); describe.setDataStore(TestHelper.createTestFactory().createDataStore(null)); describe.setTable("table1"); Optional<Map<String, String>> properties = describe.call(); assertTrue(properties.isPresent()); assertEquals("Point", properties.get().get("geom")); assertEquals("String", properties.get().get("label")); }