harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Dolgov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2465) [classlib][awt] java.awt.Component.processEvent(null) throws NPE while RI does not
Date Tue, 05 Dec 2006 13:57:26 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2465?page=all ]

Pavel Dolgov updated HARMONY-2465:
----------------------------------

    Description: 
Test case:
----------------
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.MenuItem;

import junit.framework.TestCase;

public class TheTest extends TestCase {

    public static void main(String args[]) {
        junit.textui.TestRunner.run(TheTest.class);
    }

    public void testcase1() {
        TestMenuItem mi = new TestMenuItem();
        mi.processEvent((AWTEvent) null);
    }

    public void testcase2() {
        TestComponent c = new TestComponent();
        c.processEvent((AWTEvent) null);
    }

    public void testcase3() {
        TestComponent c = new TestComponent();
        TestEvent e = new TestEvent(c, 2000);
        c.processEvent(e);
    }

    static class TestMenuItem extends MenuItem {
        TestMenuItem() {
            super();
        }

        public void processEvent(AWTEvent e) {
            super.processEvent(e);
        }
    }

    static class TestComponent extends Component {
        TestComponent() {
            super();
        }

        public void processEvent(AWTEvent e) {
            super.processEvent(e);
        }
    }

    class TestEvent extends AWTEvent {
        public TestEvent(Object source, int id) {
            super(source, id);
        }
    }
}

RI output:
--------------
...
Time: 0,111

OK (3 tests)


Harmony output:
--------------
.E.E.E
Time: 0.581
There were 3 errors:
1) testcase1(TheTest)java.lang.NullPointerException
	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
	at java.awt.MenuItem.processEvent(MenuItem.java:367)
	at TheTest$TestMenuItem.processEvent(TheTest.java)
	at TheTest.testcase1(TheTest.java:15)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:11)
2) testcase2(TheTest)java.lang.NullPointerException
	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
	at java.awt.Component.processEvent(Component.java:3630)
	at TheTest$TestComponent.processEvent(TheTest.java)
	at TheTest.testcase2(TheTest.java:20)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:11)
3) testcase3(TheTest)java.lang.NullPointerException
	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
	at java.awt.Component.processEvent(Component.java:3630)
	at TheTest$TestComponent.processEvent(TheTest.java)
	at TheTest.testcase3(TheTest.java:26)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:11)

FAILURES!!!
Tests run: 3,  Failures: 0,  Errors: 3



  was:
Test case:
----------------
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.MenuItem;

import junit.framework.TestCase;

public class TheTest extends TestCase {

    public static void main(String args[]) {
        junit.textui.TestRunner.run(TheTest.class);
    }

    public void testcase1() {
        TestMenuItem mi = new TestMenuItem();
        mi.processEvent((AWTEvent) null);
    }

    public void testcase2() {
        TestComponent c = new TestComponent();
        c.processEvent((AWTEvent) null);
    }     


    static class TestMenuItem extends MenuItem {
        TestMenuItem() {
            super();
        }

        public void processEvent(AWTEvent e) {
            super.processEvent(e);
        }
    }

    static class TestComponent extends Component {
        TestComponent() {
            super();
        }

        public void processEvent(AWTEvent e) {
            super.processEvent(e);
        }
    }
}

RI output:
--------------
..
Time: 0,131

OK (2 tests)


Harmony output:
--------------
.E.E
Time: 0.641
There were 2 errors:
1) testcase1(TheTest)java.lang.NullPointerException
	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
	at java.awt.MenuItem.processEvent(MenuItem.java:367)
	at TheTest$TestMenuItem.processEvent(TheTest.java)
	at TheTest.testcase1(TheTest.java:14)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:10)
2) testcase2(TheTest)java.lang.NullPointerException
	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
	at java.awt.Component.processEvent(Component.java:3630)
	at TheTest$TestComponent.processEvent(TheTest.java)
	at TheTest.testcase2(TheTest.java:19)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:10)

FAILURES!!!
Tests run: 2,  Failures: 0,  Errors: 2




> [classlib][awt] java.awt.Component.processEvent(null) throws NPE while RI does not
> ----------------------------------------------------------------------------------
>
>                 Key: HARMONY-2465
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2465
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>            Priority: Minor
>
> Test case:
> ----------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.MenuItem;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         TestMenuItem mi = new TestMenuItem();
>         mi.processEvent((AWTEvent) null);
>     }
>     public void testcase2() {
>         TestComponent c = new TestComponent();
>         c.processEvent((AWTEvent) null);
>     }
>     public void testcase3() {
>         TestComponent c = new TestComponent();
>         TestEvent e = new TestEvent(c, 2000);
>         c.processEvent(e);
>     }
>     static class TestMenuItem extends MenuItem {
>         TestMenuItem() {
>             super();
>         }
>         public void processEvent(AWTEvent e) {
>             super.processEvent(e);
>         }
>     }
>     static class TestComponent extends Component {
>         TestComponent() {
>             super();
>         }
>         public void processEvent(AWTEvent e) {
>             super.processEvent(e);
>         }
>     }
>     class TestEvent extends AWTEvent {
>         public TestEvent(Object source, int id) {
>             super(source, id);
>         }
>     }
> }
> RI output:
> --------------
> ...
> Time: 0,111
> OK (3 tests)
> Harmony output:
> --------------
> .E.E.E
> Time: 0.581
> There were 3 errors:
> 1) testcase1(TheTest)java.lang.NullPointerException
> 	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
> 	at java.awt.MenuItem.processEvent(MenuItem.java:367)
> 	at TheTest$TestMenuItem.processEvent(TheTest.java)
> 	at TheTest.testcase1(TheTest.java:15)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> 2) testcase2(TheTest)java.lang.NullPointerException
> 	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
> 	at java.awt.Component.processEvent(Component.java:3630)
> 	at TheTest$TestComponent.processEvent(TheTest.java)
> 	at TheTest.testcase2(TheTest.java:20)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> 3) testcase3(TheTest)java.lang.NullPointerException
> 	at java.awt.AWTEvent$EventTypeLookup.getEventMask(AWTEvent.java)
> 	at java.awt.Component.processEvent(Component.java:3630)
> 	at TheTest$TestComponent.processEvent(TheTest.java)
> 	at TheTest.testcase3(TheTest.java:26)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:11)
> FAILURES!!!
> Tests run: 3,  Failures: 0,  Errors: 3

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