public String getDescription() { return delegate.getDescription(); }
@Test public void testSetupMetadataResourceInfoException() throws Exception { FeatureTypeInfo ftInfo = createMock(FeatureTypeInfo.class); expect(ftInfo.getTitle()).andReturn("foo"); expect(ftInfo.getDescription()).andReturn("foo"); expect(ftInfo.getKeywords()).andReturn(null); replay(ftInfo); FeatureSource fs = createMock(FeatureSource.class); expect(fs.getInfo()).andThrow(new UnsupportedOperationException()); replay(fs); CatalogBuilder cb = new CatalogBuilder(getCatalog()); cb.setupMetadata(ftInfo, fs); }
ftinfo.setTitle(rinfo != null ? rinfo.getTitle() : ftinfo.getName()); if (rinfo != null && ftinfo.getDescription() == null) { ftinfo.setDescription(rinfo.getDescription());
@Test public void testMetadataFromFeatueSource() throws Exception { CatalogBuilder cb = new CatalogBuilder(getCatalog()); cb.setStore(cb.buildDataStore("fooStore")); FeatureType ft = createMock(FeatureType.class); expect(ft.getName()).andReturn(new NameImpl("foo")).anyTimes(); expect(ft.getCoordinateReferenceSystem()).andReturn(null).anyTimes(); expect(ft.getGeometryDescriptor()).andReturn(null).anyTimes(); replay(ft); ResourceInfo rInfo = createMock(ResourceInfo.class); expect(rInfo.getTitle()).andReturn("foo title"); expect(rInfo.getDescription()).andReturn("foo description"); expect(rInfo.getKeywords()) .andReturn(new LinkedHashSet<String>(Arrays.asList("foo", "bar", "baz", ""))) .anyTimes(); replay(rInfo); FeatureSource fs = createMock(FeatureSource.class); expect(fs.getSchema()).andReturn(ft).anyTimes(); expect(fs.getInfo()).andReturn(rInfo).anyTimes(); expect(fs.getName()).andReturn(ft.getName()).anyTimes(); replay(fs); FeatureTypeInfo ftInfo = cb.buildFeatureType(fs); assertEquals("foo title", ftInfo.getTitle()); assertEquals("foo description", ftInfo.getDescription()); assertTrue(ftInfo.getKeywords().contains(new Keyword("foo"))); assertTrue(ftInfo.getKeywords().contains(new Keyword("bar"))); assertTrue(ftInfo.getKeywords().contains(new Keyword("baz"))); }
@Test public void testModifyFeatureType() { addFeatureType(); FeatureTypeInfo ft2 = catalog.getFeatureTypeByName(ft.getName()); ft2.setDescription("ft2Description"); ft2.getKeywords().add(new Keyword("ft2")); FeatureTypeInfo ft3 = catalog.getFeatureTypeByName(ft.getName()); assertEquals("ftName", ft3.getName()); assertEquals("ftDescription", ft3.getDescription()); assertTrue(ft3.getKeywords().isEmpty()); catalog.save(ft2); ft3 = catalog.getFeatureTypeByName(ft.getName()); assertEquals(ft2, ft3); assertEquals("ft2Description", ft3.getDescription()); assertEquals(1, ft3.getKeywords().size()); }
typeInfo.setAdvertised(_typeInfo.isAdvertised()); typeInfo.setTitle(_typeInfo.getTitle()); typeInfo.setDescription(_typeInfo.getDescription()); typeInfo.setAbstract(_typeInfo.getAbstract()); typeInfo.getKeywords().addAll(_typeInfo.getKeywords());