Skip to content

Commit

Permalink
add more logging for test issue debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Dec 21, 2023
1 parent c4fd4ed commit 24d352f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/studio/ui/WidthAdjuster.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package studio.ui;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import studio.kdb.Config;
import studio.kdb.KTableModel;

Expand All @@ -24,6 +26,8 @@ public class WidthAdjuster extends MouseAdapter {
private static final int EPSILON = 5; //boundary sensitivity
private final boolean[] limitWidthState;

private static final Logger log = LogManager.getLogger();

public WidthAdjuster(JTable table, JScrollPane scrollPane) {
this.table = table;
this.scrollPane = scrollPane;
Expand Down Expand Up @@ -69,7 +73,9 @@ public void mouseClicked(final MouseEvent e) {
int column = getModelColumn(e);
if (column >= 0) {
KTableModel ktm = (KTableModel) table.getModel();
log.info("Table sorting start");
ktm.sort(column);
log.info("Table sorting finished");
scrollPane.repaint();
}
}
Expand Down
6 changes: 6 additions & 0 deletions test-integration/studio/ui/ResultTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package studio.ui;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.assertj.swing.data.TableCell;
import org.assertj.swing.fixture.*;
import org.junit.Assert;
Expand All @@ -10,9 +12,12 @@
import studio.kdb.MockQSession;

import java.awt.*;
import java.util.Arrays;

public class ResultTest extends StudioTest {

private static final Logger log = LogManager.getLogger();

@BeforeClass
public static void mock() {
MockQSession.mock();
Expand Down Expand Up @@ -97,6 +102,7 @@ public void testTableConnExtractor() {
table.tableHeader().clickColumn(0).click();
popupMenu = table.showPopupMenuAt(TableCell.row(1).column(0));
labels = popupMenu.menuLabels();
log.info("Got the following menu items {}", Arrays.toString(labels));
Assert.assertEquals("Open b:3", labels[0]);

Check failure on line 106 in test-integration/studio/ui/ResultTest.java

View workflow job for this annotation

GitHub Actions / JUnit Tests

studio.ui.ResultTest ► testTableConnExtractor

Failed test found in: build/test-results/integrationTest/TEST-studio.ui.ResultTest.xml Error: org.junit.ComparisonFailure: expected:<Open [b:3]> but was:<Open [z:2]>
Raw output
org.junit.ComparisonFailure: expected:<Open [b:3]> but was:<Open [z:2]>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at studio.ui.ResultTest.testTableConnExtractor(ResultTest.java:106)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.assertj.swing.junit.runner.MethodInvoker.evaluate(MethodInvoker.java:44)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

}
Expand Down

0 comments on commit 24d352f

Please sign in to comment.