All,
I am using a JUnit GUI testing framework called WindowTester to auto test my GUIs. When I ran my auto gui test cases using ant, they seemed to work fine. However, when I ran my auto gui test cases using gradle, I kept getting this error “not in AWT thread”.
Does anyone know how to configure/force the auto gui tests using WindowTester running in AWT thread?
Thanks in advance!
Below is the assetion error I got every time I ran the auto gui tests:
java.lang.AssertionError: Not in AWT thread
at com.abc.ui.DataList.getSelectedItems(DataList.java:787)
at com.abc.ui.ListControl.refilter(ListControl.java:151)
at com.abc.ui.ListControl.access$600(ListControl.java:40)
at com.abc.ui.ListControl$SelectedEmitterListener.valueChanged(ListControl.java:252)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194)
at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:388)
at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:398)
at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:442)
at com.abc.ui.SpaceList$SpaceListSelectionModel.setSelectionInterval(SpaceList.java:274)
at javax.swing.JTable.setRowSelectionInterval(JTable.java:2129)
at com.abc.windowtester.util.JTableHelper.setRowSelectionInterval(JTableHelper.java:13)
at com.abc.windowtester.util.HighPerfUITestCaseSwing.setRowSelectionInterval(HighPerfUITestCaseSwing.java:161)
at com.abc.windowtester.TrainPopupMenuItemsStatusAutoTest.testTrainPopupMenuItemsStatus(TrainPopupMenuItemsStatusAutoTest.java:71)
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 junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.windowtester.runtime.common.UITestCaseCommon.access$0(UITestCaseCommon.java:1)
at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:130)
at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:151)
at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:40)