Recently we have agreed to put the serialization data file to the <module>/test/resources/serialization directory, but which requires Eclipse user additional setting to run serialization tests. To handle this issue, I propose to add the following lines to .classpath file of each module as below, so that the files in resources directory can be built into default classpath. Comments?

<classpathentry output="bin/resources/test" kind="src" path="src/test/resources"/> <classpathentry output="bin/resources/main" kind="src" path="src/main/resources"/>

George Harley (JIRA) wrote:
     [ http://issues.apache.org/jira/browse/HARMONY-349?page=all ]
George Harley resolved HARMONY-349:
-----------------------------------

    Resolution: Fixed

Hi Paulex, Changes committed in revision 395251. I made a couple of modifications to the supplied test case to enable it to load the .ser file from the system classloader. In addition I put the .ser into the modules/text/src/test/resources/serialization/java/text location and updated the build.xml with a new copy.test.resources target so that this .ser file (and eventually others like it) make it onto the runtime classpath. Please could you confirm if this version of your patch has been applied to your satisfaction. Thanks for this enhancement, George

 The currency field of DecimalFormatSymbols is not deserialized properly
------------------------------------------------------------------------

         Key: HARMONY-349
         URL: http://issues.apache.org/jira/browse/HARMONY-349
     Project: Harmony
        Type: Bug

  Components: Classlib
    Reporter: Paulex Yang
    Assignee: George Harley
 Attachments: 02.JIRA349_text.zip

According to the serialized form of DecimalFormatSymbols, the DecimalFormatSymbols itself should be responsible for initializing the currency from the intlCurrencySymbol field. But Harmony only leave it as null. The following test case reproduces this bug:
        public void test_serialization() {
                DecimalFormatSymbols symbols = new 
DecimalFormatSymbols(Locale.FRANCE);
                Currency currency = symbols.getCurrency();
                assertNotNull(currency);
                try {
                        // serialize
                        ByteArrayOutputStream byteOStream = new 
ByteArrayOutputStream();
                        ObjectOutputStream objectOStream = new 
ObjectOutputStream(
                                        byteOStream);
                        objectOStream.writeObject(symbols);
                        // and deserialize
                        ObjectInputStream objectIStream = new ObjectInputStream(
                                        new 
ByteArrayInputStream(byteOStream.toByteArray()));
                        DecimalFormatSymbols symbolsD = (DecimalFormatSymbols) 
objectIStream
                                        .readObject();
                        
                        // The associated currency will not persist
                        currency = symbolsD.getCurrency();
                } catch (Exception e1) {
                        fail("Errors occur during serialization");
                }
                try {
                        assertNotNull(currency);
                } catch (Exception e) {
                        fail("currency should not be null");
                }
        }
Pass on RI(Sun JDK1.5.0_06)
Rail on Harmony



--
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to