db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: svn commit: r388309 - in /db/derby/code/trunk: java/build/org/apache/derbyBuild/ java/client/org/apache/derby/client/am/ java/client/org/apache/derby/loc/ java/engine/org/apache/derby/loc/ java/shared/org/apache/derby/shared/common/i18n/ java/shared/or...
Date Fri, 24 Mar 2006 16:49:53 GMT
Hi,

Is this commit marked with the correct Jira issue?
I guess it can be seen as a sub-task of DERBY-839, but then why isn't 
the patch attached there?

It is my personal taste that all patches, perhaps except for the most 
trivial ones, are attached to a corresponding Jira issue. If not, one 
might have to search the commit mails or diff between revisions manually 
to obtain the diff for a specific Jira issue.

I also think it is important because I have the impression the "All" or 
"Subversion commits" views are not much used when browsing Jira.


--
Kristian

davidvc@apache.org wrote:

>Author: davidvc
>Date: Thu Mar 23 16:55:44 2006
>New Revision: 388309
>
>URL: http://svn.apache.org/viewcvs?rev=388309&view=rev
>Log:
>DERBY-839 (Partial).  Internationalize Connection.java.  Also upgraded
>the "i18n lint" test to be a little more intelligent, and to not exit
>on the first failure.
>
>Passes derbynetclientmats.  All changes are client-specific so derbyall
>was not run.
>
>Note there are some extra messages not currently being used.  These are
>from the initial work Anurag did on this.  I'm just splitting up his
>very big patch into smaller, more manageable pieces.
>
>
>Added:
>    db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt   (with props)
>Modified:
>    db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
>    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
>    db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
>    db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties
>    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
>    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
>    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
>    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/
  (props changed)
>    db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient1.sed
>    db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed
>    db/derby/code/trunk/tools/testing/i18nTestGenerator/generateClientMessageTest.sh
>
>Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java (original)
>+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java Thu Mar 23
16:55:44 2006
>@@ -52,6 +52,8 @@
>         // Add message ids that don't start with XJ here
>         clientMessageIds.add(SQLState.NO_CURRENT_CONNECTION);
>         clientMessageIds.add(SQLState.NOT_IMPLEMENTED);
>+        clientMessageIds.add(SQLState.CANNOT_CLOSE_ACTIVE_XA_CONNECTION);
>+        clientMessageIds.add(SQLState.XACT_SAVEPOINT_RELEASE_ROLLBACK_FAIL);
>     }
> 
> 	public static void main(String[] args) throws Exception {
>
>Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java (original)
>+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java Thu Mar
23 16:55:44 2006
>@@ -457,7 +457,8 @@
>     synchronized public String nativeSQLX(String sql) throws SqlException {
>         checkForClosedConnection();
>         if (sql == null) {
>-            throw new SqlException(agent_.logWriter_, "Null SQL string passed.");
>+            throw new SqlException(agent_.logWriter_,
>+                    new MessageId (SQLState.NULL_SQL_TEXT));
>         }
> 
>         // Derby can handle the escape syntax directly so only needs escape
>@@ -487,9 +488,7 @@
>             if (! allowLocalCommitRollback_()) {
>                 if (autoCommit) { // can't toggle to autocommit mode when between xars.start()
and xars.end()
>                     throw new SqlException(agent_.logWriter_,
>-                            "setAutoCommit(true) invalid during global transaction",
>-                            SqlState._2D521, // Spec'ed by PROTOCOL
>-                            SqlCode.invalidSetAutoCommitUnderXA);
>+                            new MessageId (SQLState.DRDA_NO_AUTOCOMMIT_UNDER_XA));  
                         
>                 }
>             } else {
>                 if (autoCommit == autoCommit_) {
>@@ -550,12 +549,9 @@
>     private void checkForInvalidXAStateOnCommitOrRollback() throws SqlException {
>         if (! allowLocalCommitRollback_()) {
>             throw new SqlException(agent_.logWriter_,
>-                    "COMMIT or ROLLBACK invalid for application execution environment",
>-                    SqlState._2D521, // Spec'ed by PROTOCOL
>-                    SqlCode.invalidCommitOrRollbackUnderXA);
>+                new MessageId(SQLState.DRDA_INVALID_XA_STATE_ON_COMMIT_OR_ROLLBACK));
>         }
>     }
>-
>     public void flowCommit() throws SqlException {
>         // Per JDBC specification (see javadoc for Connection.commit()):
>         //   "This method should be used only when auto-commit mode has been disabled."
>@@ -644,7 +640,9 @@
>             if (agent_.loggingEnabled()) {
>                 agent_.logWriter_.traceEntry(this, "rollback");
>             }
>+            
>             checkForInvalidXAStateOnCommitOrRollback();
>+
>             checkForClosedConnection();
>             flowRollback();
>         }
>@@ -713,8 +711,7 @@
>         // The following precondition matches CLI semantics, see SQLDisconnect()
>         if (!autoCommit_ && inUnitOfWork_ && !allowCloseInUOW_()) {
>             throw new SqlException(agent_.logWriter_,
>-                    "java.sql.Connection.close() requested while a transaction is in
progress on the connection." +
>-                    "The transaction remains active, and the connection cannot be closed.");
>+                    new MessageId (SQLState.CANNOT_CLOSE_ACTIVE_XA_CONNECTION));    
              
>         }
>     }
> 
>@@ -917,8 +914,8 @@
>             case java.sql.Connection.TRANSACTION_NONE:
>             default:
>                 throw new SqlException(agent_.logWriter_,
>-                        "Transaction isolation level " + level + " is an invalid argument
for java.sql.Connection.setTransactionIsolation()." +
>-                        " See Javadoc specification for a list of valid arguments.",
"XJ045");
>+                    new MessageId (SQLState.UNIMPLEMENTED_ISOLATION_LEVEL),
>+                    new Integer(level));                        
>             }
>             if (setTransactionIsolationStmt == null  || 
>             		!(setTransactionIsolationStmt.openOnClient_ &&
>@@ -1183,7 +1180,9 @@
>                 agent_.logWriter_.traceEntry(this, "setTypeMap", map);
>             }
>             checkForClosedConnection();
>-            throw new SqlException(agent_.logWriter_, "Connection.setTypeMap is not supported");
>+            throw new SqlException(agent_.logWriter_, 
>+            		new MessageId (SQLState.NOT_IMPLEMENTED),
>+                    "setTypeMap");
>         }
>         catch ( SqlException se )
>         {
>@@ -1246,7 +1245,8 @@
>             checkForClosedConnection();
>             if (autoCommit_) // Throw exception if auto-commit is on
>             {
>-                throw new SqlException(agent_.logWriter_, "Cannot set savepoint when
in auto-commit mode.");
>+                throw new SqlException(agent_.logWriter_, 
>+                        new MessageId (SQLState.NO_SAVEPOINT_WHEN_AUTO));
>             } 
>             // create an un-named savepoint.
>             if ((++dncGeneratedSavepointId_) < 0) {
>@@ -1270,10 +1270,12 @@
>             checkForClosedConnection();
>             if (name == null) // Throw exception if savepoint name is null
>             {
>-                throw new SqlException(agent_.logWriter_, "Named savepoint needs a none-null
name.");
>+                throw new SqlException(agent_.logWriter_, 
>+                        new MessageId (SQLState.NULL_NAME_FOR_SAVEPOINT));
>             } else if (autoCommit_) // Throw exception if auto-commit is on
>             {
>-                throw new SqlException(agent_.logWriter_, "Cannot set savepoint when
in auto-commit mode.");
>+                throw new SqlException(agent_.logWriter_, 
>+                        new MessageId (SQLState.NO_SAVEPOINT_WHEN_AUTO));
>             }
>             // create a named savepoint.
>             Object s = setSavepointX(new Savepoint(agent_, name));
>@@ -1327,20 +1329,22 @@
>             checkForClosedConnection();
>             if (savepoint == null) // Throw exception if savepoint is null
>             {
>-                throw new SqlException(agent_.logWriter_, "Cannot rollback to a null
savepoint.");
>+                throw new SqlException(agent_.logWriter_, 
>+                		new MessageId (SQLState.XACT_SAVEPOINT_RELEASE_ROLLBACK_FAIL));
>             } else if (autoCommit_) // Throw exception if auto-commit is on
>             {
>-                throw new SqlException(agent_.logWriter_, "Cannot rollback to a savepoint
when in auto-commit mode.");
>+                throw new SqlException(agent_.logWriter_, 
>+                		new MessageId (SQLState.NO_SAVEPOINT_ROLLBACK_OR_RELEASE_WHEN_AUTO));
>             } 
>             // Only allow to rollback to a savepoint from the connection that create
the savepoint.
>             try {
>                 if (this != ((Savepoint) savepoint).agent_.connection_) {
>                     throw new SqlException(agent_.logWriter_,
>-                            "Rollback to a savepoint not created by this connection.");
>+                    		new MessageId (SQLState.SAVEPOINT_NOT_CREATED_BY_CONNECTION));
>                 }
>             } catch (java.lang.ClassCastException e) { // savepoint is not an instance
of am.Savepoint
>                 throw new SqlException(agent_.logWriter_,
>-                        "Rollback to a savepoint not created by this connection.");
>+                		new MessageId (SQLState.SAVEPOINT_NOT_CREATED_BY_CONNECTION));
>             }
> 
>             // Construct and flow a savepoint rollback statement to server.
>@@ -1385,20 +1389,23 @@
>             checkForClosedConnection();
>             if (savepoint == null) // Throw exception if savepoint is null
>             {
>-                throw new SqlException(agent_.logWriter_, "Cannot release a null savepoint.");
>+                throw new SqlException(agent_.logWriter_, 
>+                        new MessageId (SQLState.XACT_SAVEPOINT_RELEASE_ROLLBACK_FAIL));
>             } else if (autoCommit_) // Throw exception if auto-commit is on
>             {
>-                throw new SqlException(agent_.logWriter_, "Cannot release a savepoint
when in auto-commit mode.");
>+                throw new SqlException(agent_.logWriter_, 
>+                        new MessageId (SQLState.NO_SAVEPOINT_ROLLBACK_OR_RELEASE_WHEN_AUTO));
>             } 
>             // Only allow to release a savepoint from the connection that create the
savepoint.
>             try {
>                 if (this != ((Savepoint) savepoint).agent_.connection_) {
>-                    throw new SqlException(agent_.logWriter_,
>-                            "Cannot release a savepoint that was not created by this
connection.");
>+                    throw new SqlException(agent_.logWriter_, new MessageId 
>+                            (SQLState.SAVEPOINT_NOT_CREATED_BY_CONNECTION));
>                 }
>             } catch (java.lang.ClassCastException e) { // savepoint is not an instance
of am.Savepoint
>-                throw new SqlException(agent_.logWriter_,
>-                        "Cannot release a savepoint that was not created by this connection.");
>+                    throw new SqlException(agent_.logWriter_, new MessageId 
>+                            (SQLState.SAVEPOINT_NOT_CREATED_BY_CONNECTION));
>+
>             }
> 
>             // Construct and flow a savepoint release statement to server.
>@@ -1609,7 +1616,9 @@
>                 agent_.logWriter_.traceEntry(this, "prepareStatement", sql, columnIndexes);
>             }
>             checkForClosedConnection();
>-            throw new SqlException(agent_.logWriter_, "Driver not capable");
>+            throw new SqlException(agent_.logWriter_, 
>+                new MessageId (SQLState.NOT_IMPLEMENTED),
>+                "prepareStatement(String, int[])");
>         }
>         catch ( SqlException se )
>         {
>@@ -1866,7 +1875,8 @@
>     protected void checkForClosedConnection() throws SqlException {
>         if (!open_) {
>             agent_.checkForDeferredExceptions();
>-            throw new SqlException(agent_.logWriter_, "invalid operation: connection
closed");
>+            throw new SqlException(agent_.logWriter_, 
>+            		new MessageId (SQLState.NO_CURRENT_CONNECTION));
>         } else {
>             agent_.checkForDeferredExceptions();
>         }
>@@ -1875,13 +1885,15 @@
>     void checkAutoGeneratedKeysParameters(int autoGeneratedKeys, String[] columnNames)
throws SqlException {
>         if (autoGeneratedKeys != java.sql.Statement.NO_GENERATED_KEYS &&
>                 autoGeneratedKeys != java.sql.Statement.RETURN_GENERATED_KEYS) {
>-            throw new SqlException(agent_.logWriter_, "Invalid argument: " +
>-                    "Statement auto-generated keys value " + autoGeneratedKeys +
>-                    " is invalid.");
>+            throw new SqlException(agent_.logWriter_, 
>+            		new MessageId(SQLState.BAD_AUTO_GEN_KEY_VALUE), 
>+            		new Integer (autoGeneratedKeys));
>         }
> 
>         if (columnNames != null) {
>-            throw new SqlException(agent_.logWriter_, "Driver not capable");
>+            throw new SqlException(agent_.logWriter_,
>+            		new MessageId (SQLState.NOT_IMPLEMENTED),
>+                    "getAutoGeneratedKeys(columnNames == null)");
>         }
> 
>     }
>
>Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java (original)
>+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java Thu Mar
23 16:55:44 2006
>@@ -117,10 +117,10 @@
>         
>         this.setThrowable(cause);
>     }
>-
>-    public SqlException(LogWriter logWriter, MessageId messageId, Throwable cause)
>-    {
>-        this(logWriter,messageId,null,cause);
>+ 
>+    public SqlException (LogWriter logwriter, 
>+            MessageId msgid, Throwable cause) {
>+        this (logwriter, msgid, null, cause);
>     }
>     
>     public SqlException(LogWriter logwriter, MessageId msgid, Object[] args)
>@@ -138,6 +138,12 @@
>         this(logwriter, msgid, new Object[] { arg1 });
>     }
>     
>+    public SqlException(LogWriter logwriter, MessageId msgid, 
>+            Object arg1, Throwable cause)
>+    {
>+        this(logwriter, msgid, new Object[] { arg1 }, cause);
>+    }
>+    
>     public SqlException(LogWriter logwriter,
>         MessageId msgid, Object arg1, Object arg2)
>     {
>@@ -226,7 +232,7 @@
>     {
>         wrappedException_ = wrapme;
>     }
>-        
>+            
>     // Constructors for backward-compatibility while we're internationalizng
>     // all the messages
>     public SqlException(LogWriter logWriter) {
>
>Modified: db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties
(original)
>+++ db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties
Thu Mar 23 16:55:44 2006
>@@ -43,7 +43,6 @@
> 01X04=Unable to obtain message text from server. See the next exception. The stored procedure
SYSIBM.SQLCAMESSAGE is not installed on the server. Please contact your database administrator.
> 01X05=Number of rows returned ({0}) is too large to fit in an integer; the value returned
will be truncated.
> 
>-
> # 08 - Connection exceptions
> 08003.C.1=getConnection() is not valid on a closed PooledConnection.
> 08003.C.2=Lob method called after connection was closed
>@@ -51,6 +50,11 @@
> # 0A - Feature not supported
> 0AX01.S=JDBC method is not yet implemented.
> 
>+# 2D - DRDA exceptions
>+2D521.S.1=setAutoCommit(true) invalid during global transaction.
>+2D521.S.2=COMMIT or ROLLBACK invalid for application execution environment.
>+
>+
> # XN - Network-client driver-specific SQL states
> XN003.S=Blob offset ''{0}'' is either less than zero or is too large for the current
blob.
> XN004.S=Invalid operation: wasNull() called with no data retrieved.
>@@ -68,7 +72,30 @@
> XN111.S=Foreign table name can not be null
> XN112.S=Security exception encountered, see next exception for details.
> 
>+XN050.S=Required character converter not available for data type.
>+XN051.S=Unsupported Encoding
>+XN052.S=Search string cannot be null.
>+XN053.S=Clob position must start from 1 or more.
>+XN054.S=Invalid position {0} , offset {1} or length {2}
>+XN055.S=Invalid length {0}
>+XN056.S=Clob object is too large
>+XN057.S=Invalid position {0}
>+XN058.S=Invalid offset {0}
>+XN059.S=Unsupported Type
>+XN060.S=Unregistered column type
>+XN061.S=The jdbcType {0} does not match between the setter method and the registerOutParameter
method.
>+XN062.S=Unrecognized jdbc type {0}
>+XN063.S=Unrecognized driver type {0}
>+XN064.S=Privileged Action Failed
>+XN065.S=Missing resource bundle in {0} package for {1}
>+XN067.S=Cannot rollback or release a savepoint that was not created by this connection.
>+XN068.S=Driver not capable
>+XN069.S=The auto-generated keys value {0} is invalid
>+XN070.S=The Reader/Stream object does not contain length characters
>+
>+
> XN151.S=Unable to open file {0} : {1}
>+
> 
> #  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> #
>
>Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties (original)
>+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties Thu Mar
23 16:55:44 2006
>@@ -41,6 +41,7 @@
> 
> # COntext service
> 08000=Connection closed by unknown interrupt.
>+08000.S.1=Cannot close a connection with an active transaction.  The transaction remains
open and the connection was not closed.
> 
> #../java/com/ibm/db2j/protocol/BasicServices/LockManager/messages.properties
> 40001=A lock could not be obtained due to a deadlock, cycle of locks and waiters is:\n{0}.
The selected victim is XID : {1}.
>@@ -1080,6 +1081,7 @@
> 07009=No input parameters.
> 
> S0022=Column ''{0}'' not found.
>+XJ008.S=Cannot rollback or release a savepoint when in auto-commit mode.
> XJ009.S=Use of CallableStatement required for stored procedure call or use of output
parameters: {0}
> XJ010.S=Cannot issue savepoint when autoCommit is on.
> XJ011.S=Cannot pass null for savepoint name.
>
>Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
(original)
>+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/i18n/MessageUtil.java
Thu Mar 23 16:55:44 2006
>@@ -241,20 +241,20 @@
>                     return MessageFormat.format(message, arguments);
>                 }
>                 catch (IllegalArgumentException iae) {
>-                    if ( !composeDefault )
>+                    if ( !composeDefault || SanityManager.DEBUG )
>                         throw iae;
>                 }
>                 catch (NullPointerException npe) {
>                     //
>                     //null arguments cause a NullPointerException. 
>                     //This improves reporting.
>-                    if ( !composeDefault )
>+                    if ( !composeDefault  || SanityManager.DEBUG )
>                         throw npe;
>                 }
> 
>             } catch (MissingResourceException mre) {
>                 // caller will try and handle the last chance
>-                if (!composeDefault)
>+                if (!composeDefault )
>                     throw mre;
>             } 
>         }
>
>Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
>+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Thu Mar 23 16:55:44 2006
>@@ -1274,7 +1274,6 @@
> 
> 	// Non-SQLSTATE errors 
> 	String LANG_DOES_NOT_RETURN_ROWS                                   = "XCL01.S";
>-	String LANG_STATEMENT_CLOSED                                       = "XCL04.S";
> 	String LANG_ACTIVATION_CLOSED                                      = "XCL05.S";
> 	String LANG_CURSOR_CLOSED                                          = "XCL07.S";
> 	String LANG_NO_CURRENT_ROW                                         = "XCL08.S";
>@@ -1387,7 +1386,7 @@
> 	String NEED_TO_REGISTER_PARAM = "07004";
>     String COLUMN_NOT_FOUND = "S0022";
>     //String NO_COMMIT_WHEN_AUTO = "XJ007.S";
>-    //String NO_ROLLBACK_WHEN_AUTO = "XJ008.S";
>+    String NO_SAVEPOINT_ROLLBACK_OR_RELEASE_WHEN_AUTO = "XJ008.S";
>     String REQUIRES_CALLABLE_STATEMENT = "XJ009.S";
>     String NO_SAVEPOINT_WHEN_AUTO = "XJ010.S";
>     String NULL_NAME_FOR_SAVEPOINT = "XJ011.S";
>@@ -1527,7 +1526,34 @@
>     String PRIMARY_TABLE_NAME_IS_NULL                               = "XN110.S";
>     String FOREIGN_TABLE_NAME_IS_NULL                               = "XN111.S";
>     String SECURITY_EXCEPTION_ENCOUNTERED                           = "XN112.S";
>+    String CHAR_CONVERTER_NOT_FOUND                                 = "XN050.S";
>+    String UNSUPPORTED_ENCODING                                     = "XN051.S";
>+    String NULL_SEARCH_STRING                                       = "XN052.S";
>+    String INVALID_CLOB_START_POS                                   = "XN053.S";
>+    String INVALID_POS_OFFSET_OR_LEN                                = "XN054.S";
>+    String INVALID_LENGTH                                           = "XN055.S";
>+    String CLOB_TOO_LARGE                                           = "XN056.S";
>+    String INVALID_POSITION                                         = "XN057.S";
>+    String INVALID_OFFSET                                           = "XN058.S";
>+    String UNSUPPORTED_TYPE                                         = "XN059.S";
>+    String UNREGISTERED_COLUMN_TYPE                                 = "XN060.S";
>+    String TYPE_MISMATH_WITH_REG_TYPE                               = "XN061.S";
>+    String BAD_JDBC_TYPE                                            = "XN062.S";
>+    String BAD_DRIVER_TYPE                                          = "XN063.S";
>+    String ERROR_PRIVILEGED_ACTIOM                                  = "XN064.S";
>+    String MISSING_RESOURCE_BUNDLE                                  = "XN065.S";
>+    String SAVEPOINT_NOT_CREATED_BY_CONNECTION                      = "XN067.S";
>+    String DRIVER_NOT_CAPABLE                                       = "XN068.S";
>+    String BAD_AUTO_GEN_KEY_VALUE                                   = "XN069.S";
>+    String READER_UNDER_RUN                                         = "XN070.S";
>+    
>     String UNABLE_TO_OPEN_FILE = "XN151.S";
>+    
>+    /*
>+     ** Messages whose SQL states are proscribed by DRDA
>+     */
>+    String DRDA_NO_AUTOCOMMIT_UNDER_XA                            = "2D521.S.1";
>+    String DRDA_INVALID_XA_STATE_ON_COMMIT_OR_ROLLBACK            = "2D521.S.2";
>     
> 	/*
> 	** org.apache.derby.database.UserUtility
>
>Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/
>------------------------------------------------------------------------------
>--- svn:ignore (added)
>+++ svn:ignore Thu Mar 23 16:55:44 2006
>@@ -0,0 +1 @@
>+TestClientMessages.java
>
>Added: db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt?rev=388309&view=auto
>==============================================================================
>--- db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt (added)
>+++ db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt Thu Mar 23
16:55:44 2006
>@@ -0,0 +1,18 @@
>+package org.apache.derbyTesting.functionTests.tests.i18n; 
>+
>+import org.apache.derby.client.am.MessageId; 
>+import org.apache.derby.client.am.SqlException; 
>+import org.apache.derby.shared.common.reference.SQLState; 
>+
>+/** 
>+ * This class is a GENERATED FILE that tests as many of the messages 
>+ * in the client code as possible. 
>+ * 
>+ * See tools/testing/i18nTestGenerator/generateClientMessageTest.sh 
>+ */ 
>+public class TestClientMessages { 
>+  private static Exception e; 
>+  private static String feature = "testFeature";
>+
>+  public static void main(String[] args) { 
>+
>
>Propchange: db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt
>------------------------------------------------------------------------------
>    svn:eol-style = native
>
>Modified: db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient1.sed
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient1.sed?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient1.sed (original)
>+++ db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient1.sed Thu Mar 23 16:55:44
2006
>@@ -1,2 +1,8 @@
>-/new MessageId.*)\;/p 
>+# Print out anything that creates a MessageId, this is a situation
>+# where message translation is likely happening
>+#
>+# Print out a label in a comment to assist further activity
>+/new MessageId.*);/p
>+# Catch situation where the MessageId parameter is on the next line
> /new MessageId[^;]*$/,/);/p
>+
>
>Modified: db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed (original)
>+++ db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed Thu Mar 23 16:55:44
2006
>@@ -1,10 +1,51 @@
>+# For those expressions that start with "new MessageId", pre-append
>+# a try block and create a SqlException to complete the expression
>+/^[[:space:]]*new MessageId/i\
>+    try { \
>+       e = new SqlException(null,
>+
>+# For those expressions that start with "new SqlException", pre-append
>+# a try block
>+/new[[:space:]]*SqlException/i\
>+    try {
>+
>+# At the end of each statement, check and print out an error
>+# if there is a problem
>+/;/a \
>+    } catch ( Throwable t ) { \
>+      // We can get this on an assertion failure \
>+      t.printStackTrace(); \
>+    } \
>+    if ( e.getMessage().startsWith("UNKNOWN") )  {\
>+      e.printStackTrace(); \
>+      System.err.println("FAILURE: message id was not found"); \
>+    }
>+
>+#
>+# Add substitution for various string parameters where you replace
>+# the variable with a string containing the variable.  This prevents
>+# compile errors saying "symbol not found"
>+#
> s/fileName/"fileName"/g
> s/e.getMessage()/"e.getMessage"/g
>-s/new Long([^)]*/new Long(0/g
>-s/new Integer([^)]*/new Integer(0/g
>+s/Configuration.packageNameForDNC/"Configuration.packageNameForDNC"/g
>+s/Configuration.dncDriverName/"Configuration.dncDriverName"/g
>+s/[^\.]packageNameForDNC/"packageNameForDNC"/g
>+s/source,/"source",/g
>+
>+#
>+# Subsitute Long and Integer params with 0 as a default
>+#
>+s/new Long[[:space:]]*([^)]*/new Long(0/g
>+s/new Integer[[:space:]]*([^)]*/new Integer(0/g
>+
>+# Get rid of logWriter
>+s/new SqlException[[:space:]]*(.*,/new SqlException(null,/g
>+
>+# Don't throw, just assign
>+s/throw new/e = new/g
>+
>+# There are some odd situations where there is one too many parens
> s/)))/))/g
>-/new MessageId/i\
>-    e = new SqlException(null,
>-/[^(]);/a \
>-    if ( e.getMessage().startsWith("UNKNOWN") ) \
>-      throw e; \
>+
>+
>
>Modified: db/derby/code/trunk/tools/testing/i18nTestGenerator/generateClientMessageTest.sh
>URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/tools/testing/i18nTestGenerator/generateClientMessageTest.sh?rev=388309&r1=388308&r2=388309&view=diff
>==============================================================================
>--- db/derby/code/trunk/tools/testing/i18nTestGenerator/generateClientMessageTest.sh (original)
>+++ db/derby/code/trunk/tools/testing/i18nTestGenerator/generateClientMessageTest.sh Thu
Mar 23 16:55:44 2006
>@@ -31,28 +31,10 @@
> fi
> 
> 
>-#
>-# Create the top of the file
>-#
> FILE=$ROOT/$TESTDIR/TestClientMessages.java
> 
>-echo "package org.apache.derbyTesting.functionTests.tests.i18n;" > $FILE
>-echo "" >> $FILE
>-echo "import org.apache.derby.client.am.MessageId;" >> $FILE
>-echo "import org.apache.derby.client.am.SqlException;" >> $FILE
>-echo "import org.apache.derby.shared.common.reference.SQLState;" >> $FILE
>-echo "" >> $FILE
>-echo "/**" >> $FILE
>-echo " * This class is a GENERATED FILE that tests as many of the messages" >>
$FILE
>-echo " * in the client code as possible." >> $FILE
>-echo " */" >> $FILE
>-echo "public class TestClientMessages" >> $FILE
>-echo "{" >> $FILE
>-echo "  private static Exception e;" >> $FILE
>-echo '  private static String feature = "testFeature";' >> $FILE
>-echo "" >> $FILE
>-echo "  public static void main(String[] args) {" >> $FILE
>-echo "    try {" >> $FILE
>+rm -f $FILE $FILE.2
>+
> 
> CLIENTROOT=$ROOT/java/client/org/apache/derby
> if [ ! -d $CLIENTROOT ]
>@@ -75,30 +57,24 @@
> # source file.  We'll then compile this file, run it, and make
> # sure we have valid uses of message ids
> #
>+touch $FILE
> for i in $FILES
> do
>   echo "    // from source file $i" >> $FILE
>-  sed -n -f $MYDIR/genClient1.sed $i >> $FILE 
>+  sed -n -f $MYDIR/genClient1.sed $i | sed -f $MYDIR/genClient2.sed >> $FILE 
>+  #sed -n -f $MYDIR/genClient1.sed $i >> $FILE
> done
> 
> #
>-# Use this sed script to clean things up so the source compiles 
> #
>-sed -f $MYDIR/genClient2.sed $FILE > $FILE.2 
>-
>-if [ $? != 0 ]
>-then
>-  rm -f $FILE
>-  rm -f $FILE.2
>-  exit 1
>-fi
>-
>+# Add the beginning lines of the class to the file
>+#
>+cat $MYDIR/clientPrologue.txt $FILE > $FILE.2
> mv $FILE.2 $FILE
> 
>-echo "    }" >> $FILE
>-echo "    catch ( Throwable t ) {" >> $FILE
>-echo "      t.printStackTrace();" >> $FILE
>-echo "    }" >> $FILE
>+#
>+# Add the trailing lines of the class to the file
>+#
> echo "  }" >> $FILE
> echo "}" >> $FILE
> 
>
>
>  
>


Mime
View raw message