Author: vpakan(a)redhat.com
Date: 2011-10-04 14:20:34 -0400 (Tue, 04 Oct 2011)
New Revision: 35332
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java 2011-10-04
17:32:29 UTC (rev 35331)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/CodeCompletionTest.java 2011-10-04
18:20:34 UTC (rev 35332)
@@ -173,11 +173,7 @@
* Test Code Completion functionality for Composite Component
*/
public void testCodeCompletionOfCompositeComponent(){
- eclipse.closeAllEditors();
- createJSF2Project(JSF2_TEST_PROJECT_NAME);
- openPage(JSF2_TEST_PAGE, JSF2_TEST_PROJECT_NAME);
- compositeComponentContainerEditor =
SWTTestExt.bot.swtBotEditorExtByTitle(FACELETS_TEST_PAGE);
- origCompositeComponentContainerEditorText =
compositeComponentContainerEditor.getText();
+ initJSF2PageTest();
ContentAssistBot contentAssist = compositeComponentContainerEditor.contentAssist();
SWTJBTExt.selectTextInSourcePane(SWTTestExt.bot,
JSF2_TEST_PAGE,
@@ -262,6 +258,52 @@
compositeComponentDefEditor.save();
}
/**
+ * Test Code Completion functionality for Managed Bean
+ * referenced via @ManagedBean annotation
+ */
+ public void testCodeCompletionOfReferencedManagedBean(){
+ initJSF2PageTest();
+ String textForSelection = "value=\"#{user.name}\"";
+ List<String> expectedProposals = new LinkedList<String>();
+ expectedProposals.add("msgs");
+ expectedProposals.add("user : User");
+ expectedProposals.add("\"#{user.name}\"");
+ expectedProposals.add("applicationScope");
+ expectedProposals.add("cc");
+ expectedProposals.add("component");
+ expectedProposals.add("cookie");
+ expectedProposals.add("facesContext");
+ expectedProposals.add("flash");
+ expectedProposals.add("header");
+ expectedProposals.add("headerValues");
+ expectedProposals.add("initParam");
+ expectedProposals.add("param");
+ expectedProposals.add("paramValues");
+ expectedProposals.add("requestScope");
+ expectedProposals.add("resource");
+ expectedProposals.add("sessionScope");
+ expectedProposals.add("view");
+ expectedProposals.add("viewScope");
+ // Check content assist for #{ prefix
+ ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
+ JSF2_TEST_PAGE,
+ textForSelection,
+ 9,
+ 0,
+ expectedProposals);
+ // Check content assist for ${user. prefix
+ expectedProposals.clear();
+ expectedProposals.add("name : String - User");
+ expectedProposals.add("sayHello() : String - User");
+ expectedProposals.add("\"#{user.name}\"");
+ ContentAssistHelper.checkContentAssistContent(SWTTestExt.bot,
+ FACELETS_TEST_PAGE,
+ textForSelection,
+ 14,
+ 0,
+ expectedProposals);
+ }
+ /**
* Initialize test which are using facelets test page
*/
private void initFaceletsPageTest() {
@@ -270,6 +312,17 @@
editor = SWTTestExt.bot.swtBotEditorExtByTitle(FACELETS_TEST_PAGE);
originalEditorText = editor.getText();
}
+
+ /**
+ * Initialize test which are using JSF2 test page
+ */
+ private void initJSF2PageTest() {
+ eclipse.closeAllEditors();
+ createJSF2Project(JSF2_TEST_PROJECT_NAME);
+ openPage(JSF2_TEST_PAGE, JSF2_TEST_PROJECT_NAME);
+ compositeComponentContainerEditor =
SWTTestExt.bot.swtBotEditorExtByTitle(FACELETS_TEST_PAGE);
+ origCompositeComponentContainerEditorText =
compositeComponentContainerEditor.getText();
+ }
/**
* Returns list of expected Content Assist proposals for Input tag
* @return
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java 2011-10-04
17:32:29 UTC (rev 35331)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/OpenOnTest.java 2011-10-04
18:20:34 UTC (rev 35332)
@@ -165,5 +165,33 @@
selectedText.equalsIgnoreCase(expectedSelectedText));
compositeComponentEditor.close();
}
-
+ /**
+ * Test Open On functionality for Referenced Template within JSF2 project
+ */
+ public void testOpenOnForReferencedTemplateJsf2() {
+ eclipse.closeAllEditors();
+ createJSF2Project(JSF2_TEST_PROJECT_NAME);
+ openPage(JSF2_TEST_PAGE,JSF2_TEST_PROJECT_NAME);
+ // Check open on for <ez:input
+ String expectedOpenedFileName = "common.xhtml";
+ SWTBotEditor compositeComponentEditor = OpenOnHelper.checkOpenOnFileIsOpened(
+ SWTTestExt.bot, JSF2_TEST_PAGE, "<ui:composition
template=\"/templates/common.xhtml\"", 30,
+ 0, 0, expectedOpenedFileName);
+ compositeComponentEditor.close();
+ }
+
+ /**
+ * Test Open On functionality for Referenced Template within JSF facelets project
+ */
+ public void testOpenOnForReferencedTemplateFacelets() {
+ eclipse.closeAllEditors();
+ openPage(FACELETS_TEST_PAGE,FACELETS_TEST_PROJECT_NAME);
+ // Check open on for <ez:input
+ String expectedOpenedFileName = "common.xhtml";
+ SWTBotEditor compositeComponentEditor = OpenOnHelper.checkOpenOnFileIsOpened(
+ SWTTestExt.bot, FACELETS_TEST_PAGE, "<ui:composition
template=\"/templates/common.xhtml\"", 30,
+ 0, 0, expectedOpenedFileName);
+ compositeComponentEditor.close();
+ }
+
}
\ No newline at end of file
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-10-04
17:32:29 UTC (rev 35331)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-10-04
18:20:34 UTC (rev 35332)
@@ -704,4 +704,11 @@
public static final String URL_TEXT_LABEL = "Url:";
}
+
+ public static class WebXmlEditor{
+
+ public static final String SOURCE_TAB_LABEL = "Source";
+ public static final String TREE_TAB_LABEL = "Tree";
+
+ }
}
Show replies by date