Author: vpakan(a)redhat.com
Date: 2011-04-11 13:53:17 -0400 (Mon, 11 Apr 2011)
New Revision: 30485
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AjaxInvisibleTagsTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandLinkTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/HtmlCommandLinkTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/IncludeTagTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added Ajax Tags Tests
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-04-11
17:42:16 UTC (rev 30484)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-04-11
17:53:17 UTC (rev 30485)
@@ -34,6 +34,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.preferences.ShowSelectionTagBarTest;
import org.jboss.tools.vpe.ui.bot.test.editor.selectionbar.SelectionBarTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ActionParamTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.AjaxInvisibleTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.AjaxValidatorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.BeanValidatorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CalendarTagTest;
@@ -42,6 +43,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ColumnsTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ComboBoxTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CommandButtonTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.CommandLinkTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CoreHTMLTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataDefinitionTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataGridTagTest;
@@ -52,6 +54,8 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.EditorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ExtendedDataTableTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.FileUploadTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.HtmlCommandLinkTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.IncludeTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.InplaceInputTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.InplaceSelectInputTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.JSFTagsTest;
@@ -159,6 +163,10 @@
suite.addTestSuite(ToolbarAndToolbarGroupTagTest.class);
suite.addTestSuite(TogglePanelAndToogleControlTagTest.class);
suite.addTestSuite(CommandButtonTagTest.class);
+ suite.addTestSuite(CommandLinkTagTest.class);
+ suite.addTestSuite(HtmlCommandLinkTagTest.class);
+ suite.addTestSuite(IncludeTagTest.class);
+ suite.addTestSuite(AjaxInvisibleTagsTest.class);
suite.addTestSuite(XhtmlFilePerformanceTest.class);
return new TestSetup(suite);
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AjaxInvisibleTagsTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AjaxInvisibleTagsTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AjaxInvisibleTagsTest.java 2011-04-11
17:53:17 UTC (rev 30485)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+/**
+ * Tests ajax invisible tags behavior
+ * @author vlado pakan
+ *
+ */
+public class AjaxInvisibleTagsTest extends AbstractTagTest{
+ private static final String QUEUE_VALUE = "*! Queue Value";
+ private static final String JS_FUNCTION_VALUE = "*! JsFunction Value";
+ private static final String KEEP_ALIVE_VALUE = "*! KeepAlive Value";
+ private static final String SUPPORT_VALUE = "*! Support Value";
+ private static final String STATUS_VALUE = "*! Status Value";
+ @Override
+ protected void initPageContent() {
+ jspEditor.setText("<%@ taglib
uri=\"http://java.sun.com/jsf/html\"
prefix=\"h\" %>\n" +
+ "<%@ taglib
uri=\"http://java.sun.com/jsf/core\"
prefix=\"f\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/a4j\"
prefix=\"a4j\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/rich\"
prefix=\"rich\" %>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <a4j:jsFunction>" + AjaxInvisibleTagsTest.JS_FUNCTION_VALUE +
"</a4j:jsFunction>\n" +
+ " <a4j:queue>" + AjaxInvisibleTagsTest.QUEUE_VALUE +
"</a4j:queue>\n" +
+ " <a4j:keepAlive beanName=\"\">" +
AjaxInvisibleTagsTest.KEEP_ALIVE_VALUE + "</a4j:keepAlive>\n" +
+ " <a4j:support>" + AjaxInvisibleTagsTest.SUPPORT_VALUE +
"</a4j:support>\n" +
+ " <a4j:status>" + AjaxInvisibleTagsTest.STATUS_VALUE +
"</a4j:status>\n" +
+ " </f:view>\n" +
+ " </body> \n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // check values which should not be displayed in Visual Editor
+ assertVisualEditorNotContainNodeWithValue(jspWebBrowser,
+ AjaxInvisibleTagsTest.JS_FUNCTION_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorNotContainNodeWithValue(jspWebBrowser,
+ AjaxInvisibleTagsTest.QUEUE_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorNotContainNodeWithValue(jspWebBrowser,
+ AjaxInvisibleTagsTest.KEEP_ALIVE_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorNotContainNodeWithValue(jspWebBrowser,
+ AjaxInvisibleTagsTest.SUPPORT_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorNotContainNodeWithValue(jspWebBrowser,
+ AjaxInvisibleTagsTest.STATUS_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ // check empty Visual Editor
+ assertVisualEditorContainsManyNodes(jspWebBrowser,
+ "TABLE",
+ 1,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContainsManyNodes(jspWebBrowser,
+ "TR",
+ 1,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContainsManyNodes(jspWebBrowser,
+ "TD",
+ 1,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContainsManyNodes(jspWebBrowser,
+ "DIV",
+ 4,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AjaxInvisibleTagsTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandLinkTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandLinkTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandLinkTagTest.java 2011-04-11
17:53:17 UTC (rev 30485)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+
+/**
+ * Tests ajax command link Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class CommandLinkTagTest extends AbstractTagTest{
+ private static final String LINK_VALUE = "*! Link Value";
+ @Override
+ protected void initPageContent() {
+ jspEditor.setText("<%@ taglib
uri=\"http://java.sun.com/jsf/html\"
prefix=\"h\" %>\n" +
+ "<%@ taglib
uri=\"http://java.sun.com/jsf/core\"
prefix=\"f\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/a4j\"
prefix=\"a4j\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/rich\"
prefix=\"rich\" %>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <a4j:commandLink>\n" +
+ " " + CommandLinkTagTest.LINK_VALUE + "\n" +
+ " <a4j:commandButton type=\"Submit\">\n" +
+ " </a4j:commandButton>\n" +
+ " </a4j:commandLink>\n" +
+ " </f:view>\n" +
+ " </body> \n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContains(jspWebBrowser,
+ "INPUT",
+ new String[]{"type"},
+ new String[]{"Submit"},
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContains(jspWebBrowser,
+ "A",
+ null,
+ null,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContainsNodeWithValue(jspWebBrowser,
+ CommandLinkTagTest.LINK_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ // check tag selection
+ jspWebBrowser.selectDomNode(jspWebBrowser.getDomNodeByTagName("A",0), 0);
+ bot.sleep(Timing.time3S());
+ String selectedText = jspEditor.getSelection();
+ String hasToStartWith = "<a4j:commandLink";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasEndWith = "</a4j:commandLink>";
+ assertTrue("Selected text in Source Pane has to end with '" +
hasEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasEndWith));
+ String hasToContain = "<a4j:commandButton
type=\"Submit\">";
+ assertTrue("Selected text in Source Pane has to contain '" +
hasToContain + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().contains(hasToContain));
+ hasToContain = CommandLinkTagTest.LINK_VALUE;
+ assertTrue("Selected text in Source Pane has to contain '" +
hasToContain + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().contains(hasToContain));
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandLinkTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/HtmlCommandLinkTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/HtmlCommandLinkTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/HtmlCommandLinkTagTest.java 2011-04-11
17:53:17 UTC (rev 30485)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+
+/**
+ * Tests ajax Html Command Link Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class HtmlCommandLinkTagTest extends AbstractTagTest{
+ private static final String LINK_VALUE = "*! Html Link Value";
+ @Override
+ protected void initPageContent() {
+ jspEditor.setText("<%@ taglib
uri=\"http://java.sun.com/jsf/html\"
prefix=\"h\" %>\n" +
+ "<%@ taglib
uri=\"http://java.sun.com/jsf/core\"
prefix=\"f\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/a4j\"
prefix=\"a4j\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/rich\"
prefix=\"rich\" %>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <a4j:htmlCommandLink>\n" +
+ " " + HtmlCommandLinkTagTest.LINK_VALUE + "\n" +
+ " <a4j:commandButton type=\"Submit\">\n" +
+ " </a4j:commandButton>\n" +
+ " </a4j:htmlCommandLink>\n" +
+ " </f:view>\n" +
+ " </body> \n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContains(jspWebBrowser,
+ "INPUT",
+ new String[]{"type"},
+ new String[]{"Submit"},
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContains(jspWebBrowser,
+ "A",
+ null,
+ null,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContainsNodeWithValue(jspWebBrowser,
+ HtmlCommandLinkTagTest.LINK_VALUE,
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ // check tag selection
+ jspWebBrowser.selectDomNode(jspWebBrowser.getDomNodeByTagName("A",0), 0);
+ bot.sleep(Timing.time3S());
+ String selectedText = jspEditor.getSelection();
+ String hasToStartWith = "<a4j:htmlCommandLink";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ String hasEndWith = "</a4j:htmlCommandLink>";
+ assertTrue("Selected text in Source Pane has to end with '" +
hasEndWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().endsWith(hasEndWith));
+ String hasToContain = "<a4j:commandButton
type=\"Submit\">";
+ assertTrue("Selected text in Source Pane has to contain '" +
hasToContain + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().contains(hasToContain));
+ hasToContain = HtmlCommandLinkTagTest.LINK_VALUE;
+ assertTrue("Selected text in Source Pane has to contain '" +
hasToContain + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().contains(hasToContain));
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/HtmlCommandLinkTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/IncludeTagTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/IncludeTagTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/IncludeTagTest.java 2011-04-11
17:53:17 UTC (rev 30485)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+/**
+ * Tests ajax include Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class IncludeTagTest extends AbstractTagTest{
+ private static final String INCLUDE_PAGE_NAME = "IncludePage.jsp";
+ @Override
+ protected void initPageContent() {
+ // Create pge which will be included
+ createJspPage(IncludeTagTest.INCLUDE_PAGE_NAME);
+ SWTBotEditorExt includeEditor =
botExt.swtBotEditorExtByTitle(IncludeTagTest.INCLUDE_PAGE_NAME);
+ includeEditor.setText("<%@ taglib
uri=\"http://richfaces.org/a4j\"
prefix=\"a4j\" %>\n" +
+ "<a4j:commandButton type=\"Submit\">\n" +
+ "</a4j:commandButton>\n");
+ includeEditor.saveAndClose();
+
+ jspEditor.setText("<%@ taglib
uri=\"http://java.sun.com/jsf/html\"
prefix=\"h\" %>\n" +
+ "<%@ taglib
uri=\"http://java.sun.com/jsf/core\"
prefix=\"f\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/a4j\"
prefix=\"a4j\" %>\n" +
+ "<%@ taglib
uri=\"http://richfaces.org/rich\"
prefix=\"rich\" %>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <a4j:include viewId=\"" + IncludeTagTest.INCLUDE_PAGE_NAME
+ "\"/>\n" +
+ " </f:view>\n" +
+ " </body> \n" +
+ "</html>");
+ }
+
+ @Override
+ protected void verifyTag() {
+ assertVisualEditorContains(jspWebBrowser,
+ "INPUT",
+ new String[]{"type"},
+ new String[]{"Submit"},
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ assertVisualEditorContains(jspWebBrowser,
+ "DIV",
+ new String[] {"vpe:include-element"},
+ new String[] {"yes"},
+ AbstractTagTest.TEST_PAGE_NAME_JSP);
+ // check tag selection
+ jspWebBrowser.selectDomNode(jspWebBrowser.getDomNodeByTagName("INPUT",0),
0);
+ bot.sleep(Timing.time3S());
+ String selectedText = jspEditor.getSelection();
+ String hasToStartWith = "<a4j:include";
+ assertTrue("Selected text in Source Pane has to start with '" +
hasToStartWith + "'" +
+ "\nbut it is '" + selectedText + "'",
+ selectedText.trim().startsWith(hasToStartWith));
+ }
+
+}
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/IncludeTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain