Author: akazakov
Date: 2009-12-30 11:52:23 -0500 (Wed, 30 Dec 2009)
New Revision: 19621
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/CATest/
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/CATest/test.jsp
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/core/test/CATest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5383
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties 2009-12-30 16:35:04 UTC
(rev 19620)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/build.properties 2009-12-30 16:52:23 UTC
(rev 19621)
@@ -1,4 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ resources/,\
+ projects/
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2009-12-30 16:35:04
UTC (rev 19620)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2009-12-30 16:52:23
UTC (rev 19621)
@@ -9,4 +9,12 @@
org.jboss.tools.cdi.ui,
org.jboss.tools.tests,
org.jboss.tools.cdi.core.test,
- org.eclipse.core.resources
+ org.eclipse.core.resources,
+ org.jboss.tools.jst.jsp.test,
+ org.eclipse.jface.text,
+ org.eclipse.wst.sse.ui,
+ org.eclipse.wst.sse.core,
+ org.eclipse.jface,
+ org.jboss.tools.common,
+ org.eclipse.osgi,
+ org.eclipse.core.runtime
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties 2009-12-30 16:35:04 UTC
(rev 19620)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/build.properties 2009-12-30 16:52:23 UTC
(rev 19621)
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ resources/
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/CATest/test.jsp
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/CATest/test.jsp
(rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/CATest/test.jsp 2009-12-30
16:52:23 UTC (rev 19621)
@@ -0,0 +1,15 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title>JSF Test Page</title>
+ </head>
+ <body>
+ <f:view>
+ <h1>
+ <h:outputText value="#{sheep.name}"
+ rendered="#{(game.value == 'foo' and game.value == 'foo')
? game.value == 'foo' : false}"/>
+ </h1>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/resources/CATest/test.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/core/test/CATest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/core/test/CATest.java 2009-12-30
16:35:04 UTC (rev 19620)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/core/test/CATest.java 2009-12-30
16:52:23 UTC (rev 19621)
@@ -10,23 +10,48 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test;
+import java.io.File;
+
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.osgi.framework.Bundle;
/**
* @author Alexey Kazakov
*/
public class CATest extends TCKTest {
- protected void setUp() throws Exception {
- IProject p = importPreparedProject("/definition/qualifier");
- }
+ private IProject project;
+ private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
+ private static final String PAGE_NAME = "/resources/CATest/test.jsp";
+ private String[] beanProposals = new String[] {"sheep"};
+ private String[] propertyProposals = new String[] {"sheep"};
+ private final static String UI_TEST_PLUGIN_ID =
"org.jboss.tools.cdi.ui.test";
- public void test1() {
-
+ public CATest() {
+ super();
+ try {
+ project = importPreparedProject("/lookup");
+ Bundle core = Platform.getBundle(PLUGIN_ID);
+ Bundle ui = Platform.getBundle(UI_TEST_PLUGIN_ID);
+ String projectPath = FileLocator.resolve(core.getEntry(PROJECT_PATH)).getFile();
+ String resourcePath = FileLocator.resolve(ui.getEntry(PAGE_NAME)).getFile();
+
+ File from = new File(resourcePath);
+ File to = new File(projectPath, "/WebContent");
+
+ FileUtil.copyFile(from, to);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
- protected void tearDown() throws Exception {
- cleanProject("/definition/qualifier");
+ public void testEL() {
+ caTest.checkProposals(PAGE_NAME, "value=\"#{", 0, beanProposals,
false);
+ caTest.checkProposals(PAGE_NAME, "rendered=\"#{(game.", 0,
propertyProposals, false);
}
}
\ No newline at end of file
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2009-12-30
16:35:04 UTC (rev 19620)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2009-12-30
16:52:23 UTC (rev 19621)
@@ -2,7 +2,6 @@
import junit.framework.TestCase;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
@@ -10,9 +9,7 @@
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
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;
@@ -20,7 +17,6 @@
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.JobUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
public class ContentAssistantTestCase extends TestCase {
@@ -31,7 +27,7 @@
protected IContentAssistant contentAssistant = null;
protected IDocument document = null;
- protected void openEditor(String fileName) {
+ public void openEditor(String fileName) {
IEditorPart editorPart = WorkbenchUtils.openEditor(project.getName()+"/"+
fileName);
// System.out.println("openEditor: " + project.getName()+"/"+
fileName);
if (editorPart instanceof JSPMultiPageEditor)
@@ -55,11 +51,11 @@
}
- protected ICompletionProposal[] checkProposals(String fileName, int offset, String[]
proposals, boolean exactly) {
+ public ICompletionProposal[] checkProposals(String fileName, int offset, String[]
proposals, boolean exactly) {
return checkProposals(fileName, null, offset, proposals, exactly);
}
- protected ICompletionProposal[] checkProposals(String fileName, String substring, int
offset, String[] proposals, boolean exactly){
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int
offset, String[] proposals, boolean exactly){
openEditor(fileName);
int position = 0;
@@ -95,7 +91,7 @@
return result;
}
- protected boolean compareProposal(String proposalName, ICompletionProposal[]
proposals){
+ 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];
@@ -134,11 +130,95 @@
return false;
}
- protected void closeEditor() {
+ 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