harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruth Cao (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3881) [classlib][sql] deserialization of javax.sql.ConnectionEvent is incompatible with RI
Date Thu, 17 May 2007 01:41:16 GMT
[classlib][sql] deserialization of javax.sql.ConnectionEvent is incompatible with RI
------------------------------------------------------------------------------------

                 Key: HARMONY-3881
                 URL: https://issues.apache.org/jira/browse/HARMONY-3881
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ruth Cao


Harmony cannot read RI's serialization file of ConnectionEvent, thus the following test case
fails:

public void testSerializationCompatibility() throws Exception {
    	Impl_PooledConnection ipc = new Impl_PooledConnection();
    	SQLException nextSQLException = new SQLException("nextReason",
                "nextSQLState", 33);

        int vendorCode = 10;
        SQLException sqlException = new SQLException("reason", "SQLState", vendorCode);

        sqlException.setNextException(nextSQLException);
        
        ConnectionEvent ce = new ConnectionEvent(ipc, sqlException);
        
        SerializationTest.verifyGolden(this, ce, CONNECTIONEVENT_COMPARATOR);
    }
    
    private static final SerializableAssert CONNECTIONEVENT_COMPARATOR = new SerializableAssert()
{

		public void assertDeserialized(Serializable initial, Serializable deserialized) {
			ConnectionEvent ceInitial = (ConnectionEvent) initial; 
			ConnectionEvent ceDeser = (ConnectionEvent) deserialized;
			
			SQLException initThr = ceInitial.getSQLException();
                        SQLException dserThr = ceDeser.getSQLException();

                       // verify SQLState
                       assertEquals(initThr.getSQLState(), dserThr.getSQLState());

                     // verify vendorCode
                     assertEquals(initThr.getErrorCode(), dserThr.getErrorCode());

                   // verify next
                  if (initThr.getNextException() == null) {
                         assertNull(dserThr.getNextException());
                  }   
        }
    };

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message