X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tmf%2Forg.eclipse.tracecompass.tmf.ui.swtbot.tests%2Fsrc%2Forg%2Feclipse%2Ftracecompass%2Ftmf%2Fui%2Fswtbot%2Ftests%2Fviewers%2Fevents%2FColumnHeaderMenuTest.java;h=1972d2398058b3b2d34b669fb38b7ef7b78dcb18;hb=1dfcd42b04b94bc6965905654723e02e85dfb2dc;hp=fa2ee74de694851a2821a4625283929297c612cc;hpb=5785ab49cfe1e9e1d200316e95c0c5b4096c9ad9;p=deliverable%2Ftracecompass.git 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..1972d23980 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 @@ -128,6 +128,7 @@ public class ColumnHeaderMenuTest { @After public void after() { fBot.closeAllEditors(); + SWTBotUtils.closeSecondaryShells(fBot); } /** @@ -155,7 +156,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 +177,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 +217,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" });