harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Pavlenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2441) [classlib][awt] java.awt.dnd.DragSource.getListeners() does not throw ClassCastException or IAE
Date Wed, 13 Dec 2006 16:21:22 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2441?page=comments#action_12458176 ] 
            
Andrey Pavlenko commented on HARMONY-2441:
------------------------------------------

The above example is not compatible with code source 1.5. According to the 1.5 specification
the listenerType argument have to be of type Class<T extends EventListener>.

> [classlib][awt] java.awt.dnd.DragSource.getListeners() does not throw ClassCastException
or IAE
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2441
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2441
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>            Priority: Minor
>
> Test case:
> --------------
> import java.awt.dnd.DragSource;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         DragSource ds = new DragSource();
>         try {
>             ds.getListeners(Class.class);
>             fail("ClassCastException expected");
>         } catch (ClassCastException e) {
>         }
>     }         
>     
>     public void testcase2() {                                           
>         DragSource ds = new DragSource();
>         try {
>             ds.getListeners(Void.TYPE);
>             fail("IllegalArgumentException expected");
>         } catch (IllegalArgumentException e) {
>         }
>     }         
> }
> RI output:
> ----------------
> ..
> Time: 1,811
> OK (2 tests)
> Harmony output:
> -----------------
> .F.F
> Time: 0.59
> There were 2 failures:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError: ClassCastException expected
> 	at TheTest.testcase1(TheTest.java:15)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:8)
> 2) testcase2(TheTest)junit.framework.AssertionFailedError: IllegalArgumentException expected
> 	at TheTest.testcase2(TheTest.java:24)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:8)
> FAILURES!!!
> Tests run: 2,  Failures: 2,  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