GetFeature200KVPEncoder { public static Map<String, String> export( GetFeature getFeature ) throws UnsupportedEncodingException, XMLStreamException, FactoryConfigurationError, UnknownCRSException, TransformationException { if ( !WFSVersion.WFS_200.getOGCVersion().equals( getFeature.getVersion() ) ) { String failure = "Serialization of other versions than 2.0.0 are currently not supported by this encoder!"; throw new IllegalArgumentException( failure ); } Map<String, String> kvp = new LinkedHashMap<String, String>(); exportBaseParams( kvp ); exportQueryParams( getFeature, kvp ); exportPresentationParameters( getFeature, kvp ); exportResolveParameters( getFeature, kvp ); return kvp; }  static Map<String, String> export( GetFeature getFeature );  }
@Test(expected = IllegalArgumentException.class) public void testExport_MultipleQueries() throws Exception { Map<String, String> kvpUnderTest = asKvp( "wfs200/example8.kvp" ); GetFeature getFeature = GetFeatureKVPAdapter.parse( kvpUnderTest, null ); GetFeature200KVPEncoder.export( getFeature ); }
@Test(expected = IllegalArgumentException.class) public void testExport_MissingQuery() throws Exception { Map<String, String> kvpUnderTest = asKvp( "wfs200/example8.kvp" ); GetFeature getFeature = GetFeatureKVPAdapter.parse( kvpUnderTest, null ); getFeature.getQueries().clear(); GetFeature200KVPEncoder.export( getFeature ); }
@Test(expected = IllegalArgumentException.class) public void testExport_UnsupportedQueryClass() throws Exception { Map<String, String> kvpUnderTest = asKvp( "wfs200/example8.kvp" ); GetFeature getFeature = GetFeatureKVPAdapter.parse( kvpUnderTest, null ); getFeature.getQueries().clear(); getFeature.getQueries().add( unknownQuery() ); GetFeature200KVPEncoder.export( getFeature ); }
@Test(expected = IllegalArgumentException.class) public void testExport_UnsupportedAdHocQueryClass() throws Exception { Map<String, String> kvpUnderTest = asKvp( "wfs200/example8.kvp" ); GetFeature getFeature = GetFeatureKVPAdapter.parse( kvpUnderTest, null ); getFeature.getQueries().clear(); getFeature.getQueries().add( unknownAdHocQuery() ); GetFeature200KVPEncoder.export( getFeature ); }