google-code-export / gwt-test-utils

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

IndexOutOfBoundsException is thrown when setting horizontal alignment of cell #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create class that owns UiBinder.
2. In xml for UiBinder add a Grid widget and multiple rows in said Grid.
3. In constructor for owner class, call:
this.initWidget(uiBinder.createAndBindUi(this));    this.grid.getCellFormatter().se
tHorizontalAlignment(0, 2,HasHorizontalAlignment.ALIGN_RIGHT);

What is the expected output? What do you see instead?
Owner class should be constructed, and tests should be possible on owner class, 
including Grid widget. 

When doing so the following exception is thrown:
java.lang.IndexOutOfBoundsException: Row index: 0, Row size: 0
    at com.google.gwt.user.client.ui.Grid.prepareRow(Grid.java:339)
    at com.google.gwt.user.client.ui.Grid.prepareCell(Grid.java:288)
    at com.google.gwt.user.client.ui.HTMLTable$CellFormatter.setHorizontalAlignment(HTMLTable.java:239)
    at com.example.client.view.gwt.BuggedViewGwt.<init>(BuggedViewGwt.java:26)
    at com.example.client.view.gwt.GwtTestBuggedViewGwt.init(GwtTestBuggedViewGwt.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at com.octo.gwt.test.internal.runner.AbstractGwtRunner.run(AbstractGwtRunner.java:40)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

What version of the product are you using? On what operating system?
GWT 2.4 with gwt-test-utils-0.35. 

Please provide any additional information below.
Attached is sample eclipse project. Please execute GwtTestBuggedViewGwt.java.

Original issue reported on code.google.com by theamper...@gmail.com on 17 Feb 2012 at 7:54

Attachments:

GoogleCodeExporter commented 9 years ago
I'm not sure if there's an easy workaround for this, but it works if you 
implement the test case by extending google's GWTTestCase class. I've uploaded 
an updated project with an added GWTTestCase to demonstrate.

Original comment by theamper...@gmail.com on 17 Feb 2012 at 8:03

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 17 Feb 2012 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 16 Mar 2012 at 2:14

GoogleCodeExporter commented 9 years ago
I just deployed new snapshots with a fix for this issue (0.36-SNAPSHOT, 
0.33.2-SNAPSHOT, 0.28.9-SNAPHOT, 0.25.6-SNAPSHOT and 0.22.6-SNAPSHOT).

Could you please give one of those versions a try and give me some feedback so 
I could close this issue ?
Thank you very much ! 

Original comment by gael.laz...@gmail.com on 18 Mar 2012 at 12:32

GoogleCodeExporter commented 9 years ago
Sorry for the delay of feedback, but this does indeed the issue we were having 
with our project.

Thanks!!

Original comment by theamper...@gmail.com on 6 Jun 2012 at 7:55