harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2415) [classlib][logging] Compatibility: Harmonyjava.util.logging.Level.getLocalizedName() returns non-localized string name
Date Thu, 28 Dec 2006 20:34:22 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2415?page=all ]

Alexei Zakharov updated HARMONY-2415:
-------------------------------------

    Summary: [classlib][logging] Compatibility: Harmonyjava.util.logging.Level.getLocalizedName()
returns non-localized string name  (was: [luni] Compatibility: Harmonyjava.util.logging.Level.getLocalizedName()
returns non-localized string name)

> [classlib][logging] Compatibility: Harmonyjava.util.logging.Level.getLocalizedName()
returns non-localized string name
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2415
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2415
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Artem Aliev
>
> When Level is created as some ResourceBundle, getLocalizedName() returns
> non-localized string name. This equals the result of getName().
> But on RI getLocalizedName() returns the same value as the 
> resourceBundle.getString(levelName)
> Code for reproducing:
> To reproduce this bug run the following test:
> ---------------HT1_resource.java-------------
> import java.util.ListResourceBundle;
> public class HT1_resource extends ListResourceBundle {
>     public Object[][] getContents() {
>             return contents;
>     }
>     static final Object[][] contents = {
>                 {"Level_error", "Name"},
>                 {"Localized", "Localized message"},
>     };
> }
> ----------------HT1.java--------------
> import java.text.*;
> import java.util.*;
> import java.util.logging.*;
> import java.io.*;
> import junit.framework.TestCase;
> public class HT1 extends TestCase {
>     public final String bundleName = "HT1_resource";
>     public void testT() {
>         String levelName = "Level_error";
>         Level newLevel = new myLevel(levelName, 600, bundleName);
>         //getLocalizedName() should return the same value as 
>         //resourceBundle.getString(levelName)
>         ResourceBundle rb = ResourceBundle.getBundle(bundleName);
>         String lName = newLevel.getLocalizedName();
>         String rName = rb.getString(levelName);
>         if (!lName.equals(rName)) {
>             fail("getLocalizedName() returns "
>                                 + lName
>                                 + " but should return the same value as " 
>                                 + rName);
>         }
>     }
> }
> class myLevel extends Level {
>     public myLevel (String name, int value) {
>         super(name, value);
>     }
>     public myLevel (String name, int value, String resourceBundleName) {
>         super(name, value, resourceBundleName);
>     }
> }
> ------------------------
> Steps to Reproduce:
> 1) Create HT1 and HT1_resource classes
> 2) Run test
>    java -cp .:junit.jar -showversion junit.textui.TestRunner HT1
> Output:
> On RI:
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> .
> Time: 0.015
> OK (1 test)
> On Harmony:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software
> Foundation or its licensors, as applicable.
> java version "1.5.0" 
> pre-alpha : not complete or compatible
> svn = rsvn: '.' is not a working copy, (Sep 26 2006), Linux/ia32/gcc 3.3.3,
> release build
> http://incubator.apache.org/harmony
> .F
> Time: 0.113
> There was 1 failure:
> 1) testT(HT1)junit.framework.AssertionFailedError: getLocalizedName() returns
> Level_error but should return the same value as Name
>         at HT1.testT(HT1.java:22)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> FAILURES!!!
> Tests run: 1,  Failures: 1,  Errors: 0
> On Harmony+j9
> .F
> Time: 0.047
> There was 1 failure:
> 1) testT(HT1)junit.framework.AssertionFailedError: getLocalizedName() returns
> Level_error
> but should return the same value as Name
>         at HT1.testT(HT1.java:22)
>         at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> FAILURES!!!
> Tests run: 1,  Failures: 1,  Errors: 0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message