Author: dgolovin
Date: 2010-11-16 15:46:05 -0500 (Tue, 16 Nov 2010)
New Revision: 26642
Added:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
https://jira.jboss.org/browse/JBIDE-7440 Between build #79 and #80, 874 tests disappeared
Share project "org.jboss.tools.jst.jsp.base.test" into
"https://svn.jboss.org/repos/jbosstools" that contains base classes for jst.jsp
related tests
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
(rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
(rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project 2010-11-16 20:46:05
UTC (rev 26642)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.jsp.base.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,8 @@
+#Tue Nov 16 12:09:10 PST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Base Classes for JSP Editor Related Tests
+Bundle-SymbolicName: org.jboss.tools.jst.jsp.base.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.jst.jsp.base.test.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.jface;bundle-version="3.6.0",
+ org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.ui;bundle-version="3.6.0",
+ org.eclipse.wst.sse.core;bundle-version="1.1.500",
+ org.eclipse.wst.sse.ui;bundle-version="1.2.0",
+ org.jboss.tools.common.text.ext;bundle-version="3.2.0",
+ org.jboss.tools.jst.jsp;bundle-version="3.2.0",
+ org.jboss.tools.tests;bundle-version="3.1.0",
+ org.eclipse.jface.text;bundle-version="3.6.0",
+ org.junit,
+ org.jboss.tools.jst.web;bundle-version="3.2.0",
+ org.eclipse.ui.ide;bundle-version="3.6.0",
+ org.jboss.tools.common.text.xml;bundle-version="3.2.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.jboss.tools.jst.jsp.test,
+ org.jboss.tools.jst.jsp.test.ca
Property changes on:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
===================================================================
--- trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
(rev 0)
+++ trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Property changes on:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
---
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
(rev 0)
+++
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,153 @@
+package org.jboss.tools.jst.jsp.test;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+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.contentassist.IContentAssistantExtension;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
+import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+
+public class TestUtil {
+
+ /** The Constant MAX_IDLE. */
+ public static final long MAX_IDLE = 5*60*1000L;
+
+ /**
+ * Returns the CA Processor from content assistant for the given offset in the
document.
+ *
+ *
+ * @param viewer
+ * @param offset
+ * @param ca
+ */
+
+ public static IContentAssistProcessor getProcessor(ITextViewer viewer, int offset,
IContentAssistant ca) {
+ try {
+ IDocument document= viewer.getDocument();
+ String type= TextUtilities.getContentType(document,
((IContentAssistantExtension)ca).getDocumentPartitioning(), offset, true);
+ return ca.getContentAssistProcessor(type);
+ } catch (BadLocationException x) {
+ }
+
+ return null;
+ }
+
+ /**
+ * Process UI input but do not return for the specified time interval.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ public static void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+
+ // If this is the UI thread,
+ // then process input.
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+
+ /**
+ * Wait for idle.
+ */
+ public static void waitForIdle(long maxIdle) {
+ long start = System.currentTimeMillis();
+ while (!Job.getJobManager().isIdle()) {
+ delay(500);
+ if ( (System.currentTimeMillis()-start) > maxIdle )
+ throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
+ }
+ }
+
+ public static SourceViewerConfiguration getSourceViewerConfiguration(AbstractTextEditor
editor) {
+ Class editorClass = editor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getSourceViewerConfiguration",
new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(editor, new Object[]{});
+ return (result instanceof SourceViewerConfiguration ?
(SourceViewerConfiguration)result : null);
+ }
+ } catch (NoSuchMethodException ne) {
+ } catch (Exception e) {
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ public static void prepareCAInvokation(IContentAssistant ca, ITextViewer viewer, int
offset) {
+ if (ca == null || viewer == null)
+ return;
+
+ // sets cursor position
+ viewer.getTextWidget().setCaretOffset(offset);
+
+ TestUtil.waitForIdle(TestUtil.MAX_IDLE);
+ TestUtil.delay(1000);
+
+ ca.showPossibleCompletions();
+ }
+
+ public static int MAX_CATEGORIES_COUNT = 10;
+ public static List<ICompletionProposal> collectProposals(IContentAssistant ca,
ITextViewer viewer, int offset) {
+ prepareCAInvokation(ca, viewer, offset);
+
+ final IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, ca);
+ List<ICompletionProposal> res= new ArrayList<ICompletionProposal>();
+ // Try to acquire all the proposal categories assuming that there are less than 10 or
equal
+ for (int i = 0; i < MAX_CATEGORIES_COUNT && p != null; i++) {
+ ICompletionProposal[] result= p.computeCompletionProposals(viewer, offset);
+ for (int j = 0; result != null && j < result.length; j++) {
+ res.add(result[j]);
+ }
+ }
+ return ProposalSorter.filterAndSortProposals(res, null, null);
+ }
+ /**
+ * Close all opened editors
+ * @author mareshkau
+ */
+ public static final void closeAllEditors(){
+ IWorkbenchPage page = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPart part = page.getViewReferences()[0].getPart(false);
+ page.activate(part);
+ // close
+ page.closeAllEditors(false);
+ }
+}
Property changes on:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
===================================================================
---
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
(rev 0)
+++
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jst.jsp.test.ca;
+
+
+import org.jboss.tools.test.util.TestProjectProvider;
+
+
+/**
+ * Abstract class contains of common methods.
+ *
+ * @author Eugene Stherbin
+ *
+ */
+public abstract class CommonContentAssistantTestCase extends ContentAssistantTestCase {
+ /** The make copy. */
+ protected boolean makeCopy;
+
+ /** The provider. */
+ protected TestProjectProvider provider;
+
+ protected abstract String getSetUpProjectName();
+
+ @Override
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.seam.ui.test",
null, getSetUpProjectName(), makeCopy); //$NON-NLS-1$
+ project = provider.getProject();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ if (provider != null) {
+ provider.dispose();
+ }
+ }
+}
Property changes on:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/CommonContentAssistantTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
---
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
(rev 0)
+++
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-11-16
20:46:05 UTC (rev 26642)
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jst.jsp.test.ca;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+public class ContentAssistantTestCase extends TestCase {
+ protected IProject project = null;
+ protected JSPMultiPageEditor jspEditor = null;
+ protected JSPTextEditor jspTextEditor = null;
+ protected StructuredTextViewer viewer = null;
+ protected IContentAssistant contentAssistant = null;
+ protected IDocument document = null;
+
+ public void openEditor(String fileName) {
+ IEditorPart editorPart = WorkbenchUtils.openEditor(project.getName()+"/"+
fileName); //$NON-NLS-1$
+// System.out.println("openEditor: " + project.getName()+"/"+
fileName);
+ if (editorPart instanceof JSPMultiPageEditor)
+ jspEditor = (JSPMultiPageEditor) editorPart;
+
+ jspTextEditor = jspEditor.getJspEditor();
+ viewer = jspTextEditor.getTextViewer();
+ document = viewer.getDocument();
+ SourceViewerConfiguration config = TestUtil
+ .getSourceViewerConfiguration(jspTextEditor);
+ contentAssistant = (config == null ? null : config
+ .getContentAssistant(viewer));
+
+ assertTrue(
+ "Cannot get the Content Assistant instance for the editor for page \""
//$NON-NLS-1$
+ + fileName + "\"", (contentAssistant != null)); //$NON-NLS-1$
+
+ assertTrue("The IDocument is not instance of IStructuredDocument for page
\"" //$NON-NLS-1$
+ + fileName + "\"", //$NON-NLS-1$
+ (document instanceof IStructuredDocument));
+
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, int offset, String[]
proposals, boolean exactly) {
+ return checkProposals(fileName, null, offset, proposals, exactly, true);
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int
offset, String[] proposals, boolean exactly) {
+ return checkProposals(fileName, substring, offset, proposals, exactly, false);
+ }
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int
offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
+// System.out.println("checkProposals >>> Enterring");
+// System.out.println("checkProposals >>> invoking openEditor() for "
+ fileName);
+ openEditor(fileName);
+// System.out.println("checkProposals >>> openEditor() is invoked for
" + fileName);
+
+ int position = 0;
+ if (substring != null) {
+ String documentContent = document.get();
+ position = documentContent.indexOf(substring);
+ }
+
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant,
viewer, position+offset);
+
+ assertTrue("Content Assistant returned no proposals", (res != null
&& res.size() > 0)); //$NON-NLS-1$
+
+ // for (int i = 0; i < result.length; i++) {
+ // System.out.println("proposal - "+result[i].getDisplayString());
+ // }
+
+ ICompletionProposal[] result = res.toArray(new ICompletionProposal[res.size()]);
+ int foundCounter = 0;
+ for (int i = 0; i < proposals.length; i++) {
+ boolean found = compareProposal(proposals[i], result);
+ if (found)
+ foundCounter++;
+ assertTrue("Proposal " + proposals[i] + " not found!",
found ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ if (exactly) {
+ if (excludeELProposalsFromExactTest) {
+ assertTrue("Some other proposals were found!", foundCounter ==
proposals.length); //$NON-NLS-1$
+ } else {
+ assertTrue("Some other proposals were found!", result.length ==
proposals.length); //$NON-NLS-1$
+ }
+ }
+
+// System.out.println("checkProposals <<< Exiting");
+ return result;
+ }
+
+ public boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
+ for (int i = 0; i < proposals.length; i++) {
+ if (proposals[i] instanceof AutoContentAssistantProposal) {
+ AutoContentAssistantProposal ap = (AutoContentAssistantProposal)proposals[i];
+ String replacementString = ap.getReplacementString().toLowerCase();
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+
+ // For a tag proposal there will be not only the the tag name but all others
characters like default attributes, tag ending characters and so on
+ if (replacementString.indexOf("/>") != -1) {
+ replacementString = replacementString.substring(0,
replacementString.indexOf("/>"));
+ }
+ if (replacementString.indexOf('>') != -1) {
+ replacementString = replacementString.substring(0,
replacementString.indexOf('>'));
+ }
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ String[] replacementStringParts = replacementString.split(" ");
//$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an attribute proposal there will be a pare of attribute-value (i.e.
attrName="attrValue")
+ replacementStringParts = replacementString.split("="); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an Unclosed EL the closing character is appended to the proposal string (i.e.
person} )
+ // perform case sensitive compare operation
+ replacementStringParts = replacementString.split("}"); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equals(proposalName)) return true;
+ }
+
+ // For an attribute value proposal there will be the quote characters
+ replacementString = Utils.trimQuotes(replacementString);
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ } else {
+ if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase()))
return true;
+ }
+ }
+ return false;
+ }
+
+ public void closeEditor() {
+ if (jspEditor != null) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().closeEditor(jspEditor, false);
+ jspEditor = null;
+ }
+ }
+
+ /**
+ * @return the project
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /**
+ * @param project the project to set
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ * @return the jspEditor
+ */
+ public JSPMultiPageEditor getJspEditor() {
+ return jspEditor;
+ }
+
+ /**
+ * @param jspEditor the jspEditor to set
+ */
+ public void setJspEditor(JSPMultiPageEditor jspEditor) {
+ this.jspEditor = jspEditor;
+ }
+
+ /**
+ * @return the jspTextEditor
+ */
+ public JSPTextEditor getJspTextEditor() {
+ return jspTextEditor;
+ }
+
+ /**
+ * @param jspTextEditor the jspTextEditor to set
+ */
+ public void setJspTextEditor(JSPTextEditor jspTextEditor) {
+ this.jspTextEditor = jspTextEditor;
+ }
+
+ /**
+ * @return the viewer
+ */
+ public StructuredTextViewer getViewer() {
+ return viewer;
+ }
+
+ /**
+ * @param viewer the viewer to set
+ */
+ public void setViewer(StructuredTextViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ /**
+ * @return the contentAssistant
+ */
+ public IContentAssistant getContentAssistant() {
+ return contentAssistant;
+ }
+
+ /**
+ * @param contentAssistant the contentAssistant to set
+ */
+ public void setContentAssistant(IContentAssistant contentAssistant) {
+ this.contentAssistant = contentAssistant;
+ }
+
+ /**
+ * @return the document
+ */
+ public IDocument getDocument() {
+ return document;
+ }
+
+ /**
+ * @param document the document to set
+ */
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/seam/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain