google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

DOCUMENT.getBody() throws a NullPointerException in a simple GwtTest test case. #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a GwtTest test case.
2. Instantiate any GWT class, i.e.: Button button = new Button("Click me!");
3. Not sure when exactly it happens, but what we're looking for is a test case 
such that the public static DOCUMENT instance isn't null whilst its member 
DOCUMENT.getBody() returns null. The above example with a Button instance 
produces such a case.

What is the expected output? What do you see instead?
The unit test should go through as it basically doesn't really do anything 
(apart from instantiating a GWT class.)
However, some NullPointerException gets thrown when the test case is torn down.

What version of the product are you using? On what operating system?
Rev. 725 / latest 0.28 SNAPSHOT.

Patch (attached):
To check whether DOCUMENT.getBody() is null before invoking further methods on 
it. See DocumentPatcher.reset():

    if(DOCUMENT.getBody() != null) {
        JavaScriptObjects.getJsoProperties(DOCUMENT.getBody()).clear();
    }

Original issue reported on code.google.com by dinde...@googlemail.com on 18 Apr 2011 at 4:26

Attachments:

GoogleCodeExporter commented 9 years ago
The fix of the reset() method has been reported, thank you very much for the 
report !

Original comment by gael.laz...@gmail.com on 18 Apr 2011 at 5:09