Skip to content

Commit d630dc4

Browse files
committed
Reactivate TableTest.test_TableColumn
This test was seemingly disabled by accident.
1 parent ccda5c8 commit d630dc4

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

  • org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/widgets

org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/widgets/TableTest.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.eclipse.swt.widgets.TableColumn;
3333
import org.eclipse.swt.widgets.TableItem;
3434

35-
import org.junit.jupiter.api.Disabled;
3635
import org.junit.jupiter.api.Test;
3736

3837
import java.util.List;
@@ -183,8 +182,6 @@ public Test() {
183182
* In SWT Cocoa and Linux GTK, the column headers are excluded from the client
184183
* area, hence why we have to adjust them for the tests.
185184
*/
186-
// Disabled because of https://github.com/eclipse-windowbuilder/windowbuilder/issues/389
187-
@Disabled
188185
@Test
189186
public void test_TableColumn() throws Exception {
190187
CompositeInfo shell = parseComposite("""
@@ -203,7 +200,9 @@ public Test() {
203200
}
204201
}
205202
}""");
203+
waitEventLoop(0);
206204
shell.refresh();
205+
waitEventLoop(0);
207206
TableInfo table = (TableInfo) shell.getChildrenControls().get(0);
208207
// prepare columns
209208
List<TableColumnInfo> columns = table.getColumns();
@@ -213,20 +212,24 @@ public Test() {
213212
// check bounds
214213
Insets tableInsets = table.getClientAreaInsets();
215214
{
215+
int headerHeight = table.getWidget().getHeaderHeight();
216216
// "model" bounds
217217
Rectangle modelBounds = column_1.getModelBounds();
218+
System.out.println("###############################");
219+
System.out.println(column_1.getWidget().getWidth());
220+
System.out.println(column_1.getModelBounds());
218221
if (!EnvironmentUtils.IS_WINDOWS) {
219-
modelBounds.y += table.getWidget().getHeaderHeight();
222+
modelBounds.y += headerHeight;
220223
}
221224
assertNotNull(modelBounds);
222225
assertEquals(0, modelBounds.x);
223226
assertEquals(0, modelBounds.y);
224227
assertEquals(50, modelBounds.width);
225-
assertTrue(modelBounds.height > 15 && modelBounds.height < 50);
228+
assertEquals(headerHeight, modelBounds.height);
226229
// "shot" bounds
227230
Rectangle bounds = column_1.getBounds();
228231
if (!EnvironmentUtils.IS_WINDOWS) {
229-
bounds.y += table.getWidget().getHeaderHeight();
232+
bounds.y += headerHeight;
230233
}
231234
assertEquals(tableInsets.left, bounds.x);
232235
assertEquals(tableInsets.top, bounds.y);

0 commit comments

Comments
 (0)