Author: vpakan(a)redhat.com
Date: 2011-07-29 08:18:04 -0400 (Fri, 29 Jul 2011)
New Revision: 33350
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/MarkersTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added test for Markers
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-07-29
10:23:27 UTC (rev 33349)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-07-29
12:18:04 UTC (rev 33350)
@@ -78,6 +78,7 @@
import org.jboss.tools.vpe.ui.bot.test.smoke.CodeCompletionTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.EditorSynchronizationTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.JSPPageCreationTest;
+import org.jboss.tools.vpe.ui.bot.test.smoke.MarkersTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.OpenOnTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.RenameFacesConfigFileTest;
import org.jboss.tools.vpe.ui.bot.test.smoke.RenameJSPFileTest;
@@ -174,6 +175,7 @@
suite.addTestSuite(LogTagTest.class);
suite.addTestSuite(OpenOnTest.class);
suite.addTestSuite(XhtmlFilePerformanceTest.class);
+ suite.addTestSuite(MarkersTest.class);
return new TestSetup(suite);
}
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/MarkersTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/MarkersTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/MarkersTest.java 2011-07-29
12:18:04 UTC (rev 33350)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.smoke;
+
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.MarkerHelper;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
+/**
+ * Test Markers position and attributes regarding to VPE components within jsp page
+ * @author Vladimir Pakan
+ *
+ */
+public class MarkersTest extends VPEEditorTestCase{
+ private SWTBotEditorExt editor;
+ private String originalEditorText;
+ /**
+ * Test open on functionality of JSF components within jsp page
+ */
+ public void testMarkers(){
+ MarkerHelper markerHelper = new MarkerHelper(TEST_PAGE,
+ VPEAutoTestCase.JBT_TEST_PROJECT_NAME,"WebContent","pages");
+ String textToSelect = "<%@ taglib";
+ String insertText = "yyaddedxx";
+ int[] expectedMarkerLines = new int[4];
+ String[] expectedMarkerDesc = new String[4];
+ SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
+ TEST_PAGE,
+ textToSelect,
+ textToSelect.length(),
+ 0,
+ 0);
+ editor.insertText(insertText);
+ expectedMarkerLines[0] = editor.cursorPosition().line;
+ expectedMarkerDesc[0] = "^Unknown tag \\(jsp:directive\\.taglib" +
insertText + "\\).*";
+ textToSelect = "<%@ taglib
uri=\"http://java.sun.com/jsf/html";
+ SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
+ TEST_PAGE,
+ textToSelect,
+ textToSelect.length(),
+ 0,
+ 0);
+ editor.insertText(insertText);
+ expectedMarkerLines[1] = editor.cursorPosition().line;
+ expectedMarkerDesc[1] = "^Can not find the tag library descriptor for
\"http://java.sun.com/jsf/html" +
+ insertText +".*";
+ textToSelect = "<h1";
+ SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
+ TEST_PAGE,
+ textToSelect,
+ textToSelect.length(),
+ 0,
+ 0);
+ editor.insertText(insertText);
+ expectedMarkerLines[2] = editor.cursorPosition().line;
+ expectedMarkerDesc[2] = "^Unknown tag \\(h1" + insertText +
"\\).*";
+ textToSelect = "</h:inputText";
+ SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
+ TEST_PAGE,
+ textToSelect,
+ textToSelect.length(),
+ 0,
+ 0);
+ editor.insertText(insertText);
+ expectedMarkerLines[3] = editor.cursorPosition().line;
+ expectedMarkerDesc[3] = "^Missing start tag for \"h:inputText" +
insertText + ".*";
+ editor.save();
+ bot.sleep(Timing.time2S());
+ // Check markers
+ for (int index = 0 ; index < expectedMarkerLines.length ; index++){
+ markerHelper.checkForMarker(String.valueOf(expectedMarkerLines[index] + 1),
+ expectedMarkerDesc[index]);
+ }
+ }
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ openPage(TEST_PAGE);
+ editor = SWTTestExt.bot.swtBotEditorExtByTitle(TEST_PAGE);
+ originalEditorText = editor.getText();
+ }
+ @Override
+ protected void tearDown() throws Exception {
+ if (editor != null){
+ editor.setText(originalEditorText);
+ editor.saveAndClose();
+ }
+ super.tearDown();
+ }
+}
\ No newline at end of file
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/smoke/MarkersTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain