On Fri, May 25, 2012 at 8:16 AM, Jody Garnett <jody.garn...@gmail.com>wrote:
> Okay here is something I should of done ages ago; after noticing how much
> easier it was to write/maintain test cases with CQL.
>
> https://jira.codehaus.org/browse/GEOT-4150 DataUtilities createFeature
> and encodeFeature methods from PropertyDataStore
>
> Code example:
>
> SimpleFeatureType featureType =
> DataUtilities.createType("Contact","id:Integer,party:String,geom:Geometry:srid=4326");
> SimpleFeature feature1 = DataUtilities.createFeature( featureType,
> "fid1=1|Jody Garnett\\nSteering Committee|POINT (1 2)" );
> SimpleFeature feature2 = DataUtilities.createFeature( featureType,
> "2|John Hudson\\|Hapless Victim|POINT (6 2)" );
>
> String spec = DataUtilities.encodeType(featureType);
> String text = DataUtilities.encodeFeature(feature1);
>
He he, it's what we do in tests in GeoServer with the property data store,
but migrated right into the test code.
I guess having the external property file or the inline code is a matter of
preference.
Cheers
Andrea
--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel