[jira] Commented: (HARMONY-58) Problems trying to run the security2 test suite
[ http://issues.apache.org/jira/browse/HARMONY-58?page=comments#action_12364779 ] Tim Ellison commented on HARMONY-58: Thank you Mikhail / Stepan. My mistake, when people were posting to say the security2 tests passed I had assumed that they were running on the Harmony codebase. I'm going to update the security2 ant script to run tests on Harmony class lib and provide an exclude list for it This is the right answer -- then emptying the exclude list will be a goal for the project. I'll just sit tight for a while. You may want to look at the test case exclude-list code that George recently posted to JIRA, I'm sure he'd be happy to explain it. Problems trying to run the security2 test suite --- Key: HARMONY-58 URL: http://issues.apache.org/jira/browse/HARMONY-58 Project: Harmony Type: Test Components: Classlib Environment: x86, WinXP, repo revision 373866 Reporter: Tim Ellison With a combination of Stepan and Geir's instructions I have: Built the classlib successfully code by: - putting a JDK on the path, unset JAVA_HOME and CLASSPATH - invoke the default target in trunk/make/build.xml - put in the VM Built the security tests successfully by: - cd modules/security2/make - ant tests.run (ignore the run failures) Tried to run the tests by: - set CLASSPATH=%CLASSPATH%;junit.jar;bcprov.jar - set JAVA_HOME=trunk/deploy/jre - set PATH=%JAVA_HOME%/bin;%PATH% - hack the build.xml to remove the clean-ups - ant tests.run After a few targets going by it trys to run the test, but seems to hang with CPU at 100% and the following output on the console: - snip run: [junit] Running java.security.AccessControlExceptionTest [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.04 sec [junit] Running java.security.AlgorithmParameterGeneratorSpiTests [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.209 sec [junit] Running java.security.AlgorithmParameterGeneratorTest1 -- 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
[jira] Assigned: (HARMONY-60) java.net.URL.getHost() must return the IPv6 address enclosed in square brackets
[ http://issues.apache.org/jira/browse/HARMONY-60?page=all ] Tim Ellison reassigned HARMONY-60: -- Assign To: Tim Ellison java.net.URL.getHost() must return the IPv6 address enclosed in square brackets --- Key: HARMONY-60 URL: http://issues.apache.org/jira/browse/HARMONY-60 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification for java.net.URL.getHost() the method must return the IPv6 address enclosed in square brackets ('[' and ']'). The test listed below shows an absence of square brackets for the IPv6 address. Code to reproduce: import java.net.*; public class test2 { public static void main(String[] args) { URL url=null; String protocol = http; int port = -1; String host = FEDC:BA98:7654:3210:FEDC:BA98:7654:3210; String file = myFile; try { url = new URL(protocol,host,port,file); } catch (Exception e) { System.out.println(URL.URL(protocol,host,port,file) caused: + e); return; } if (url.getHost().equals([+host+])) { System.out.println(OK, host is in square brackets=+url.getHost()); } else { System.out.println(Incorrect, host is not in square brackets=+url.getHost()); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK, host is in square brackets=[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210] C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***Incorrect, host is not in square brackets=FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 Suggested junit test case: URLTest.java - import java.net.*; import junit.framework.*; public class URLTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(URLTest.class); } public void test_getHost() { URL url=null; String protocol = http; int port = -1; String host = FEDC:BA98:7654:3210:FEDC:BA98:7654:3210; String file = myFile; try { url = new URL(protocol,host,port,file); } catch (Exception e) { fail(Assert 0: URL.URL(protocol,host,port,file) caused: + e); } assertEquals (([+host+]), url.getHost()); } } -- 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
[jira] Updated: (HARMONY-61) java.net.InetAddress.getByAddress(null) throws NPE insread of UnknownHostException
[ http://issues.apache.org/jira/browse/HARMONY-61?page=all ] Tim Ellison updated HARMONY-61: --- Estimated Complexity: Novice java.net.InetAddress.getByAddress(null) throws NPE insread of UnknownHostException -- Key: HARMONY-61 URL: http://issues.apache.org/jira/browse/HARMONY-61 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko According to j2se 1.4.2 specification for java.net.InetAddress.getByAddress(byte[] addr) the method must throw UnknownHostException if IP address is of illegal length. IPv4 address byte array must be 4 bytes long and IPv6 byte array must be 16 bytes long. There is no mention about NPE at all. Mentions about NPE in case of null argument were not found in java.net package specification. The test listed below shows that getByAddress (null) throws NPE. BEA throws UnknownHostException. Code to reproduce: import java.net.*; public class test2 { public static void main (String[] args) { try { InetAddress.getByAddress (null); } catch (UnknownHostException e) { System.out.println(***OK. Expected UnknownHostException. + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK. UnknownHostException=:java.net.UnknownHostException: addr is of illegal length C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. java.lang.NullPointerException at java.net.InetAddress.getByAddress(InetAddress.java:735) at java.net.InetAddress.getByAddress(InetAddress.java:713) at test2.main(test2.java:7) Suggested junit test case: InetAddressTest.java - import java.net.*; import junit.framework.*; public class InetAddressTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(InetAddressTest.class); } public void test_getByAddress() { try { InetAddress.getByAddress (null); fail(Assert 0: UnknownHostException must be thrown); } catch (UnknownHostException e) { } } } -- 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
[jira] Assigned: (HARMONY-66) java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread.
[ http://issues.apache.org/jira/browse/HARMONY-66?page=all ] Tim Ellison reassigned HARMONY-66: -- Assign To: Tim Ellison java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread. Key: HARMONY-66 URL: http://issues.apache.org/jira/browse/HARMONY-66 Project: Harmony Type: Bug Components: Classlib Reporter: Elena Semukhina Assignee: Tim Ellison Priority: Minor java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread. According to specification, the Thread.getThreadGroup() method returns null if this thread has died. SecurityManager.checkAccess(Thread t) should take that into account. Code for reproducing: public class ThreadCheckAccess { class ThreadRunning extends Thread { volatile boolean stopWork = false; int i = 0; public void run () { while (!stopWork) { } } } public void test() { SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); ThreadRunning t = new ThreadRunning(); t.start(); t.stopWork = true; try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } try { sm.checkAccess(t); System.out.println(PASSED); } catch (NullPointerException e) { e.printStackTrace(); System.out.println(FAILED); } } public static void main(String args[]) { new ThreadCheckAccess().test(); } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-31) j2se subset as described in README.txt. 2. Compile ThreadCheckAccess.java using BEA 1.4 javac javac -d . ThreadCheckAccess.java 2. Run java using compatible VM (J9) java -showversion ThreadCheckAccess Output: java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. java.lang.NullPointerException at java.lang.SecurityManager.checkAccess(SecurityManager.java:92) at java.lang.Thread.checkAccess(Thread.java:423) at ThreadCheckAccess.test(ThreadCheckAccess.java:23) at ThreadCheckAccess.main(ThreadCheckAccess.java:32) FAILED Output on BEA 1.4.2: PASSED Suggested junit test case: package org.apache.harmony.tests.java.lang; import junit.framework.TestCase; public class SecurityManagerTest extends TestCase { class ThreadRunning extends Thread { volatile boolean stopWork = false; int i = 0; public void run () { while (!stopWork) { } } } public void test_checkAccessLjava_lang_Thread() { SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); ThreadRunning t = new ThreadRunning(); t.start(); t.stopWork = true; try { t.join(); } catch (InterruptedException e) { fail(Assert 0: unexpected + e); } try { sm.checkAccess(t); } catch (NullPointerException e) { fail(Assert 1: NullPointerException has been thrown); } } } -- 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
[jira] Resolved: (HARMONY-66) java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread.
[ http://issues.apache.org/jira/browse/HARMONY-66?page=all ] Tim Ellison resolved HARMONY-66: Resolution: Fixed Elena, Fixed in LUNI module java.lang.SecurityManager at repo revision 374062. Please check that this fully resolves your problem. java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread. Key: HARMONY-66 URL: http://issues.apache.org/jira/browse/HARMONY-66 Project: Harmony Type: Bug Components: Classlib Reporter: Elena Semukhina Assignee: Tim Ellison Priority: Minor java.lang.SecurityManager.checkAccess(Thread t) throws NullPointerException for the dead thread. According to specification, the Thread.getThreadGroup() method returns null if this thread has died. SecurityManager.checkAccess(Thread t) should take that into account. Code for reproducing: public class ThreadCheckAccess { class ThreadRunning extends Thread { volatile boolean stopWork = false; int i = 0; public void run () { while (!stopWork) { } } } public void test() { SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); ThreadRunning t = new ThreadRunning(); t.start(); t.stopWork = true; try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } try { sm.checkAccess(t); System.out.println(PASSED); } catch (NullPointerException e) { e.printStackTrace(); System.out.println(FAILED); } } public static void main(String args[]) { new ThreadCheckAccess().test(); } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-31) j2se subset as described in README.txt. 2. Compile ThreadCheckAccess.java using BEA 1.4 javac javac -d . ThreadCheckAccess.java 2. Run java using compatible VM (J9) java -showversion ThreadCheckAccess Output: java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. java.lang.NullPointerException at java.lang.SecurityManager.checkAccess(SecurityManager.java:92) at java.lang.Thread.checkAccess(Thread.java:423) at ThreadCheckAccess.test(ThreadCheckAccess.java:23) at ThreadCheckAccess.main(ThreadCheckAccess.java:32) FAILED Output on BEA 1.4.2: PASSED Suggested junit test case: package org.apache.harmony.tests.java.lang; import junit.framework.TestCase; public class SecurityManagerTest extends TestCase { class ThreadRunning extends Thread { volatile boolean stopWork = false; int i = 0; public void run () { while (!stopWork) { } } } public void test_checkAccessLjava_lang_Thread() { SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); ThreadRunning t = new ThreadRunning(); t.start(); t.stopWork = true; try { t.join(); } catch (InterruptedException e) { fail(Assert 0: unexpected + e); } try { sm.checkAccess(t); } catch (NullPointerException e) { fail(Assert 1: NullPointerException has been thrown); } } } -- 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
[jira] Updated: (HARMONY-58) Problems trying to run the security2 test suite
[ http://issues.apache.org/jira/browse/HARMONY-58?page=all ] Stepan Mishura updated HARMONY-58: -- Attachment: security2ClasslibTestsPatch.txt I've added 'test.classlib' target to run security2 tests on Harmony code base. So the following steps are required: - build the classlib - change dir to modules\security2\make - to compile security2 tests set JAVA_HOME to JDK path - set CLASSPATH=junit.jar;bcprov.jar - ant test.classlib Please let me know whether the patch works for you or not. Problems trying to run the security2 test suite --- Key: HARMONY-58 URL: http://issues.apache.org/jira/browse/HARMONY-58 Project: Harmony Type: Test Components: Classlib Environment: x86, WinXP, repo revision 373866 Reporter: Tim Ellison Attachments: security2ClasslibTestsPatch.txt With a combination of Stepan and Geir's instructions I have: Built the classlib successfully code by: - putting a JDK on the path, unset JAVA_HOME and CLASSPATH - invoke the default target in trunk/make/build.xml - put in the VM Built the security tests successfully by: - cd modules/security2/make - ant tests.run (ignore the run failures) Tried to run the tests by: - set CLASSPATH=%CLASSPATH%;junit.jar;bcprov.jar - set JAVA_HOME=trunk/deploy/jre - set PATH=%JAVA_HOME%/bin;%PATH% - hack the build.xml to remove the clean-ups - ant tests.run After a few targets going by it trys to run the test, but seems to hang with CPU at 100% and the following output on the console: - snip run: [junit] Running java.security.AccessControlExceptionTest [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.04 sec [junit] Running java.security.AlgorithmParameterGeneratorSpiTests [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.209 sec [junit] Running java.security.AlgorithmParameterGeneratorTest1 -- 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
Re: [jira] Commented: (HARMONY-58) Problems trying to run the security2 test suite
Geir Magnusson Jr wrote: What I don't get is why. Presumably BC is assuming that BigInteger does something real -- and is spinning 'cos we return null today. (Only speculation, I never attached a debugger). Oh - what version of BC are people using? I used v 1.3.1 for jdk1.4 Me too (bcprov-jdk14-131.jar). Tim geir Mikhail Loenko (JIRA) wrote: [ http://issues.apache.org/jira/browse/HARMONY-58?page=comments#action_12364766 ] Mikhail Loenko commented on HARMONY-58: --- BouncyCastle tend to hang up when BigInteger returns nulls. Will investigate Problems trying to run the security2 test suite --- Key: HARMONY-58 URL: http://issues.apache.org/jira/browse/HARMONY-58 Project: Harmony Type: Test Components: Classlib Environment: x86, WinXP, repo revision 373866 Reporter: Tim Ellison With a combination of Stepan and Geir's instructions I have: Built the classlib successfully code by: - putting a JDK on the path, unset JAVA_HOME and CLASSPATH - invoke the default target in trunk/make/build.xml - put in the VM Built the security tests successfully by: - cd modules/security2/make - ant tests.run (ignore the run failures) Tried to run the tests by: - set CLASSPATH=%CLASSPATH%;junit.jar;bcprov.jar - set JAVA_HOME=trunk/deploy/jre - set PATH=%JAVA_HOME%/bin;%PATH% - hack the build.xml to remove the clean-ups - ant tests.run After a few targets going by it trys to run the test, but seems to hang with CPU at 100% and the following output on the console: - snip run: [junit] Running java.security.AccessControlExceptionTest [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.04 sec [junit] Running java.security.AlgorithmParameterGeneratorSpiTests [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.209 sec [junit] Running java.security.AlgorithmParameterGeneratorTest1 -- Tim Ellison ([EMAIL PROTECTED]) IBM Java technology centre, UK.
[jira] Commented: (HARMONY-58) Problems trying to run the security2 test suite
[ http://issues.apache.org/jira/browse/HARMONY-58?page=comments#action_12364809 ] Geir Magnusson Jr commented on HARMONY-58: -- Confusion is my fault, as I am those people that reported all tests pass, because I didn't integrate with the core harmony classlib - I was still testing w/ my sun JRE at that point Problems trying to run the security2 test suite --- Key: HARMONY-58 URL: http://issues.apache.org/jira/browse/HARMONY-58 Project: Harmony Type: Test Components: Classlib Environment: x86, WinXP, repo revision 373866 Reporter: Tim Ellison Attachments: security2ClasslibTestsPatch.txt With a combination of Stepan and Geir's instructions I have: Built the classlib successfully code by: - putting a JDK on the path, unset JAVA_HOME and CLASSPATH - invoke the default target in trunk/make/build.xml - put in the VM Built the security tests successfully by: - cd modules/security2/make - ant tests.run (ignore the run failures) Tried to run the tests by: - set CLASSPATH=%CLASSPATH%;junit.jar;bcprov.jar - set JAVA_HOME=trunk/deploy/jre - set PATH=%JAVA_HOME%/bin;%PATH% - hack the build.xml to remove the clean-ups - ant tests.run After a few targets going by it trys to run the test, but seems to hang with CPU at 100% and the following output on the console: - snip run: [junit] Running java.security.AccessControlExceptionTest [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.04 sec [junit] Running java.security.AlgorithmParameterGeneratorSpiTests [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.209 sec [junit] Running java.security.AlgorithmParameterGeneratorTest1 -- 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
[jira] Assigned: (HARMONY-64) java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if invalid name starts with x-
[ http://issues.apache.org/jira/browse/HARMONY-64?page=all ] Tim Ellison reassigned HARMONY-64: -- Assign To: Tim Ellison java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if invalid name starts with x- - Key: HARMONY-64 URL: http://issues.apache.org/jira/browse/HARMONY-64 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification for Charset forName(String charsetName) the method must throw UnsupportedCharsetException if no support for the named charset is available in this instance of the Java virtual machine. The method does not throw exception if a unsupported name started with x-. For example, the method throws an exception for not supported name xyz, but does not for x-yz. Code to reproduce: import java.nio.charset.*; public class test2 { public static void main (String[] args) { try{ Charset ch=Charset.forName(x-yz); System.out.println(***BAD. UnsupportedCharsetException must be thrown instead of creating +ch); } catch (UnsupportedCharsetException e) { System.out.println(***OK. Expected UnsupportedCharsetException + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK. Expected UnsupportedCharsetException java.nio.charset.UnsupportedCharsetException: x-yz C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***BAD. UnsupportedCharsetException must be thrown instead of creating Charset[x-yz] Suggested junit test case: CharsetTest.java - import java.nio.charset.*; import junit.framework.*; public class CharsetTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(CharsetTest.class); } public void test_forName() { try { Charset ch=Charset.forName(x-yz); fail(Assert 0: UnsupportedCharsetException must be thrown instead of creating: + ch); } catch (UnsupportedCharsetException e) { } } } -- 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
[jira] Updated: (HARMONY-64) java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if valid name starts with x-
[ http://issues.apache.org/jira/browse/HARMONY-64?page=all ] Tim Ellison updated HARMONY-64: --- Summary: java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if valid name starts with x- (was: java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if invalid name starts with x-) java.nio.charset.Charset.forName(String name) does not throw UnsupportedCharsetException if valid name starts with x- --- Key: HARMONY-64 URL: http://issues.apache.org/jira/browse/HARMONY-64 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification for Charset forName(String charsetName) the method must throw UnsupportedCharsetException if no support for the named charset is available in this instance of the Java virtual machine. The method does not throw exception if a unsupported name started with x-. For example, the method throws an exception for not supported name xyz, but does not for x-yz. Code to reproduce: import java.nio.charset.*; public class test2 { public static void main (String[] args) { try{ Charset ch=Charset.forName(x-yz); System.out.println(***BAD. UnsupportedCharsetException must be thrown instead of creating +ch); } catch (UnsupportedCharsetException e) { System.out.println(***OK. Expected UnsupportedCharsetException + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK. Expected UnsupportedCharsetException java.nio.charset.UnsupportedCharsetException: x-yz C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***BAD. UnsupportedCharsetException must be thrown instead of creating Charset[x-yz] Suggested junit test case: CharsetTest.java - import java.nio.charset.*; import junit.framework.*; public class CharsetTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(CharsetTest.class); } public void test_forName() { try { Charset ch=Charset.forName(x-yz); fail(Assert 0: UnsupportedCharsetException must be thrown instead of creating: + ch); } catch (UnsupportedCharsetException e) { } } } -- 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
[jira] Commented: (HARMONY-27) The network related channels in java.nio.channels are not implemented
[ http://issues.apache.org/jira/browse/HARMONY-27?page=comments#action_12364890 ] Tim Ellison commented on HARMONY-27: Thanks for doing this work Richard. I've had a look at your code. The definition of the INetworkSystem is good, and fits in with the file system and memory system we already have. Just a couple of questions: - why do you need to #include stdlib.h in OSNetworkSystem.c ? I removed it and everything compiled ok. - there needs to be a patch to the hynio.def file to export the OSNetworkSystem functions. - as you point out, there needs to be Linux equivalents for these. I won't commit these changes until the above issues are addressed. The network related channels in java.nio.channels are not implemented - Key: HARMONY-27 URL: http://issues.apache.org/jira/browse/HARMONY-27 Project: Harmony Type: Bug Components: Classlib Reporter: Paulex Yang Assignee: Tim Ellison Attachments: FileDescriptorHandler.java, INetworkSystem.java, NetworkSystem.zip, Nio-net Refactoring.jpg, OSNetworkSystem.c, OSNetworkSystem.h, OSNetworkSystem.java, OSNetworkSystemWin32.c, java.net.JPG The following classes defined by Java Spec 5.0 in java.nio.channels are not included in the class library code public abstarct class java.nio.channels.DatagramChannel public abstract class java.nio.channels.ServerSocketChannel public abstract class java.nio.channels.SocketChannel -- 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
[jira] Created: (HARMONY-68) java.nio.charset.Charset.isSupported(String charsetName) does not throw IllegalCharsetNameException for spoiled standard sharset name
java.nio.charset.Charset.isSupported(String charsetName) does not throw IllegalCharsetNameException for spoiled standard sharset name - Key: HARMONY-68 URL: http://issues.apache.org/jira/browse/HARMONY-68 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko According to j2se 1.4.2 specification for Charset.isSupported(String charsetName) the method must throw IllegalCharsetNameException if the given charset name is illegal . Legal charset name must begin with either a letter or a digit. The test listed below shows that there is no the exception if to insert - or _ symbols before standard sharset name, for example -UTF-8 or _US-ASCII. Moreover the method returns true in this case. BEA also does not throw the exception but returns false. Code to reproduce: import java.nio.charset.*; public class test2 { public static void main (String[] args) { // string starts neither a letter nor a digit boolean sup=false; try{ sup=Charset.isSupported(-UTF-8); System.out.println(***BAD. should be exception; sup=+sup); sup=Charset.isSupported(_US-ASCII); System.out.println(***BAD. should be exception; sup=+sup); } catch (IllegalCharsetNameException e) { System.out.println(***OK. Expected IllegalCharsetNameException + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***BAD. should be exception; sup=false ***BAD. should be exception; sup=false C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***BAD. should be exception; sup=true ***BAD. should be exception; sup=true Suggested junit test case: CharserTest.java - import java.nio.charset.*; import junit.framework.*; public class CharsetTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(CharsetTest.class); } public void test_isSupported() { boolean sup=false; // string starts neither a letter nor a digit try{ sup=Charset.isSupported(-UTF-8); fail(***BAD. should be exception IllegalCharsetNameException); } catch (IllegalCharsetNameException e) { //expected } // string starts neither a letter nor a digit try{ sup=Charset.isSupported(_US-ASCII); fail(***BAD. should be exception IllegalCharsetNameException); } catch (IllegalCharsetNameException e) { //expected } } } -- 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
[jira] Created: (HARMONY-69) java.io.RandomAccessFile(String name, String mode) doesn't allow to open a file in a read-only mode
java.io.RandomAccessFile(String name, String mode) doesn't allow to open a file in a read-only mode --- Key: HARMONY-69 URL: http://issues.apache.org/jira/browse/HARMONY-69 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov java.io.RandomAccessFile(String name, String mode) doesn't allow to open a file in a read-only mode. Looks like the mode is always rw. Note, java.io.RandomAccessFile(File file, String mode) works OK. Code to reproduce: import java.io.*; import java.nio.channels.*; public class test29 { private static void testMode(RandomAccessFile raf, int index) { try { FileChannel fcr = raf.getChannel(); // fcr.lock() should throw NonWritableChannelException for r mode fcr.lock(0L, Long.MAX_VALUE, false); fcr.close(); System.out.println(Error + index); } catch (NonWritableChannelException e) { System.out.println(Success + index + : + e); } catch (Throwable e) { System.out.println(Exception + index + : + e); e.printStackTrace(); } } public static void testRandomAccessFile_File_String(File f, int index) { try { System.out.println(Create RAF(File, Sting): + f); RandomAccessFile raf = new RandomAccessFile(f, r); testMode(raf, index); raf.close(); } catch (Throwable e) { System.out.println(Exception + index + : + e); e.printStackTrace(); } } public static void testRandomAccessFile_String_String(String f, int index) { try { System.out.println(Create RAF(File, Sting): + f); RandomAccessFile raf = new RandomAccessFile(f, r); testMode(raf, index); raf.close(); } catch (Throwable e) { System.out.println(Exception + index + : + e); e.printStackTrace(); } } public static void main(String[] args) { try { File f = File.createTempFile(temp, .txt); f.deleteOnExit(); testRandomAccessFile_File_String(f, 1); testRandomAccessFile_String_String(f.getAbsolutePath(), 2); testRandomAccessFile_File_String(f, 3); } catch (Throwable e) { System.out.println(Unexpected exception: + e); e.printStackTrace(); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) Create RAF(File, Sting): C:\DOCUME~1\vivanov1\LOCALS~1\Temp\temp23838.txt Success1: java.nio.channels.NonWritableChannelException Create RAF(File, Sting): C:\DOCUME~1\vivanov1\LOCALS~1\Temp\temp23838.txt Success2: java.nio.channels.NonWritableChannelException Create RAF(File, Sting): C:\DOCUME~1\vivanov1\LOCALS~1\Temp\temp23838.txt Success3: java.nio.channels.NonWritableChannelException C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. Create RAF(File, Sting): C:\DOCUME~1\vivanov1\LOCALS~1\Temp\temp24535.txt Success1: java.nio.channels.NonWritableChannelException Create RAF(File, Sting): C:\DOCUME~1\vivanov1\LOCALS~1\Temp\temp24535.txt Error 2 Create RAF(File, Sting): C:\DOCUME~1\vivanov1\LOCALS~1\Temp\temp24535.txt Success3: java.nio.channels.NonWritableChannelException Suggested fix: Add the string to set up current mode like the string in the RandomAccessFile(File, String) method in the class RandomAccessFile.java sting #122: 122: isReadOnly = mode.equals(r); junit test: RandomAccessFileTest.java - import java.io.*; import java.nio.channels.*; import junit.framework.*; public class RandomAccessFileTest extends TestCase { public void testRandomAccessFile_String_String() { RandomAccessFile raf = null; FileChannel fcr = null; try { File f = File.createTempFile(temp, .txt); f.deleteOnExit(); raf = new RandomAccessFile(f.getAbsolutePath(), r); fcr = raf.getChannel(); fcr.lock(0L, Long.MAX_VALUE, false); fail(NonWritableChannelException expected!); } catch (NonWritableChannelException e) {