From: Matthew Khouzam Date: Wed, 20 Jul 2016 15:06:54 +0000 (-0400) Subject: tmf.ui: add test for persisting column hiding. X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=d056d9a913d7cbc585e1543e69a04c2bf26a5828;p=deliverable%2Ftracecompass.git tmf.ui: add test for persisting column hiding. This tests that hiding a column is preserved from one open to the next. Change-Id: I22aded548ccc5c8841acae0eb175182145096c05 Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/77611 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse Tested-by: Patrick Tasse --- diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ColumnHeaderMenuTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ColumnHeaderMenuTest.java index fa2ee74de6..c2aceccc30 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ColumnHeaderMenuTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ColumnHeaderMenuTest.java @@ -155,7 +155,7 @@ public class ColumnHeaderMenuTest { assertVisibleColumns(tableBot.widget, new String[] { "Timestamp" }); headerBot.contextMenu("Timestamp").click(); - assertVisibleColumns(tableBot.widget, new String[] { }); + assertVisibleColumns(tableBot.widget, new String[] {}); headerBot.contextMenu("Message").click(); assertVisibleColumns(tableBot.widget, new String[] { "Message" }); @@ -176,6 +176,31 @@ public class ColumnHeaderMenuTest { assertVisibleColumns(tableBot.widget, new String[] { "Timestamp", "Host", "Logger", "File", "Line", "Message" }); } + /** + * Test the Show All menu item + */ + @Test + public void testPersistHiding() { + SWTBotTable tableBot = fEditorBot.bot().table(); + SWTBotTableColumn headerBot = tableBot.header(""); + assertVisibleColumns(tableBot.widget, new String[] { "Timestamp", "Host", "Logger", "File", "Line", "Message" }); + + headerBot.contextMenu("Timestamp").click(); + headerBot.contextMenu("Host").click(); + headerBot.contextMenu("Logger").click(); + headerBot.contextMenu("File").click(); + headerBot.contextMenu("Message").click(); + assertVisibleColumns(tableBot.widget, new String[] { "Line" }); + after(); + + before(); + tableBot = fEditorBot.bot().table(); + assertVisibleColumns(tableBot.widget, new String[] { "Line" }); + headerBot = tableBot.header(""); + headerBot.contextMenu("Show All").click(); + assertVisibleColumns(tableBot.widget, new String[] { "Timestamp", "Host", "Logger", "File", "Line", "Message" }); + } + /** * Test the Show All menu item */ @@ -191,7 +216,7 @@ public class ColumnHeaderMenuTest { headerBot.contextMenu("File").click(); headerBot.contextMenu("Line").click(); headerBot.contextMenu("Message").click(); - assertVisibleColumns(tableBot.widget, new String[] { }); + assertVisibleColumns(tableBot.widget, new String[] {}); headerBot.contextMenu("Show All").click(); assertVisibleColumns(tableBot.widget, new String[] { "Timestamp", "Host", "Logger", "File", "Line", "Message" });