package skrueger.geotools.io; import static org.junit.Assert.assertEquals; import java.net.MalformedURLException; import java.net.URL; import org.junit.Test; import schmitzm.junit.TestingClass; import skrueger.geotools.io.GtWfsServerSettings.WfsProtocollVersion; public class WfsServerListTest extends TestingClass { @Test public void testSerializeAndParseServers() throws MalformedURLException { GtWfsServerSettings wfs1 = new GtWfsServerSettings(new URL( "http://localhost:8085/geoserver/ows"), WfsProtocollVersion.v1_1_1); GtWfsServerSettings wfs2 = new GtWfsServerSettings(new URL( "http://localhost:8080/geoserver2/ows"), WfsProtocollVersion.v1_0_0); WfsServerList list1 = new WfsServerList(wfs1, wfs2); WfsServerList list2 = new WfsServerList(list1 .toPropertiesString()); assertEquals(list1.size(), list2.size()); assertEquals(list1.get(0).getBaseUrl(), list2.get(0).getBaseUrl()); assertEquals(list1.get(1).toPropertiesString(), list2.get(1).toPropertiesString()); } @Test public void testParseEmpty() { assertEquals(0, new WfsServerList((String)null).size()); assertEquals(0, new WfsServerList("").size()); } }