[jbosstools-commits] JBoss Tools SVN: r39303 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Mar 6 10:05:16 EST 2012


Author: jpeterka
Date: 2012-03-06 10:05:16 -0500 (Tue, 06 Mar 2012)
New Revision: 39303

Modified:
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java
Log:
ErrorLog bot ext delete method added

Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java	2012-03-06 14:48:49 UTC (rev 39302)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java	2012-03-06 15:05:16 UTC (rev 39303)
@@ -1,6 +1,8 @@
 package org.jboss.tools.ui.bot.ext.view;
 
 import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.jboss.tools.ui.bot.ext.gen.ActionItem;
 import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
@@ -13,6 +15,9 @@
  */
 public class ErrorLogView extends ViewBase {
 
+	/**
+	 * logs all error log messages into a logger
+	 */
 	public void logMessages() {
 		SWTBotTreeItem[] items = getView().bot().tree().getAllItems();
 		for (SWTBotTreeItem i : items)
@@ -29,16 +34,38 @@
 		log.info(item.getText());
 	}
 
+	/**
+	 * clear error log (temporarily)
+	 */
 	public void clear() {
 		ContextMenuHelper.clickContextMenu(getView().bot().tree(),
 				"Clear Log Viewer");
+		
+		log.info("Error log cleared");
 	}
+	
+	/**
+	 * deletes error log permanently
+	 */
+	public void delete() {
+		ContextMenuHelper.clickContextMenu(getView().bot().tree(),
+				"Delete Log");
+		
+		SWTBotShell shell = bot.shell("Confirm Delete").activate();
+		shell.bot().button("OK").click();
+		bot.waitUntil(Conditions.shellCloses(shell));
+		log.info("Error log content deleted");		
+	}
 
 	private SWTBotView getView() {
 		SWTBotView view = open.viewOpen(ActionItem.View.GeneralErrorLog.LABEL);
 		return view;
 	}
 
+	/**
+	 * 
+	 * @return all item count in the error log tree
+	 */
 	public int getRecordCount() {
 		int count = getView().bot().tree().getAllItems().length;
 		return count;



More information about the jbosstools-commits mailing list