Author: estherbin
Date: 2008-06-04 08:59:40 -0400 (Wed, 04 Jun 2008)
New Revision: 8537
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withEl.xhtml
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withoutEl.xhtml
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
Log:
Test cases for
http://jira.jboss.com/jira/browse/JBIDE-2227
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2008-06-04 12:37:06
UTC (rev 8536)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2008-06-04 12:59:40
UTC (rev 8537)
@@ -36,7 +36,8 @@
org.eclipse.datatools.connectivity,
org.jboss.tools.jst.jsp,
org.jboss.tools.jst.jsp.test,
- org.eclipse.jdt.ui
+ org.eclipse.jdt.ui,
+ org.jboss.tools.vpe.ui.test;bundle-version="1.0.0"
Export-Package: org.jboss.tools.seam.ui.test,
org.jboss.tools.seam.ui.test.view,
org.jboss.tools.seam.ui.test.wizard
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withEl.xhtml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withEl.xhtml
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withEl.xhtml 2008-06-04
12:59:40 UTC (rev 8537)
@@ -0,0 +1,12 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
mlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+<ui:define name="body">
+ <h:outputText value=""/>
+</ui:define>
+</ui:composition>
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withEl.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:eol-style
+ native
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withoutEl.xhtml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withoutEl.xhtml
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withoutEl.xhtml 2008-06-04
12:59:40 UTC (rev 8537)
@@ -0,0 +1,34 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages styleClass="message"/>
+
+ <h:form id="login">
+
+ <rich:panel>
+ <f:facet name="header">Login</f:facet>
+
+ <p>Please login using any username and password</p>
+
+
+
+ </rich:panel>
+
+ <div class="actionButtons">
+ <h:commandButton value="Login"
action="#{identity.login}"/>
+ <s:button view="/home.xhtml" value="Home Button"
/>
+ <s:link view="/home.xhtml" value="Home Link" />
+ </div>
+ </h:form>
+
+ </ui:define>
+</ui:composition>
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/jbide2227/withoutEl.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:eol-style
+ native
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java 2008-06-04
12:59:40 UTC (rev 8537)
@@ -0,0 +1,180 @@
+
+
+package org.jboss.tools.seam.ui.test.jbide;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+
+
+/**
+ * The Class JBide2227TestCase.
+ */
+public class JBide2227TestCase extends ContentAssistantTestCase {
+
+ /** The Constant IMPORT_PROJECT_NAME. */
+ private static final String IMPORT_PROJECT_NAME =
"TestSeamELContentAssist";
+
+ /** The Constant PAGE_1. */
+ private static final String PAGE_1 = "/WebContent/jbide2227/withEl.xhtml";
+
+ /** The Constant CA_NAME. */
+ private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT";
+
+ /** The provider. */
+ private TestProjectProvider provider;
+
+ /** The project. */
+ private IProject project;
+
+ /** The make copy. */
+ private boolean makeCopy;
+
+ /** The Constant PAGE_2. */
+ private static final String PAGE_2 =
"/WebContent/jbide2227/withoutEl.xhtml";
+
+
+ /**
+ * The Constructor.
+ */
+ public JBide2227TestCase() {
+ super();
+ }
+
+ /**
+ * Suite.
+ *
+ * @return the test
+ */
+ public static Test suite() {
+ return new TestSuite(JBide2227TestCase.class);
+ }
+
+ /**
+ * Sets the up.
+ *
+ * @throws Exception the exception
+ */
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.seam.ui.test",
null, IMPORT_PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ Throwable exception = null;
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (Exception x) {
+ exception = x;
+ x.printStackTrace();
+ }
+ assertNull("An exception caught: " + (exception != null ?
exception.getMessage() : ""), exception);
+ }
+
+ /**
+ * Tear down.
+ *
+ * @throws Exception the exception
+ */
+ protected void tearDown() throws Exception {
+ if (provider != null) {
+ provider.dispose();
+ }
+ }
+
+ /**
+ * Test content assist with el.
+ *
+ * @throws Throwable the throwable
+ */
+ public void testContentAssistWithEl() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+
+ check(CA_NAME, PAGE_1, 576, 114);
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ * Base checkof CA.
+ *
+ * @param testPagePath the test page path
+ * @param position the position
+ * @param caName the ca name
+ * @param numberOfProposals the number of proposals
+ *
+ * @throws CoreException the core exception
+ */
+ protected void check(String caName, String testPagePath, int position, int
numberOfProposals) throws CoreException {
+ // get test page path
+ IFile file = project.getFile(testPagePath);
+ assertNotNull("Could not open specified file " + file.getFullPath(),
file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // sets cursor position
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(position);
+ TestUtil.waitForJobs();
+ TestUtil.delay(2000);
+ SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor)
part.getSourceEditor())
+ .getSourceViewerConfigurationForTest();
+ // errase errors which can be on start of editor(for example xuklunner
+ // not found)
+ setException(null);
+ StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration)
sourceViewerConfiguration;
+ IContentAssistant iContentAssistant = stvc.getContentAssistant((ISourceViewer)
part.getSourceEditor().getAdapter(
+ ISourceViewer.class));
+ assertNotNull(iContentAssistant);
+ IContentAssistProcessor iContentAssistProcessor =
iContentAssistant.getContentAssistProcessor(caName);
+ assertNotNull(iContentAssistProcessor);
+ ICompletionProposal[] results = iContentAssistProcessor
+ .computeCompletionProposals(part.getSourceEditor().getTextViewer(),
position);
+ assertNotNull(results);
+ assertEquals(numberOfProposals, results.length);
+
+ closeEditors();
+ TestUtil.delay(1000L);
+ }
+
+ /**
+ * Test content assist without el.
+ *
+ * @throws Throwable the throwable
+ */
+ public void testContentAssistWithoutEl() throws Throwable {
+ TestUtil.waitForJobs();
+
+ setException(null);
+
+ check(CA_NAME, PAGE_2, 580, 11);
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native