[Schmitzm-commits] r1164 - in trunk: src/skrueger/geotools/io src_junit/skrueger/geotools/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 25 09:25:27 CEST 2010


Author: alfonx
Date: 2010-10-25 09:25:26 +0200 (Mon, 25 Oct 2010)
New Revision: 1164

Added:
   trunk/src/skrueger/geotools/io/ServerSettings.java
Modified:
   trunk/src/skrueger/geotools/io/DbServerList.java
   trunk/src/skrueger/geotools/io/DbServerSettings.java
   trunk/src/skrueger/geotools/io/WfsServerList.java
   trunk/src/skrueger/geotools/io/WfsServerSettings.java
   trunk/src_junit/skrueger/geotools/io/DbServerSettingsTest.java
   trunk/src_junit/skrueger/geotools/io/WfsServerListTest.java
Log:


Modified: trunk/src/skrueger/geotools/io/DbServerList.java
===================================================================
--- trunk/src/skrueger/geotools/io/DbServerList.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src/skrueger/geotools/io/DbServerList.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -53,17 +53,20 @@
 
 		for (String s : split) {
 			try {
-				wfsServerList.add(DbServerSettings.parsePropertiesString(s));
-			} catch (MalformedURLException e) {
+				DbServerSettings dbServer = DbServerSettings
+						.parsePropertiesString(s);
+				if (dbServer == null) {
+					Log.error(
+							"Could not import a "
+									+ DbServerSettings.class.getSimpleName()
+									+ ". Ignoring it.");
+				} else
+					wfsServerList.add(dbServer);
+			} catch (Exception e) {
 				Log.error(
 						"Could not import a "
 								+ DbServerSettings.class.getSimpleName()
 								+ ". Ignoring it.", e);
-			} catch (IllegalArgumentException iae) {
-				Log.error(
-						"Could not import a "
-								+ DbServerSettings.class.getSimpleName()
-								+ ". Ignoring it.", iae);
 			}
 		}
 

Modified: trunk/src/skrueger/geotools/io/DbServerSettings.java
===================================================================
--- trunk/src/skrueger/geotools/io/DbServerSettings.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src/skrueger/geotools/io/DbServerSettings.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -32,8 +32,22 @@
  * connection into a {@link String} with {@link #toPropertiesString()} and
  * re-import the String with {@link #parsePropertiesString(String)}.
  */
-public class DbServerSettings extends HashMap<Object, Object> {
+public class DbServerSettings extends ServerSettings<Object, Object> {
 
+	public enum DbType {
+		postgis("postgresql");
+
+		private final String protocolString;
+
+		DbType(String protocolString) {
+			this.protocolString = protocolString;
+		}
+
+		public String getProtocolString() {
+			return protocolString;
+		};
+	}
+
 	/**
 	 * params.put(JDBCDataStoreFactory.DBTYPE.key, "postgis");
 	 * params.put(JDBCDataStoreFactory.HOST.key, host); // the name or ip
@@ -52,43 +66,134 @@
 	public enum Key {
 	}
 
-	public enum DbType {
-		postgis("postgresql");
+	/**
+	 * Opens a GUI that asks the use define a DB connection.
+	 * 
+	 * @param dbServer
+	 *            <code>null</code> to create a new instance, or an instance to
+	 *            edit.
+	 * @return <code>null</code> if the user cancelled the creation of a new
+	 *         {@link DbServerSettings}, otherwise the edited instance.
+	 */
+	public static DbServerSettings createOrEdit(Component owner,
+			DbServerSettings dbServer) {
+		boolean newCreated = false;
 
-		private final String protocolString;
+		if (dbServer == null) {
+			newCreated = true;
+			dbServer = new DbServerSettings(DbType.postgis);
+		}
 
-		DbType(String protocolString) {
-			this.protocolString = protocolString;
+		Combo<DbType> dpTypeInput = new SelectionInputOption.Combo<DbType>(
+				"Database type", true, DbType.values(), ArrayUtils.indexOf(
+						DbType.values(), dbServer.getDbType()), DbType.values());
+
+		Text hostInput = new ManualInputOption.Text("Hostname", true,
+				dbServer.getHost());
+
+		Integer portInput = new ManualInputOption.Integer("Port", true,
+				dbServer.getPort());
+
+		Text databaseInput = new ManualInputOption.Text("Database", true,
+				dbServer.getDatabase());
+
+		Text schemaInput = new ManualInputOption.Text("Schema", true,
+				dbServer.getSchema());
+
+		Text userInput = new ManualInputOption.Text("Username", true,
+				dbServer.getUsername());
+
+		PasswordViewable passwdInput = new ManualInputOption.PasswordViewable(
+				"Password", true, dbServer.getPassword());
+
+		BooleanInputOption exposePkInput = new BooleanInputOption(
+				"Expose primary keys", dbServer.getExposePrimaryKey());
+
+		Object[] input = MultipleOptionPane.showMultipleInputDialog(owner,
+				"DB Connection paramters", dpTypeInput, hostInput, portInput,
+				databaseInput, schemaInput, userInput, passwdInput,
+				exposePkInput);
+
+		if (input == null) {
+			if (newCreated)
+				return null;
+			else
+				return dbServer;
+		} else {
+			dbServer.setDbType((DbType) input[0]);
+			dbServer.setHost((String) input[1]);
+			dbServer.setPort((java.lang.Integer) input[2]);
+			dbServer.setDatabase((String) input[3]);
+			dbServer.setSchema((String) input[4]);
+			dbServer.setUsername((String) input[5]);
+			dbServer.setPassword(String.valueOf((char[]) input[6]));
+			dbServer.setExposePrimaryKey((Boolean) input[7]);
 		}
 
-		public String getProtocolString() {
-			return protocolString;
-		};
+		return dbServer;
+
 	}
 
-	public void setPort(java.lang.Integer port) {
-		put(JDBCDataStoreFactory.PORT.key, port);
+	/**
+	 * @return transforms the settings to a String that can be stored in a
+	 *         .properties line. @see #parsePropertiesString
+	 * @throws MalformedURLException
+	 */
+	public static DbServerSettings parsePropertiesString(String propString)
+			throws MalformedURLException {
+
+		if (propString == null || propString.isEmpty())
+			throw new IllegalArgumentException("parameter to parse was empty");
+		try {
+
+			String[] split = propString.split(Pattern.quote(DELIMITER));
+
+			int i = 0;
+			DbServerSettings dbServer = new DbServerSettings(
+					DbType.valueOf(split[i++]));
+
+			dbServer.setTitle(split[i++]);
+			dbServer.setHost(split[i++]);
+			dbServer.setPort(java.lang.Integer.valueOf(split[i++]));
+			dbServer.setUsername(StringUtils.stripToNull(split[i++]));
+			dbServer.setPassword(split[i++]);
+			dbServer.setDatabase(split[i++]);
+			dbServer.setExposePrimaryKey(Boolean.valueOf(split[i++]));
+			dbServer.setSchema(stringOrNull(split[i++]));
+
+			return dbServer;
+		} catch (Exception e) {
+			Log.warn("couldn't parse " + propString, e);
+			return null;
+		}
 	}
 
-	public java.lang.Integer getPort() {
-		java.lang.Integer port = (java.lang.Integer) get(JDBCDataStoreFactory.PORT.key);
-		if (port == null)
-			return (java.lang.Integer) JDBCDataStoreFactory.PORT.sample;
-		return port;
+	private String[] cachedTypeNames = null;
+
+	public DbServerSettings() {
 	}
 
-	public void setSchema(String schema) {
-		put(JDBCDataStoreFactory.SCHEMA.key, schema);
+	public DbServerSettings(DbType dbType) {
+		setDbType(dbType);
+		setHost("localhost");
+		setSchema("public");
 	}
 
-	public String getSchema() {
-		return (String) get(JDBCDataStoreFactory.SCHEMA.key);
+	public String[] getCachedTypeNames() {
+		return cachedTypeNames;
 	}
 
-	public void setExposePrimaryKey(Boolean exportPk) {
-		put(JDBCDataStoreFactory.EXPOSE_PK.key, exportPk);
+	public String getDatabase() {
+		return (String) get(JDBCDataStoreFactory.DATABASE.key);
 	}
 
+	public DbType getDbType() {
+		String dbt = (String) get(PostgisNGDataStoreFactory.DBTYPE.key);
+		if (dbt != null)
+			return DbType.valueOf(dbt);
+		return null;
+	}
+
 	public Boolean getExposePrimaryKey() {
 		Boolean expk = (Boolean) get(JDBCDataStoreFactory.EXPOSE_PK.key);
 		if (expk == null)
@@ -96,48 +201,61 @@
 		return expk;
 	}
 
-	public void setHost(String host) {
-		put(JDBCDataStoreFactory.HOST.key, host);
-	}
-
 	public String getHost() {
 		return (String) get(JDBCDataStoreFactory.HOST.key);
 	}
 
-	public void setPassword(String password) {
-		put(JDBCDataStoreFactory.PASSWD.key, password);
-	}
-
 	public String getPassword() {
 		return (String) get(JDBCDataStoreFactory.PASSWD.key);
 	}
 
-	public void setUsername(String username) {
-		put(JDBCDataStoreFactory.USER.key, username);
+	public java.lang.Integer getPort() {
+		java.lang.Integer port = (java.lang.Integer) get(JDBCDataStoreFactory.PORT.key);
+		if (port == null)
+			return (java.lang.Integer) JDBCDataStoreFactory.PORT.sample;
+		return port;
 	}
 
+	public String getSchema() {
+		return (String) get(JDBCDataStoreFactory.SCHEMA.key);
+	}
+
 	public String getUsername() {
 		return (String) get(JDBCDataStoreFactory.USER.key);
 	}
 
-	public void setDatabase(String db) {
-		put(JDBCDataStoreFactory.DATABASE.key, db);
+	/**
+	 * @return <code>true</code>, if all parameters look OK, without actually
+	 *         opening any connection.
+	 */
+	public boolean isWellDefined() {
+		if (getDbType() == null)
+			return false;
+
+		if (getHost() == null)
+			return false;
+
+		if (getUsername() == null)
+			return false;
+
+		if (getPassword() == null)
+			return false;
+
+		if (getPort() == null)
+			return false;
+
+		if (getSchema() == null)
+			return false;
+
+		return true;
 	}
 
-	public String getDatabase() {
-		return (String) get(JDBCDataStoreFactory.DATABASE.key);
+	public void setCachedTypeNames(String[] cachedTypeNames) {
+		this.cachedTypeNames = cachedTypeNames;
 	}
 
-	/**
-	 * Character used to separate the parameters when serializing settings to a
-	 * String
-	 */
-	private static final String DELIMITER = "|";
-
-	public DbServerSettings(DbType dbType) {
-		setDbType(dbType);
-		setHost("localhost");
-		setSchema("public");
+	public void setDatabase(String db) {
+		put(JDBCDataStoreFactory.DATABASE.key, db);
 	}
 
 	public void setDbType(DbType dbType) {
@@ -157,40 +275,28 @@
 
 	}
 
-	public DbType getDbType() {
-		String dbt = (String) get(PostgisNGDataStoreFactory.DBTYPE.key);
-		if (dbt != null)
-			return DbType.valueOf(dbt);
-		return null;
+	public void setExposePrimaryKey(Boolean exportPk) {
+		put(JDBCDataStoreFactory.EXPOSE_PK.key, exportPk);
 	}
 
-	public DbServerSettings() {
+	public void setHost(String host) {
+		put(JDBCDataStoreFactory.HOST.key, host);
 	}
 
-	/**
-	 * @return <code>true</code>, if all parameters look OK, without actually
-	 *         opening any connection.
-	 */
-	public boolean isWellDefined() {
-		if (getDbType() == null)
-			return false;
+	public void setPassword(String password) {
+		put(JDBCDataStoreFactory.PASSWD.key, password);
+	}
 
-		if (getHost() == null)
-			return false;
+	public void setPort(java.lang.Integer port) {
+		put(JDBCDataStoreFactory.PORT.key, port);
+	}
 
-		if (getUsername() == null)
-			return false;
+	public void setSchema(String schema) {
+		put(JDBCDataStoreFactory.SCHEMA.key, schema);
+	}
 
-		if (getPassword() == null)
-			return false;
-
-		if (getPort() == null)
-			return false;
-
-		if (getSchema() == null)
-			return false;
-
-		return true;
+	public void setUsername(String username) {
+		put(JDBCDataStoreFactory.USER.key, username);
 	}
 
 	/**
@@ -204,6 +310,9 @@
 		serialized.append(getDbType().toString());
 		serialized.append(DELIMITER);
 
+		serialized.append(getTitle());
+		serialized.append(DELIMITER);
+		
 		serialized.append(getHost());
 		serialized.append(DELIMITER);
 
@@ -223,44 +332,11 @@
 		serialized.append(DELIMITER);
 
 		serialized.append(getSchema().toString());
-		serialized.append(DELIMITER);
+		// serialized.append(DELIMITER);
 
 		return serialized.toString();
 	}
 
-	/**
-	 * @return transforms the settings to a String that can be stored in a
-	 *         .properties line. @see #parsePropertiesString
-	 * @throws MalformedURLException
-	 */
-	public static DbServerSettings parsePropertiesString(String propString)
-			throws MalformedURLException {
-
-		if (propString == null || propString.isEmpty())
-			throw new IllegalArgumentException("parameter to parse was empty");
-		try {
-
-			String[] split = propString.split(Pattern.quote(DELIMITER));
-
-			DbType dbt = DbType.valueOf(split[0]);
-
-			DbServerSettings dbServer = new DbServerSettings(dbt);
-
-			dbServer.setHost(split[1]);
-			dbServer.setPort(java.lang.Integer.valueOf(split[2]));
-			dbServer.setUsername(StringUtils.stripToNull(split[3]));
-			dbServer.setPassword(split[4].equals("null") ? null : split[4]);
-			dbServer.setDatabase(split[5]);
-			dbServer.setExposePrimaryKey(Boolean.valueOf(split[6]));
-			dbServer.setSchema(split[7]);
-
-			return dbServer;
-		} catch (Exception e) {
-			Log.warn("couldn't parse " + propString);
-			return null;
-		}
-	}
-
 	@Override
 	public String toString() {
 
@@ -280,87 +356,4 @@
 
 		return s.toString();
 	}
-
-	public void setCachedTypeNames(String[] cachedTypeNames) {
-		this.cachedTypeNames = cachedTypeNames;
-	}
-
-	public String[] getCachedTypeNames() {
-		return cachedTypeNames;
-	}
-
-	private String[] cachedTypeNames = null;
-
-	public String getTitle() {
-		// TODO
-		return "" + getDbType();
-	}
-
-	/**
-	 * Opens a GUI that asks the use define a DB connection.
-	 * 
-	 * @param dbServer
-	 *            <code>null</code> to create a new instance, or an instance to
-	 *            edit.
-	 * @return <code>null</code> if the user cancelled the creation of a new
-	 *         {@link DbServerSettings}, otherwise the edited instance.
-	 */
-	public static DbServerSettings createOrEdit(Component owner,
-			DbServerSettings dbServer) {
-		boolean newCreated = false;
-
-		if (dbServer == null) {
-			newCreated = true;
-			dbServer = new DbServerSettings(DbType.postgis);
-		}
-
-		Combo<DbType> dpTypeInput = new SelectionInputOption.Combo<DbType>(
-				"Database type", true, DbType.values(), ArrayUtils.indexOf(
-						DbType.values(), dbServer.getDbType()), DbType.values());
-
-		Text hostInput = new ManualInputOption.Text("Hostname", true,
-				dbServer.getHost());
-
-		Integer portInput = new ManualInputOption.Integer("Port", true,
-				dbServer.getPort());
-
-		Text databaseInput = new ManualInputOption.Text("Database", true,
-				dbServer.getDatabase());
-
-		Text schemaInput = new ManualInputOption.Text("Schema", true,
-				dbServer.getSchema());
-
-		Text userInput = new ManualInputOption.Text("Username", true,
-				dbServer.getUsername());
-
-		PasswordViewable passwdInput = new ManualInputOption.PasswordViewable(
-				"Password", true, dbServer.getPassword());
-
-		BooleanInputOption exposePkInput = new BooleanInputOption(
-				"Expose primary keys", dbServer.getExposePrimaryKey());
-
-		Object[] input = MultipleOptionPane.showMultipleInputDialog(owner,
-				"DB Connection paramters", dpTypeInput, hostInput, portInput,
-				databaseInput, schemaInput, userInput, passwdInput,
-				exposePkInput);
-
-		if (input == null) {
-			if (newCreated)
-				return null;
-			else
-				return dbServer;
-		} else {
-			dbServer.setDbType((DbType) input[0]);
-			dbServer.setHost((String) input[1]);
-			dbServer.setPort((java.lang.Integer) input[2]);
-			dbServer.setDatabase((String) input[3]);
-			dbServer.setSchema((String) input[4]);
-			dbServer.setUsername((String) input[5]);
-			dbServer.setPassword(String.valueOf((char[]) input[6]));
-			dbServer.setExposePrimaryKey((Boolean) input[7]);
-		}
-
-		return dbServer;
-
-	}
 }

Added: trunk/src/skrueger/geotools/io/ServerSettings.java
===================================================================
--- trunk/src/skrueger/geotools/io/ServerSettings.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src/skrueger/geotools/io/ServerSettings.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -0,0 +1,51 @@
+package skrueger.geotools.io;
+
+import java.util.HashMap;
+
+public abstract class ServerSettings<T1, T2> extends HashMap<T1, T2> {
+
+	abstract public String toPropertiesString();
+
+	static Integer intOrNull(String string) {
+		if (string == null)
+			return null;
+		if (string.equals("null"))
+			return null;
+		return Integer.parseInt(string);
+	}
+
+	/**
+	 * Character used to separate the parameters when serializing settings to a
+	 * String
+	 */
+	protected static final String DELIMITER = "|";
+
+	private String title;
+
+	static String stringOrNull(String string) {
+		if (string == null)
+			return null;
+		if (string.equals("null"))
+			return null;
+		return string;
+	}
+
+	public void setTitle(String title) {
+		if (title != null) {
+			if (title.contains(DELIMITER))
+				throw new IllegalArgumentException("Title may not contain "
+						+ DELIMITER);
+			if (title.contains(WfsServerList.DELIMITER))
+				throw new IllegalArgumentException("Title may not contain "
+						+ WfsServerList.DELIMITER);
+		}
+		this.title = title;
+	}
+
+	public String getTitle() {
+		if (title == null)
+			return toString();
+		return title;
+	}
+
+}


Property changes on: trunk/src/skrueger/geotools/io/ServerSettings.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native

Modified: trunk/src/skrueger/geotools/io/WfsServerList.java
===================================================================
--- trunk/src/skrueger/geotools/io/WfsServerList.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src/skrueger/geotools/io/WfsServerList.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -53,17 +53,20 @@
 
 		for (String s : split) {
 			try {
-				wfsServerList.add(WfsServerSettings.parsePropertiesString(s));
-			} catch (MalformedURLException e) {
+				WfsServerSettings parsedWfsServer = WfsServerSettings
+						.parsePropertiesString(s);
+				if (parsedWfsServer == null) {
+					Log.error("Could not import a "
+							+ WfsServerSettings.class.getSimpleName()
+							+ " from " + propString + ". Ignoring it.");
+				} else {
+					wfsServerList.add(parsedWfsServer);
+				}
+			} catch (Exception e) {
 				Log.error(
 						"Could not import a "
 								+ WfsServerSettings.class.getSimpleName()
-								+ ". Ignoring it.", e);
-			} catch (IllegalArgumentException iae) {
-				Log.error(
-						"Could not import a "
-								+ WfsServerSettings.class.getSimpleName()
-								+ ". Ignoring it.", iae);
+								+ " from " + propString + ". Ignoring it.", e);
 			}
 		}
 

Modified: trunk/src/skrueger/geotools/io/WfsServerSettings.java
===================================================================
--- trunk/src/skrueger/geotools/io/WfsServerSettings.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src/skrueger/geotools/io/WfsServerSettings.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -32,7 +32,7 @@
  * connection into a {@link String} with {@link #toPropertiesString()} and
  * re-import the String with {@link #parsePropertiesString(String)}.
  */
-public class WfsServerSettings extends HashMap<Object, Object> {
+public class WfsServerSettings extends ServerSettings<Object, Object> {
 
 	public enum Key {
 		BASE_URL, VERSION
@@ -83,11 +83,14 @@
 		}
 	}
 
-	/**
-	 * Character used to separate the parameters when serializing settings to a
-	 * String
-	 */
-	private static final String DELIMITER = "|";
+	private static final URL defaultURl;
+	static {
+		try {
+			defaultURl = new URL("http://localhost:8080/geoserver/ows");
+		} catch (MalformedURLException e) {
+			throw new RuntimeException(e);
+		}
+	}
 
 	/**
 	 * Opens a GUI that asks the use define a DB connection.
@@ -208,39 +211,33 @@
 			wfs.setTitle(split[i++]);
 			wfs.setBaseUrl(new URL(split[i++]));
 			wfs.setVersion(WfsProtocollVersion.valueOf(split[i++]));
-			wfs.setMaxFeatures(java.lang.Integer.valueOf(split[i++]));
-			wfs.setTimeout(java.lang.Integer.valueOf(split[i++]));
+			wfs.setMaxFeatures(intOrNull(split[i++]));
+			wfs.setTimeout(intOrNull(split[i++]));
 			wfs.setLenient(java.lang.Boolean.valueOf(split[i++]));
 			wfs.setHttpProtocol(HttpProtocol.parse(split[i++]));
 
-			String userRaw = split[i++];
-			wfs.setUsername(userRaw.equals("null") ? null : userRaw);
+			wfs.setUsername(stringOrNull(split[i++]));
 
-			String pwdRaw = split[i++];
-			wfs.setPassword(pwdRaw.equals("null") ? null : pwdRaw);
+			wfs.setPassword(stringOrNull(split[i++]));
 
 			return wfs;
 		} catch (Exception e) {
-			Log.warn("couldn't parse " + propString);
+			Log.warn("couldn't parse " + propString, e);
 			return null;
 		}
 
 	}
 
 	private String[] cachedTypeNames = null;
-	private String title;
 
 	public WfsServerSettings() {
-		try {
-			setBaseUrl(new URL("http://localhost:8080/geoserver/ows"));
-		} catch (MalformedURLException e) {
-			throw new RuntimeException(e);
-		}
+		this(defaultURl, WfsProtocollVersion.v1_0_0);
 	}
 
 	public WfsServerSettings(URL baseUrl, WfsProtocollVersion version) {
 		setVersion(version);
 		setBaseUrl(baseUrl);
+		setLenient(false);
 	}
 
 	public URL getBaseUrl() {
@@ -267,12 +264,6 @@
 		return (java.lang.Integer) get(WFSDataStoreFactory.TIMEOUT.key);
 	}
 
-	public String getTitle() {
-		if (title == null)
-			return toString();
-		return title;
-	}
-
 	public WfsProtocollVersion getVersion() {
 		return (WfsProtocollVersion) get(Key.VERSION);
 	}
@@ -372,7 +363,7 @@
 		serialized.append(DELIMITER);
 
 		serialized.append(getPassword());
-		serialized.append(DELIMITER);
+		// serialized.append(DELIMITER);
 
 		return serialized.toString();
 	}
@@ -415,18 +406,6 @@
 		}
 	}
 
-	public void setTitle(String title) {
-		if (title != null) {
-			if (title.contains(DELIMITER))
-				throw new IllegalArgumentException("Title may not contain "
-						+ DELIMITER);
-			if (title.contains(WfsServerList.DELIMITER))
-				throw new IllegalArgumentException("Title may not contain "
-						+ WfsServerList.DELIMITER);
-		}
-		this.title = title;
-	}
-
 	public void setPassword(String password) {
 		if (password != null && password.isEmpty())
 			password = null;

Modified: trunk/src_junit/skrueger/geotools/io/DbServerSettingsTest.java
===================================================================
--- trunk/src_junit/skrueger/geotools/io/DbServerSettingsTest.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src_junit/skrueger/geotools/io/DbServerSettingsTest.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -18,6 +18,7 @@
 		dbStore1.setPassword("secret");
 		dbStore1.setDatabase("testDb");
 		dbStore1.setSchema("myschema");
+		dbStore1.setTitle("toms layer");
 
 		assertTrue(dbStore1.isWellDefined());
 
@@ -34,6 +35,7 @@
 		assertEquals(dbStore1.getPassword(), dbStore2.getPassword());
 		assertEquals(dbStore1.getPort(), dbStore2.getPort());
 		assertEquals(dbStore1.getSchema(), dbStore2.getSchema());
+		assertEquals("toms layer", dbStore2.getTitle());
 	}
 
 }

Modified: trunk/src_junit/skrueger/geotools/io/WfsServerListTest.java
===================================================================
--- trunk/src_junit/skrueger/geotools/io/WfsServerListTest.java	2010-10-24 22:55:43 UTC (rev 1163)
+++ trunk/src_junit/skrueger/geotools/io/WfsServerListTest.java	2010-10-25 07:25:26 UTC (rev 1164)
@@ -27,7 +27,7 @@
 
 		assertEquals(list1.size(), list2.size());
 		assertEquals(list1.get(0).getBaseUrl(), list2.get(0).getBaseUrl());
-		assertEquals(list1.get(1), list2.get(1));
+		assertEquals(list1.get(1).toPropertiesString(), list2.get(1).toPropertiesString());
 	}
 
 	@Test



More information about the Schmitzm-commits mailing list