empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1148678 - in /incubator/empire-db/branches/EMPIREDB-99: empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/ empire-db/src/main/java/org/apache/empire/ empire-db/src/main/java/org/apache/empire/commons/ em...
Date Wed, 20 Jul 2011 10:09:24 GMT
Author: doebele
Date: Wed Jul 20 10:09:11 2011
New Revision: 1148678

URL: http://svn.apache.org/viewvc?rev=1148678&view=rev
Log:
EMPIREDB-99 basic transition of core finished

Added:
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/EmpireException.java   (contents, props changed)
      - copied, changed from r1148444, incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/EmpireException.java
Removed:
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/EmpireException.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/ErrorInfo.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/ErrorObject.java
Modified:
    incubator/empire-db/branches/EMPIREDB-99/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleConfig.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/Errors.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/data/bean/BeanRecordProxy.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommand.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommandExpr.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBObject.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBQuery.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBReader.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecord.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRowSet.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTable.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTableColumn.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBView.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLConfiguration.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLWriter.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleConfig.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleConfig.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleConfig.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db-examples/empire-db-example-basic/src/main/java/org/apache/empire/samples/db/SampleConfig.java Wed Jul 20 10:09:11 2011
@@ -18,7 +18,7 @@
  */
 package org.apache.empire.samples.db;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.xml.XMLConfiguration;
 import org.apache.empire.xml.XMLUtil;

Copied: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/EmpireException.java (from r1148444, incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/EmpireException.java)
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/EmpireException.java?p2=incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/EmpireException.java&p1=incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/EmpireException.java&r1=1148444&r2=1148678&rev=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/EmpireException.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/EmpireException.java Wed Jul 20 10:09:11 2011
@@ -16,13 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.empire;
+package org.apache.empire.commons;
 
 import java.text.MessageFormat;
 
-import org.apache.empire.commons.ErrorObject;
-import org.apache.empire.commons.ErrorType;
-import org.apache.empire.commons.Errors;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,7 +31,7 @@ import org.slf4j.LoggerFactory;
 public class EmpireException extends RuntimeException
 {
     // Logger
-    private static final Logger log = LoggerFactory.getLogger(ErrorObject.class);
+    private static final Logger log = LoggerFactory.getLogger(EmpireException.class);
     
     private static final long serialVersionUID = 1L;
     
@@ -157,30 +154,14 @@ public class EmpireException extends Run
         log();
     }
     
+    /**
+     * log the error (info must be enabled)
+     */
     private void log()
     {
         if (log.isInfoEnabled())
-            log.info("Error '" + this.getMessage() + "' has been set.");
-    }
-    
-    /**
-     * creates an empire exception from an error object.
-     * @param errorObject
-    public EmpireException(final ErrorInfo errorObject)
-    {
-        super(errorObject.getErrorMessage());
-        // init
-        this.errorType = errorObject.getErrorType();
-        this.errorObject = new DeepCopyErrorInfo(errorObject);
-        this.errorObjectClassname = errorObject.getClass().getName();
-    }
-    
-    @Override
-    public String toString()
-    {   // Return Object class name and error message
-        return errorObjectClassname + ": " + getMessage();
+            log.info("An Error occured. Message is: {}", this.getMessage());
     }
-     */
 
     /**
      * The type of error that occurred
@@ -192,68 +173,13 @@ public class EmpireException extends Run
         return errorType;
     }
 
-    
+    /**
+     * The message parameters for the message.
+     * @see org.apache.empire.commons.Errors
+     * @return the type of error
+     */
     public Object[] getErrorParams()
     {
         return errorParams;
     }
-    
-    
-    /**
-     * A serializable version of {@link ErrorInfo}.
-    private static class DeepCopyErrorInfo implements ErrorInfo, Serializable {
-        private static final long serialVersionUID = 1L;
-        
-        private final boolean hasError;
-        private final ErrorType errorType;
-        private final Serializable[] errorParams;
-        private final String errorSource;
-        private final String errorMessage;
-
-        // Copy ctor.
-        DeepCopyErrorInfo(ErrorInfo errorInfo) {
-            this.hasError = errorInfo.hasError();
-            this.errorType = errorInfo.getErrorType();
-            Object[] params = errorInfo.getErrorParams();
-            if (params != null) {
-                this.errorParams = new Serializable[params.length];
-                for (int i=0; i<params.length; i++) {
-                  Object p = params[i];
-                  if (p == null) {
-                      this.errorParams[i] = null;
-                  } else if (p instanceof Serializable) {
-                      Serializable serializable = (Serializable) p;
-                      this.errorParams[i] = serializable;
-                  } else {
-                      this.errorParams[i] = p.toString();
-                  }
-                }
-            } else {
-                this.errorParams = null;
-            }
-            this.errorSource = errorInfo.getErrorSource();
-            this.errorMessage = errorInfo.getErrorMessage();
-        }
-
-        public boolean hasError() {
-            return hasError;
-        }
-
-        public ErrorType getErrorType() {
-            return errorType;
-        }
-
-        public Object[] getErrorParams() {
-            return errorParams;
-        }
-
-        public String getErrorSource() {
-            return errorSource;
-        }
-
-        public String getErrorMessage() {
-            return errorMessage;
-        }
-    }
-     */
 }

Propchange: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/EmpireException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/Errors.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/Errors.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/Errors.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/commons/Errors.java Wed Jul 20 10:09:11 2011
@@ -26,7 +26,7 @@ import java.text.MessageFormat;
  * purpose is to hold the definition of Error Types.
  * <P>
  * Define your own error types in the same way.
- * See @link {@link ErrorType} for futher information.
+ * See @link {@link ErrorType} for further information.
  * <P>
  */
 public class Errors
@@ -35,13 +35,14 @@ public class Errors
     public static final ErrorType None            = new ErrorType("error.none", "");
     public static final ErrorType Cancelled       = new ErrorType("error.cancelled", "The action has been cancelled by the user");
     // Code Errors
-    public static final ErrorType Exception       = new ErrorType("error.exception", "An Exception of type {0} occurred.\n-->Message is {1}\n-->at Position {2}");
+    public static final ErrorType Exception       = new ErrorType("error.exception", "An Exception of type {0} occurred.\n-->Message is: {1}\n-->at Position: {2}");
     public static final ErrorType Internal        = new ErrorType("error.internal", "Internal Error: {0}");
     public static final ErrorType InvalidArg      = new ErrorType("error.invalidarg", "Invalid Argument {0} for parameter {1}.");
     public static final ErrorType NotSupported    = new ErrorType("error.notsupported", "The function {0} is not supported");
     public static final ErrorType NotImplemented  = new ErrorType("error.notimplemented", "The function {0} is not implemented");
     public static final ErrorType ObjectNotValid  = new ErrorType("error.objectnotvalid", "The object {0} has not been initialized.");
     public static final ErrorType InvalidProperty = new ErrorType("error.invalidproperty", "The value of the property {0} is not valid.");
+    public static final ErrorType UnexpectedValue = new ErrorType("error.unexpectedvalue", "Unexpected value {0} for {1}.");
     // Security Errors
     public static final ErrorType NoAccess        = new ErrorType("error.noaccess", "Access denied");
     public static final ErrorType NotAuthorized   = new ErrorType("error.notauthorized", "You are not autorized for this operation.");
@@ -77,18 +78,13 @@ public class Errors
      * @param info the ErrorInfo to get the message for
      * @return the message string for this info
      */
-    public static String getErrorMessage(ErrorInfo info)
+    public static String getErrorMessage(ErrorType type, Object[] msgParams)
     {
-        // Check Param
-        if (info==null || info.hasError()==false)
-            return ""; // No Error
         // Get Error Type
-        ErrorType type = info.getErrorType();
         if (type==null || type==Errors.None)
             return ""; // No Error
         // Get Message Pattern and Params
         String msgPattern = type.getMessagePattern();
-        Object[] msgParams = info.getErrorParams();
         if (msgParams==null)
             return msgPattern;
         // Get Error Message

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/data/bean/BeanRecordProxy.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/data/bean/BeanRecordProxy.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/data/bean/BeanRecordProxy.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/data/bean/BeanRecordProxy.java Wed Jul 20 10:09:11 2011
@@ -25,8 +25,7 @@ import java.util.List;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.BeanUtilsBean;
 import org.apache.commons.beanutils.PropertyUtilsBean;
-import org.apache.empire.EmpireException;
-import org.apache.empire.commons.ErrorObject;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.Options;
@@ -45,7 +44,7 @@ import org.slf4j.LoggerFactory;
  * 
  * @author Rainer
  */
-public class BeanRecordProxy<T> extends ErrorObject implements Record
+public class BeanRecordProxy<T> implements Record
 {
     protected static final Logger log = LoggerFactory.getLogger(BeanRecordProxy.class);
     
@@ -303,8 +302,6 @@ public class BeanRecordProxy<T> extends 
             // Get Property Name
             String property = column.getBeanPropertyName();
             Object value = getBeanPropertyValue(bean, property);
-            if (value==null && this.hasError())
-                continue;
             setValue(column, value);
             count++;
         }

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommand.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommand.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommand.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommand.java Wed Jul 20 10:09:11 2011
@@ -18,7 +18,7 @@
  */
 package org.apache.empire.db;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.data.DataType;
 import org.apache.empire.db.expr.compare.DBCompareColExpr;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommandExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommandExpr.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommandExpr.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBCommandExpr.java Wed Jul 20 10:09:11 2011
@@ -19,7 +19,7 @@
 package org.apache.empire.db;
 
 // java
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.Options;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabase.java Wed Jul 20 10:09:11 2011
@@ -26,7 +26,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.Options;
@@ -659,7 +659,7 @@ public abstract class DBDatabase extends
             // Get the next Value
             rs = driver.executeQuery(sqlCmd, null, false, conn);
             if (rs == null)
-                throw new EmpireException(Errors.Internal, "Unexpected return value.");
+                throw new EmpireException(Errors.UnexpectedValue, rs, "driver.executeQuery()");
             // Check Result
             if (rs.next() == false)
             {   // no result
@@ -812,7 +812,7 @@ public abstract class DBDatabase extends
             // Get the next Value
             rs = driver.executeQuery(sqlCmd, null, false, conn);
             if (rs == null)
-                throw new EmpireException(Errors.Internal, "Unexpected return value.");
+                throw new EmpireException(Errors.UnexpectedValue, rs, "driver.executeQuery()");
             // Check Result
             int count=0;
             while (rs.next())
@@ -891,7 +891,7 @@ public abstract class DBDatabase extends
             // Get the next Value
             rs = driver.executeQuery(sqlCmd, null, false, conn);
             if (rs == null)
-                throw new EmpireException(Errors.Internal, "Unexpected return value.");
+                throw new EmpireException(Errors.UnexpectedValue, rs, "driver.executeQuery()");
             if (rs.getMetaData().getColumnCount()<2)
                 throw new EmpireException(Errors.InvalidArg, sqlCmd, "sqlCmd");
             // Check Result
@@ -939,7 +939,7 @@ public abstract class DBDatabase extends
             // Get the next Value
             rs = driver.executeQuery(sqlCmd, null, false, conn);
             if (rs == null)
-                throw new EmpireException(Errors.Internal, "Unexpected return value.");
+                throw new EmpireException(Errors.UnexpectedValue, rs, "driver.executeQuery()");
             // Read List
             int colCount = rs.getMetaData().getColumnCount();
             int count = 0;
@@ -1006,7 +1006,7 @@ public abstract class DBDatabase extends
             int affected = driver.executeSQL(sqlCmd, sqlParams, conn, setGenKeys);
             // number of affected records
             if (affected < 0)
-                throw new EmpireException(Errors.Internal, "Unexpected return value <0 for driver.executeSQL().");
+                throw new EmpireException(Errors.UnexpectedValue, affected, "driver.executeSQL()");
             // Log
             if (log.isInfoEnabled())
 	            log.info("executeSQL affected " + affected + " Records / " + (System.currentTimeMillis() - start) + "ms");
@@ -1040,9 +1040,9 @@ public abstract class DBDatabase extends
     }
     
     /**
-     * Executes a select SQL-Statement and returns a resulset containing the query results.<BR>
+     * Executes a select SQL-Statement and returns a resultset containing the query results.<BR>
      * This function returns a JDBC ResultSet.<BR>
-     * Insteam of using this function directly you should use a DBReader object instead.<BR>
+     * Instead of using this function directly you should use a DBReader object instead.<BR>
      * <P>
      * @param sqlCmd the SQL-Command
      * @param sqlParams a list of parameters for parameter queries (may depend on driver)
@@ -1061,7 +1061,7 @@ public abstract class DBDatabase extends
             long start = System.currentTimeMillis();
             ResultSet rs = driver.executeQuery(sqlCmd, sqlParams, scrollable, conn);
             if (rs == null)
-                throw new EmpireException(Errors.Internal, "Unexpected return value.");
+                throw new EmpireException(Errors.UnexpectedValue, rs, "driver.executeQuery()");
             // Debug
             if (log.isDebugEnabled())
                 log.debug("executeQuery successful in " + (System.currentTimeMillis() - start) + " ms");

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java Wed Jul 20 10:09:11 2011
@@ -33,9 +33,8 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.UUID;
 
-import org.apache.empire.EmpireException;
 import org.apache.empire.commons.DateUtils;
-import org.apache.empire.commons.ErrorObject;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.StringUtils;
@@ -49,7 +48,7 @@ import org.slf4j.LoggerFactory;
  * The DBDatabaseDriver class is an abstract base class for all database drivers.
  * Its purpose is to handle everything that is - or might be - database vendor specific. 
  */
-public abstract class DBDatabaseDriver extends ErrorObject implements Serializable
+public abstract class DBDatabaseDriver implements Serializable
 {
     private final static long serialVersionUID = 1L;
   

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBObject.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBObject.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBObject.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBObject.java Wed Jul 20 10:09:11 2011
@@ -22,8 +22,7 @@ package org.apache.empire.db;
 import java.io.Serializable;
 import java.sql.SQLException;
 
-import org.apache.empire.EmpireException;
-import org.apache.empire.commons.ErrorObject;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.ErrorType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory;
  * 
  *
  */
-public abstract class DBObject extends ErrorObject implements Serializable
+public abstract class DBObject implements Serializable
 {
     private static final long serialVersionUID = 1L;
     // Logger

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBQuery.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBQuery.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBQuery.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBQuery.java Wed Jul 20 10:09:11 2011
@@ -24,7 +24,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.Options;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBReader.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBReader.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBReader.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBReader.java Wed Jul 20 10:09:11 2011
@@ -33,7 +33,7 @@ import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.commons.beanutils.ConstructorUtils;
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.data.ColumnExpr;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecord.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecord.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecord.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecord.java Wed Jul 20 10:09:11 2011
@@ -25,7 +25,7 @@ import java.util.List;
 
 import org.apache.commons.beanutils.BeanUtilsBean;
 import org.apache.commons.beanutils.PropertyUtilsBean;
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.Options;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRecordData.java Wed Jul 20 10:09:11 2011
@@ -23,8 +23,8 @@ import java.util.Collection;
 import java.util.Date;
 
 import org.apache.commons.beanutils.BeanUtils;
-import org.apache.empire.EmpireException;
 import org.apache.empire.commons.DateUtils;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.ColumnExpr;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRowSet.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRowSet.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRowSet.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBRowSet.java Wed Jul 20 10:09:11 2011
@@ -26,7 +26,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.StringUtils;
@@ -711,7 +711,7 @@ public abstract class DBRowSet extends D
         int affected = db.executeSQL(sql, cmd.getParamValues(), conn, setGenKey);
         if (affected < 0)
         {   // Update Failed
-            throw new EmpireException(Errors.Internal, "Unexpected return value.");
+            throw new EmpireException(Errors.UnexpectedValue, affected, "db.executeSQL()");
         } 
         else if (affected == 0)
         { // Record not found
@@ -794,7 +794,7 @@ public abstract class DBRowSet extends D
             for (int i=0; i<parentKey.length; i++)
                 cmd.where(refs[i].getSourceColumn().is(parentKey[i]));
             if (db.executeSQL(cmd.getDelete((DBTable)this), conn)<0)
-                throw new EmpireException(Errors.Internal, "Unexpected return value.");
+                throw new EmpireException(Errors.UnexpectedValue, -1, "db.executeSQL()");
         }
         else
         {   // Query all keys

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java Wed Jul 20 10:09:11 2011
@@ -23,8 +23,7 @@ import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
-import org.apache.empire.commons.ErrorObject;
+import org.apache.empire.commons.EmpireException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory;
  * The class is used for obtaining and executing DDL commands supplied
  * by the database driver (@see {@link DBDatabaseDriver#getDDLScript(DBCmdType, DBObject, DBSQLScript)}) 
  */
-public class DBSQLScript extends ErrorObject implements Iterable<String>
+public class DBSQLScript implements Iterable<String>
 {
     // Logger
     private static final Logger log = LoggerFactory.getLogger(DBSQLScript.class);

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTable.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTable.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTable.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTable.java Wed Jul 20 10:09:11 2011
@@ -25,7 +25,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.data.DataMode;
 import org.apache.empire.data.DataType;
@@ -450,7 +450,7 @@ public class DBTable extends DBRowSet im
         int affected  = db.executeSQL(sqlCmd, cmd.getParamValues(), conn);
         if (affected < 0)
         { // Delete Failed
-            throw new EmpireException(Errors.Internal, "Unexpected return value.");
+            throw new EmpireException(Errors.UnexpectedValue, affected, "db.executeSQL()");
         } 
         else if (affected == 0)
         { // Record not found

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTableColumn.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTableColumn.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTableColumn.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBTableColumn.java Wed Jul 20 10:09:11 2011
@@ -23,8 +23,8 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-import org.apache.empire.EmpireException;
 import org.apache.empire.commons.Attributes;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.data.DataMode;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBView.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBView.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBView.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBView.java Wed Jul 20 10:09:11 2011
@@ -21,7 +21,7 @@ package org.apache.empire.db;
 import java.sql.Connection;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.Options;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java Wed Jul 20 10:09:11 2011
@@ -22,7 +22,7 @@ import java.sql.Connection;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java Wed Jul 20 10:09:11 2011
@@ -22,7 +22,7 @@ import java.sql.Connection;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java Wed Jul 20 10:09:11 2011
@@ -22,7 +22,7 @@ import java.sql.Connection;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.data.DataType;
 import org.apache.empire.db.DBCmdType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java Wed Jul 20 10:09:11 2011
@@ -23,7 +23,7 @@ import java.sql.SQLException;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java Wed Jul 20 10:09:11 2011
@@ -19,7 +19,7 @@
 package org.apache.empire.db.oracle;
 
 // Imports
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.db.DBCommand;
 import org.apache.empire.db.DBDatabase;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java Wed Jul 20 10:09:11 2011
@@ -24,7 +24,7 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.data.DataType;
 import org.apache.empire.db.DBCmdType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java Wed Jul 20 10:09:11 2011
@@ -23,7 +23,7 @@ import java.sql.SQLException;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.DataType;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java Wed Jul 20 10:09:11 2011
@@ -23,7 +23,7 @@ import java.sql.SQLException;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 
-import org.apache.empire.EmpireException;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.StringUtils;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLConfiguration.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLConfiguration.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLConfiguration.java Wed Jul 20 10:09:11 2011
@@ -30,8 +30,7 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.commons.beanutils.BeanUtils;
-import org.apache.empire.EmpireException;
-import org.apache.empire.commons.ErrorObject;
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.StringUtils;
@@ -52,7 +51,7 @@ import org.xml.sax.SAXException;
  * </PRE>
  *
  */
-public class XMLConfiguration extends ErrorObject
+public class XMLConfiguration
 {
     private static final Logger log = LoggerFactory.getLogger(XMLConfiguration.class);
 

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLWriter.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLWriter.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLWriter.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/xml/XMLWriter.java Wed Jul 20 10:09:11 2011
@@ -35,7 +35,6 @@ import javax.xml.transform.stream.Stream
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.empire.commons.ErrorObject;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.NamedNodeMap;
@@ -49,7 +48,7 @@ import org.w3c.dom.NodeList;
  * 
  *
  */
-public class XMLWriter extends ErrorObject
+public class XMLWriter
 {
     // Logger
     protected static final Logger    log                  = LoggerFactory.getLogger(XMLWriter.class);

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java Wed Jul 20 10:09:11 2011
@@ -21,6 +21,7 @@ package org.apache.empire;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
+import org.apache.empire.commons.EmpireException;
 import org.apache.empire.commons.Errors;
 import org.junit.Before;
 import org.junit.Test;

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java?rev=1148678&r1=1148677&r2=1148678&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java (original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java Wed Jul 20 10:09:11 2011
@@ -18,77 +18,52 @@
  */
 package org.apache.empire.commons;
 
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 
+import org.apache.empire.db.DBErrors;
+import org.junit.Test;
+
 public class ErrorsTest
 {
+    private static final String ROOT_EXCEPTION_MSG = "This is the root exception message!"; 
 
-	
+    private static final String NATIVE_ERROR_MSG = "This is the native error message!"; 
+    
 	@Test
 	public void testGetErrorMessage()
 	{
-		
-		ErrorInfo info = new DummyErrorInfo(true, Errors.InvalidArg, new Object[]{"test", "testparam"});
-		assertEquals("Invalid Argument test for parameter testparam.", Errors.getErrorMessage(info));
-		
-		// TODO should we fail in this case?
-		// TODO find a way to force the correct number of params at compiletime
-		info = new DummyErrorInfo(true, Errors.InvalidArg, new Object[]{"test"});
-		assertEquals("Invalid Argument test for parameter {1}.", Errors.getErrorMessage(info));
-	
-		assertEquals("", Errors.getErrorMessage(null));		
-		
-		info = new DummyErrorInfo(false, Errors.Internal, null);
-		assertEquals("", Errors.getErrorMessage(info));
-		
-		info = new DummyErrorInfo(true, null, null);
-		assertEquals("", Errors.getErrorMessage(info));
-		
-		info = new DummyErrorInfo(true, Errors.None, null);
-		assertEquals("", Errors.getErrorMessage(info));
+        Throwable cause = new RuntimeException(ROOT_EXCEPTION_MSG);
+        
+	    try {
+	        // Test InvalidArg
+	        throw new EmpireException(Errors.InvalidArg, "test", "testparam");
+	        
+	    } catch (EmpireException e) {
+	        
+            assertEquals(e.getErrorType(), Errors.InvalidArg);
+	        assertEquals(e.getMessage(), "Invalid Argument 'test' for parameter 'testparam'.");
+	    }
+
+        try {
+            // Test Throwable wrapper
+            throw new EmpireException(cause);
+            
+        } catch (EmpireException e) {
+
+            assertEquals(e.getErrorParams()[0], "RuntimeException");
+            assertEquals(e.getErrorParams()[1], ROOT_EXCEPTION_MSG);
+        }
+
+        try {
+            // Test SQLException
+            throw new EmpireException(DBErrors.SQLException, new Object[] { NATIVE_ERROR_MSG }, cause);
+            
+        } catch (EmpireException e) {
+
+            assertEquals(e.getErrorParams()[0], NATIVE_ERROR_MSG);
+            
+        }
+        
 	}
-	
-	private final class DummyErrorInfo implements ErrorInfo
-	{
-		private final boolean hasErrror;
-		private final ErrorType type;
-		private final Object[] params;
-		
-		public DummyErrorInfo(final boolean hasError, final ErrorType type, final Object[] params)
-		{
-			this.hasErrror = hasError;
-			this.type = type;
-			this.params = params;
-		}
-		
-		public Object[] getErrorParams()
-		{
-			return params;
-		}
-
-		public String getErrorSource()
-		{
-			return "JUnit";
-		}
-
-		public ErrorType getErrorType()
-		{
-			return type;
-		}
-
-		public boolean hasError()
-		{
-			return hasErrror;
-		}
-
-    public String getErrorMessage()
-    {
-      return null;
-    }
-  }
-
-	
 
 }



Mime
View raw message