Skip to content

Commit

Permalink
remove extra logs added for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Dec 21, 2023
1 parent 1f277e5 commit 33c0b29
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
5 changes: 0 additions & 5 deletions src/studio/ui/QGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public void stateChanged(ChangeEvent ev) {
private long lastTimestamp = -1;

public void mousePressed(MouseEvent e) {
log.info("mousePressed: popupTrigger: {}", e.isPopupTrigger());
if (maybeShowPopup(e)) return;

int row = table.rowAtPoint(e.getPoint());
Expand All @@ -207,7 +206,6 @@ else if (row == lastRow && col == lastCol &&
}

public void mouseReleased(MouseEvent e) {
log.info("mouseReleased: popupTrigger: {}", e.isPopupTrigger());
maybeShowPopup(e);
}

Expand Down Expand Up @@ -318,12 +316,9 @@ private JPopupMenu getPopupMenu(Point point) {
int col = table.columnAtPoint(point);
if (row == -1 || col == -1) return popupMenu;

log.info("getPopupMenu: row={}; col={}", row, col);
row = table.convertRowIndexToModel(row);
col = table.convertColumnIndexToModel(col);

log.info("getPopupMenu - after conversion: row={}; col={}", row, col);

String[] connections = Config.getInstance().getTableConnExtractor().getConnections(table.getModel(), row, col);
if (connections.length == 0) return popupMenu;

Expand Down
2 changes: 0 additions & 2 deletions src/studio/ui/WidthAdjuster.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ 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
20 changes: 0 additions & 20 deletions test-integration/studio/ui/ResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.assertj.swing.core.KeyPressInfo;
import org.assertj.swing.data.TableCell;
import org.assertj.swing.fixture.*;
import org.assertj.swing.hierarchy.SingleComponentHierarchy;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
Expand All @@ -14,12 +12,8 @@
import studio.kdb.MockQSession;

import java.awt.*;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Arrays;

import static java.awt.event.KeyEvent.VK_ESCAPE;

public class ResultTest extends StudioTest {

private static final Logger log = LogManager.getLogger();
Expand Down Expand Up @@ -90,13 +84,6 @@ public void testMarkersAfterSorting() {
Assert.assertEquals(bgAfter, table.backgroundAt(TableCell.row(5).column(0)).target());
}

private void logHierarchy(String str) {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(outStream);
robot().printer().printComponents(out);
log.info("Hierarchy [{}]:%n{}", str, outStream);
}

@Test
public void testTableConnExtractor() {
MockQSession.setResponse(
Expand All @@ -108,15 +95,8 @@ public void testTableConnExtractor() {

execute();
JTableFixture table = frameFixture.panel("resultPanel0").table();
logHierarchy("Before first popup menu");
// JPopupMenuFixture popupMenu = table.showPopupMenuAt(TableCell.row(1).column(0));
logHierarchy("After first popup menu");
// String[] labels = popupMenu.menuLabels();
// Assert.assertEquals("Open z:2", labels[0]);

table.tableHeader().clickColumn(0).click();
JPopupMenuFixture popupMenu = table.showPopupMenuAt(TableCell.row(1).column(0));
logHierarchy("After second popup menu");
String[] labels = popupMenu.menuLabels();
log.info("Got the following menu items {}", Arrays.toString(labels));
Assert.assertEquals("Open b:3", labels[0]);
Expand Down

0 comments on commit 33c0b29

Please sign in to comment.