harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6015) [classlib] [beans] Exceptions should be thrown and handled in XMLDecoder.readObject() rather than XMLDecoder's constructors
Date Thu, 13 Nov 2008 08:20:44 GMT
 [classlib] [beans] Exceptions should be thrown and handled in XMLDecoder.readObject() rather
than XMLDecoder's constructors
----------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-6015
                 URL: https://issues.apache.org/jira/browse/HARMONY-6015
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M7
            Reporter: Kevin Zhou
             Fix For: 5.0M8


Given a test scenario [1], conduct it on RI and HY.
RI works well while HY fails.
This test case illuminates that RI doesn't parse the content of given InputStream in XMLDecoder's
constructions, which should be handled in its readObject method.
I think that we should follow RI's behaviors on this.

[1]
public void test_setExceptionListener() throws Exception {
class MockExceptionListener implements ExceptionListener {
private boolean isCalled;
public void exceptionThrown(Exception e) { isCalled = true; }
public boolean isCalled() { return isCalled; }
}
XMLDecoder xmlDecoder = new XMLDecoder(new ByteArrayInputStream(
"<java><string/>".getBytes("UTF-8")));
MockExceptionListener mockListener = new MockExceptionListener();
xmlDecoder.setExceptionListener(mockListener);
assertNotNull(xmlDecoder.readObject());
assertTrue(mockListener.isCalled());
}

-- 
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