JBoss Tools SVN: r6613 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core: model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-27 18:17:16 -0500 (Wed, 27 Feb 2008)
New Revision: 6613
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IVariableManager.java
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java
Log:
moving towards variable referencing
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java 2008-02-27 21:15:41 UTC (rev 6612)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java 2008-02-27 23:17:16 UTC (rev 6613)
@@ -9,9 +9,10 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
+import org.jboss.ide.eclipse.archives.core.model.IVariableManager;
import org.jboss.ide.eclipse.archives.core.xpl.StringSubstitutionEngineClone;
-public class AntVariables implements IRuntimeVariables {
+public class AntVariables implements IRuntimeVariables, IVariableManager {
private Task currentTask;
public void setCurrentTask(Task task) { currentTask = task; }
public Task getCurrentTask() { return currentTask; }
@@ -45,7 +46,15 @@
public String performStringSubstitution(String expression,
boolean reportUndefinedVariables) throws CoreException {
- return new StringSubstitutionEngineClone().performStringSubstitution(expression, reportUndefinedVariables);
+ return new StringSubstitutionEngineClone().performStringSubstitution(expression, reportUndefinedVariables, this);
}
+ public boolean containsVariable(String variable) {
+ return false;
+ }
+
+ public String getVariableValue(String variable, String arg) {
+ return null;
+ }
+
}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IVariableManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IVariableManager.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IVariableManager.java 2008-02-27 23:17:16 UTC (rev 6613)
@@ -0,0 +1,31 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.archives.core.model;
+
+/**
+ * @author rob.stryker <rob.stryker(a)redhat.com>
+ *
+ */
+public interface IVariableManager {
+ public boolean containsVariable(String variable);
+ public String getVariableValue(String variable, String arg);
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java 2008-02-27 21:15:41 UTC (rev 6612)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java 2008-02-27 23:17:16 UTC (rev 6613)
@@ -15,10 +15,13 @@
import java.util.Iterator;
import java.util.List;
import java.util.Stack;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
+import org.jboss.ide.eclipse.archives.core.model.IVariableManager;
/**
* Performs string substitution for context and value variables.
@@ -77,11 +80,11 @@
* @exception CoreException if unable to resolve a referenced variable or if a cycle exists
* in referenced variables
*/
- public String performStringSubstitution(String expression, boolean reportUndefinedVariables ) throws CoreException {
- substitute(expression, reportUndefinedVariables );
+ public String performStringSubstitution(String expression, boolean reportUndefinedVariables, IVariableManager manager ) throws CoreException {
+ substitute(expression, reportUndefinedVariables,manager );
List resolvedVariableSets = new ArrayList();
while (fSubs) {
- HashSet resolved = substitute(fResult.toString(), reportUndefinedVariables );
+ HashSet resolved = substitute(fResult.toString(), reportUndefinedVariables,manager);
for(int i=resolvedVariableSets.size()-1; i>=0; i--) {
@@ -118,8 +121,8 @@
* @exception CoreException if a referenced variable does not exist or if a cycle exists
* in referenced variables
*/
- public void validateStringVariables(String expression ) throws CoreException {
- performStringSubstitution(expression, true );
+ public void validateStringVariables(String expression, IVariableManager manager ) throws CoreException {
+ performStringSubstitution(expression, true, manager );
}
/**
@@ -130,7 +133,7 @@
* @param reportUndefinedVariables whether to report undefined variables as an error
* @exception CoreException if unable to resolve a variable
*/
- private HashSet substitute(String expression, boolean reportUndefinedVariables) throws CoreException {
+ private HashSet substitute(String expression, boolean reportUndefinedVariables, IVariableManager manager) throws CoreException {
fResult = new StringBuffer(expression.length());
fStack = new Stack();
fSubs = false;
@@ -186,7 +189,7 @@
resolvedVariables.add(substring);
pos = end + 1;
- String value= resolve(tos, reportUndefinedVariables);
+ String value= resolve(tos, reportUndefinedVariables, manager);
if (value == null) {
value = ""; //$NON-NLS-1$
}
@@ -228,54 +231,34 @@
* @param var
* @param reportUndefinedVariables whether to report undefined variables as
* an error
+ * @param manager Someone to call back to for the variable's values
* @return variable value, possibly <code>null</code>
* @exception CoreException if unable to resolve a value
*/
- private String resolve(VariableReference var, boolean reportUndefinedVariables) throws CoreException {
-// String text = var.getText();
-// int pos = text.indexOf(VARIABLE_ARG);
-// String name = null;
-// String arg = null;
-// if (pos > 0) {
-// name = text.substring(0, pos);
-// pos++;
-// if (pos < text.length()) {
-// arg = text.substring(pos);
-// }
-// } else {
-// name = text;
-// }
-// IValueVariable valueVariable = manager.getValueVariable(name);
-// if (valueVariable == null) {
-// IDynamicVariable dynamicVariable = manager.getDynamicVariable(name);
-// if (dynamicVariable == null) {
-// // no variables with the given name
-// if (reportUndefinedVariables) {
-// throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, new String[]{name}), null));
-// }
-// // leave as is
-// return getOriginalVarText(var);
-// }
-//
-// if (resolveVariables) {
-// fSubs = true;
-// return dynamicVariable.getValue(arg);
-// }
-// //leave as is
-// return getOriginalVarText(var);
-// }
-//
-// if (arg == null) {
-// if (resolveVariables) {
-// fSubs = true;
-// return valueVariable.getValue();
-// }
-// //leave as is
-// return getOriginalVarText(var);
-// }
-// // error - an argument specified for a value variable
-// throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null));
- return "tobecompleted";
+ private String resolve(VariableReference var, boolean reportUndefinedVariables, IVariableManager manager) throws CoreException {
+ String text = var.getText();
+ int pos = text.indexOf(VARIABLE_ARG);
+ String name = null;
+ String arg = null;
+ if (pos > 0) {
+ name = text.substring(0, pos);
+ pos++;
+ if (pos < text.length()) {
+ arg = text.substring(pos);
+ }
+ } else {
+ name = text;
+ }
+ if( !manager.containsVariable(name)) {
+ if( reportUndefinedVariables )
+ throw new CoreException(new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID, "Variable " + name + " undefined"));
+ return getOriginalVarText(var);
+ }
+
+ String ret = manager.getVariableValue(name, arg);
+ if(ret == null)
+ return getOriginalVarText(var);
+ return ret;
}
private String getOriginalVarText(VariableReference var) {
16 years, 11 months
JBoss Tools SVN: r6612 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-27 16:15:41 -0500 (Wed, 27 Feb 2008)
New Revision: 6612
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java
Log:
Change to StringWriter, because it actually works ;)
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java 2008-02-27 18:17:13 UTC (rev 6611)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java 2008-02-27 21:15:41 UTC (rev 6612)
@@ -191,19 +191,12 @@
}
public static String serializePackages(XbPackages packages, IProgressMonitor monitor) throws XbException {
- OutputStreamWriter writer = null;
try {
- ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
- writer = new OutputStreamWriter(bytesOut);
- XMLBinding.marshall(packages, writer, monitor);
- return new String(bytesOut.toByteArray());
+ StringWriter sw = new StringWriter();
+ XMLBinding.marshall(packages, sw, monitor);
+ return new String(sw.toString());
} catch( Exception e ) {
throw new XbException(e);
- } finally {
- if( writer != null )
- try {
- writer.close();
- } catch( IOException ioe) {}
}
}
16 years, 11 months
JBoss Tools SVN: r6611 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-27 13:17:13 -0500 (Wed, 27 Feb 2008)
New Revision: 6611
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1812
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-02-27 17:59:03 UTC (rev 6610)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-02-27 18:17:13 UTC (rev 6611)
@@ -1,32 +1,20 @@
package org.jboss.tools.seam.ui.test.ca;
import junit.framework.Test;
-import junit.framework.TestCase;
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.jface.text.IDocument;
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.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.ui.internal.StructuredTextViewer;
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.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-public class SeamELContentAssistJbide1645Test extends TestCase {
+public class SeamELContentAssistJbide1645Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "TestSeamELContentAssist";
private static final String PAGE_NAME = "/WebContent/home.xhtml";
@@ -59,52 +47,8 @@
}
public void testSeamELContentAssistJbide1645() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
-
- IFile jspFile = project.getFile(PAGE_NAME);
-
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
+ openEditor(PAGE_NAME);
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
-
// Find start of <rich:panel> tag
String documentContent = document.get();
int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
@@ -130,25 +74,12 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
for (int i = 0; i < result.length; i++) {
// There should not be a proposal of type SeamELProposalProcessor.Proposal in the result
assertFalse("Content Assistant peturned proposals of type (" + result[i].getClass().getName() + ").", (result[i] instanceof SeamELProposalProcessor.Proposal));
-// if (!(result[i] instanceof RedHatCustomCompletionProposal))
-// continue;
-// RedHatCustomCompletionProposal proposal = (RedHatCustomCompletionProposal)result[i];
-// String proposalString = proposal.getReplacementString();
-// int proposalReplacementOffset = proposal.getReplacementOffset();
-// int proposalReplacementLength = proposal.getReplacementLength();
-// try {
-// System.out.println("Result#" + i + " ==> Offs: " + offsetToTest + " RedHatCustomCompletionProposal[" + proposalString + "], Offs: " + proposalReplacementOffset + ", Len: " + proposalReplacementLength + ", Doc: [" + document.get(proposalReplacementOffset, proposalReplacementLength));
-// } catch (BadLocationException e) {
-// }
}
try {
@@ -158,7 +89,6 @@
assertTrue("Waiting for the jobs to complete has failed.", false);
}
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-02-27 17:59:03 UTC (rev 6610)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-02-27 18:17:13 UTC (rev 6611)
@@ -9,7 +9,6 @@
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.NullProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
@@ -18,21 +17,13 @@
import org.eclipse.jface.text.ITextViewer;
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.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.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
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.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
@@ -439,52 +430,8 @@
}
public void testSeamELContentAssist() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+ openEditor(PAGE_NAME);
- IFile jspFile = project.getFile(PAGE_NAME);
-
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
-
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
-
List<IRegion> regionsToTest = getELRegionsToTest(document);
if (regionsToTest != null) {
for (IRegion region : regionsToTest) {
@@ -646,8 +593,7 @@
}
}
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
16 years, 11 months
JBoss Tools SVN: r6610 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-02-27 12:59:03 -0500 (Wed, 27 Feb 2008)
New Revision: 6610
Removed:
trunk/documentation/qa/test-plan/
trunk/documentation/qa/test-strategy/
Log:
moved to docs folder
16 years, 11 months
JBoss Tools SVN: r6609 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-27 12:51:01 -0500 (Wed, 27 Feb 2008)
New Revision: 6609
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-02-27 17:28:08 UTC (rev 6608)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-02-27 17:51:01 UTC (rev 6609)
@@ -18,15 +18,11 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.vpe.VpePlugin;
@@ -231,7 +227,7 @@
String sourcePrefix = sourceNode.getPrefix();
- if (sourcePrefix == null || ((ElementImpl)sourceNode).isJSPTag() || "jsp".equals(sourcePrefix)) {
+ if (sourcePrefix == null || ((IDOMElement)sourceNode).isJSPTag() || "jsp".equals(sourcePrefix)) {
return sourceNode.getNodeName();
}
16 years, 11 months
JBoss Tools SVN: r6608 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-02-27 12:28:08 -0500 (Wed, 27 Feb 2008)
New Revision: 6608
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneListBox.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneMenu.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneRadio.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
Add JUnit test for http://jira.jboss.com/jira/browse/JBIDE-1720
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneListBox.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneListBox.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneListBox.jsp 2008-02-27 17:28:08 UTC (rev 6608)
@@ -0,0 +1,29 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title></title>
+ <style type="text/css">
+ .myStyle {background: aqua;}
+ .myStyle1 {background: yellow;}
+ .myStyle2 {background: green; font-style: italic;}
+ </style>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <h:selectOneListbox id="sub2" value="#{user.name}"
+ disabled="true" size="3"
+ disabledClass="myStyle" enabledClass="myStyle1"
+ style="font-size: large;" styleClass="myStyle2"
+ readonly="false" >
+ <f:selectItem id="it1" itemLabel="News" itemValue="1" />
+ <f:selectItem id="it2" itemLabel="Sports" itemValue="2" />
+ <f:selectItem id="it3" itemLabel="Music" itemValue="3" />
+ <f:selectItem id="it4" itemLabel="Java" itemValue="4" />
+ <f:selectItem id="it5" itemLabel="Web" itemValue="5" />
+ </h:selectOneListbox>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneMenu.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneMenu.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneMenu.jsp 2008-02-27 17:28:08 UTC (rev 6608)
@@ -0,0 +1,29 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title></title>
+ <style type="text/css">
+ .myStyle {background: aqua;}
+ .myStyle1 {background: yellow;}
+ .myStyle2 {background: green; font-style: italic;}
+ </style>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <h:selectOneMenu id="subs2" value="#{user.name}"
+ dir="rtl" disabled="false"
+ disabledClass="myStyle" enabledClass="myStyle1"
+ style="font-size: large;" styleClass="myStyle2"
+ readonly="false" >
+ <f:selectItem id="ite1" itemLabel="News" itemValue="1" />
+ <f:selectItem id="ite2" itemLabel="Sports" itemValue="2" />
+ <f:selectItem id="ite3" itemLabel="Music" itemValue="3" />
+ <f:selectItem id="ite4" itemLabel="Java" itemValue="4" />
+ <f:selectItem id="ite5" itemLabel="Web" itemValue="5" />
+ </h:selectOneMenu>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneRadio.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneRadio.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1720/JBIDE-1720-selectOneRadio.jsp 2008-02-27 17:28:08 UTC (rev 6608)
@@ -0,0 +1,28 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title></title>
+ <style type="text/css">
+ .myStyle {background: aqua;}
+ .myStyle1 {background: yellow;}
+ .myStyle2 {background: green; font-style: italic;}
+ </style>
+ </head>
+ <body>
+ <f:view>
+ <h:selectOneRadio id="sub1" value="#{user.selects}"
+ layout="pageDirection" border="10" dir="ltr"
+ disabled="true"
+ disabledClass="myStyle1" enabledClass="myStyle"
+ readonly="true" style="color: red; background: pink;" styleClass="myStyle2" >
+ <f:selectItem id="item1" itemLabel="<b>News</b>" itemValue="1"
+ escape="false" />
+ <f:selectItem id="item2" itemLabel="Sports" itemValue="2" />
+ <f:selectItem id="item3" itemLabel="Music" itemValue="3" />
+ <f:selectItem id="item4" itemLabel="Java" itemValue="4" />
+ <f:selectItem id="item5" itemLabel="Web" itemValue="5" />
+ </h:selectOneRadio>
+ </f:view>
+ </body>
+</html>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-27 17:24:48 UTC (rev 6607)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-27 17:28:08 UTC (rev 6608)
@@ -21,6 +21,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1479Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1484Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1615Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1720Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1744Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
@@ -55,6 +56,8 @@
suite.addTestSuite(JBIDE1744Test.class);
suite.addTestSuite(JBIDE675Test.class);
suite.addTestSuite(JBIDE1460Test.class);
+ suite.addTestSuite(JBIDE1720Test.class);
+
// $JUnit-END$
//added by Max Areshkau
//add here projects which should be imported for junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java 2008-02-27 17:28:08 UTC (rev 6608)
@@ -0,0 +1,280 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * Test JBIDE-1720
+ *
+ * @author Dzmitry Sakovich (dsakovich(a)exadel.com)
+ *
+ */
+public class JBIDE1720Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "jsfTest";
+
+ private static final String TEST_PAGE_NAME1 = "JBIDE/1720/JBIDE-1720-selectOneRadio.jsp";
+ private static final String TEST_PAGE_NAME2 = "JBIDE/1720/JBIDE-1720-selectOneListBox.jsp";
+ private static final String TEST_PAGE_NAME3 = "JBIDE/1720/JBIDE-1720-selectOneMenu.jsp";
+
+ public JBIDE1720Test(String name) {
+ super(name);
+ }
+
+ // test method for JBIDE 1720 selectOneRadio component
+ public void testJBIDE_1720_selectOneRadio() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME1,
+ IMPORT_PROJECT_NAME);
+
+ 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);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ // check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "input" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_INPUT);
+
+ assertEquals(5, elements.size());
+
+ for (int i = 0; i < elements.size(); i++) {
+
+ nsIDOMElement inputElement = (nsIDOMElement) elements.get(i)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ assertNotNull(inputElement);
+ String dir = inputElement.getAttribute(HTML.ATTR_DIR);
+ assertNotNull(dir);
+ assertEquals("rtl", dir);
+
+ String disabled = inputElement.getAttribute(HTML.ATTR_DISABLED);
+ assertNotNull(disabled);
+ assertEquals("disabled", disabled);
+ }
+
+ elements.clear();
+
+ // find "label" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_LABEL);
+
+ assertEquals(5, elements.size());
+
+ for (int i = 0; i < elements.size(); i++) {
+
+ nsIDOMElement inputElement = (nsIDOMElement) elements.get(i)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ assertNotNull(inputElement);
+ String style = inputElement.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull(style);
+ assertEquals("myStyle1", style);
+
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+ // test method for JBIDE 1720 selectOneMenu component
+ public void testJBIDE_1720_selectOneMenu() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME3,
+ IMPORT_PROJECT_NAME);
+
+ 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);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ // check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "select" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_SELECT);
+
+ assertEquals(1, elements.size());
+
+ nsIDOMElement select = (nsIDOMElement) elements.get(0).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ String size = select.getAttribute(HTML.ATTR_SIZE);
+ assertNotNull("Attribute size is not exist.", size);
+ assertEquals("1", size);
+
+ String styleClass = select.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull("Attribute class is not exist.", styleClass);
+ assertEquals("myStyle2", styleClass);
+
+ String style = select.getAttribute(HTML.ATTR_STYLE);
+ assertNotNull("Attribute style is not exist.", style);
+ assertEquals("font-size: large;", style);
+
+ String dir = select.getAttribute(HTML.ATTR_DIR);
+ assertNotNull("Attribute dir is not exist.", dir);
+ assertEquals("rtl", dir);
+
+ elements.clear();
+
+ // find "option" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_OPTION);
+
+ assertEquals(5, elements.size());
+
+ for (int i = 0; i < elements.size(); i++) {
+
+ nsIDOMElement inputElement = (nsIDOMElement) elements.get(i)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ assertNotNull(inputElement);
+ String attr = inputElement.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull("Attribute class is not exist in option tag", attr);
+ assertEquals("myStyle1", attr);
+
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+ // test method for JBIDE 1720 selectOneListBox component
+ public void testJBIDE_1720_selectOneListBox() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME2,
+ IMPORT_PROJECT_NAME);
+
+ 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);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ // check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "select" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_SELECT);
+
+ assertEquals(1, elements.size());
+
+ nsIDOMElement select = (nsIDOMElement) elements.get(0).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ String size = select.getAttribute(HTML.ATTR_SIZE);
+ assertNotNull("Attribute size is not exist.", size);
+ assertEquals("3", size);
+
+ String styleClass = select.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull("Attribute class is not exist.", styleClass);
+ assertEquals("myStyle2", styleClass);
+
+ String style = select.getAttribute(HTML.ATTR_STYLE);
+ assertNotNull("Attribute style is not exist.", style);
+ assertEquals("font-size: large;", style);
+
+ String disabled = select.getAttribute(HTML.ATTR_DISABLED);
+ assertNotNull("Attribute disabled is not exist.", disabled);
+ assertEquals("disabled", disabled);
+
+ elements.clear();
+
+ // find "option" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_OPTION);
+
+ assertEquals(5, elements.size());
+
+ for (int i = 0; i < elements.size(); i++) {
+
+ nsIDOMElement inputElement = (nsIDOMElement) elements.get(i)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ assertNotNull(inputElement);
+ String attr = inputElement.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull("Attribute class is not exist in option tag", attr);
+ assertEquals("myStyle", attr);
+
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-27 17:24:48 UTC (rev 6607)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-27 17:28:08 UTC (rev 6608)
@@ -73,7 +73,7 @@
public static final String ATTR_CELLPADDING = "cellpadding"; //$NON-NLS-1$
public static final String ATTR_WIDTH = "WIDTH"; //$NON-NLS-1$
public static final String ATTR_HEIGHT = "HEIGHT"; //$NON-NLS-1$
- public static final String ATTR_BORDER = "BORDER"; //$NON-NLS-1$
+ public static final String ATTR_BORDER = "border"; //$NON-NLS-1$
public static final String ATTR_FOR = "FOR";
public static final String ATTR_DIR = "dir";
public static final String ATTR_DISABLED = "disabled";
16 years, 11 months
JBoss Tools SVN: r6607 - in trunk: jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-02-27 12:24:48 -0500 (Wed, 27 Feb 2008)
New Revision: 6607
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/varAttributes.xhtml
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.1
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.2
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.java
Removed:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/widget/editor/
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
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/JsfJspJbide1807Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/.classpath
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1803 Added JUnitTest
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2008-02-27 17:10:34 UTC (rev 6606)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2008-02-27 17:24:48 UTC (rev 6607)
@@ -16,5 +16,6 @@
org.jboss.tools.jst.jsp,
org.jboss.tools.common.text.ext,
org.jboss.tools.jst.web
-Export-Package: org.jboss.tools.jst.jsp.test
+Export-Package: org.jboss.tools.jst.jsp.test,
+ org.jboss.tools.jst.jsp.test.ca
Bundle-ClassPath: jst-jsp-test.jar
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 2008-02-27 17:10:34 UTC (rev 6606)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-27 17:24:48 UTC (rev 6607)
@@ -85,19 +85,20 @@
(document instanceof IStructuredDocument));
}
- protected void contentAssistantCommonTest(String fileName, int offset, String[] proposals, boolean exactly){
- contentAssistantCommonTest(fileName, null, offset, proposals, exactly);
+
+ protected void checkProposals(String fileName, int offset, String[] proposals, boolean exactly){
+ checkProposals(fileName, null, offset, proposals, exactly);
}
-
- protected void contentAssistantCommonTest(String fileName, String substring, int offset, String[] proposals, boolean exactly){
+
+ protected void checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly){
openEditor(fileName);
-
+
int position = 0;
if(substring != null){
String documentContent = document.get();
position = documentContent.indexOf(substring);
}
-
+
ICompletionProposal[] result= null;
IContentAssistProcessor p= TestUtil.getProcessor(viewer, position+offset, contentAssistant);
@@ -110,19 +111,19 @@
}
assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
-
+
// for (int i = 0; i < result.length; i++) {
// System.out.println("proposal - "+result[i].getDisplayString());
// }
-
+
for (int i = 0; i < proposals.length; i++) {
assertTrue("Proposal "+proposals[i]+" not found!", compareProposal(proposals[i], result));
}
-
+
if(exactly)
assertTrue("Some other proposals was found!", result.length == proposals.length);
}
-
+
protected boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
for (int i = 0; i < proposals.length; i++) {
if(proposals[i].getDisplayString().equals(proposalName)) return true;
@@ -136,7 +137,5 @@
.getActivePage().closeEditor(jspEditor, false);
jspEditor = null;
}
-
}
-
-}
+}
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2008-02-27 17:10:34 UTC (rev 6606)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2008-02-27 17:24:48 UTC (rev 6607)
@@ -42,7 +42,7 @@
"#{sessionScope}",
"#{view}"
};
-
- contentAssistantCommonTest(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true);
+
+ checkProposals(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true);
}
-}
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/.classpath
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/.classpath 2008-02-27 17:10:34 UTC (rev 6606)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/.classpath 2008-02-27 17:24:48 UTC (rev 6607)
@@ -2,9 +2,9 @@
<classpath>
<classpathentry kind="src" output="WebContent/WEB-INF/dev" path="src/action"/>
<classpathentry kind="src" path="src/model"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_07"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/JBoss 4.2 Runtime"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="output" path="build/classes"/>
-</classpath>
+</classpath>
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/varAttributes.xhtml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/varAttributes.xhtml (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/WebContent/varAttributes.xhtml 2008-02-27 17:24:48 UTC (rev 6607)
@@ -0,0 +1,13 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <h:dataTable value="#{mapItems}" var="mapItem">
+ <h:dataTable value="#{mapItem.value.items}" var="test">
+ <h:outputText value="#{test.}"/>
+ </h:dataTable>
+ </h:dataTable>
+
+</html>
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.1
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.1 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.1 2008-02-27 17:24:48 UTC (rev 6607)
@@ -0,0 +1,44 @@
+package demo;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.datamodel.DataModel;
+
+@Name("testComponentForVars")
+public class TestComponentForVarAttributes {
+
+ @DataModel
+ private Set<Value> setItems;
+
+ @DataModel
+ private List<Value> listItems;
+
+ @DataModel
+ private Map<String, Test> mapItems;
+
+ @DataModel
+ private Value[] arrayItems;
+
+ public Test getTest() {
+ return null;
+ }
+
+ public List<Value> getList() {
+ return null;
+ }
+
+ public static class Value {
+ public String getName() {
+ return null;
+ }
+ }
+
+ public static class Test {
+ public List<Value> getItems() {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.2
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.2 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.2 2008-02-27 17:24:48 UTC (rev 6607)
@@ -0,0 +1,5 @@
+package demo;
+
+public class TestComponentForVarAttributes {
+
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/projects/TestSeamELContentAssist/src/action/demo/TestComponentForVarAttributes.java 2008-02-27 17:24:48 UTC (rev 6607)
@@ -0,0 +1,5 @@
+package demo;
+
+public class TestComponentForVarAttributes {
+
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-02-27 17:10:34 UTC (rev 6606)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-02-27 17:24:48 UTC (rev 6607)
@@ -5,20 +5,21 @@
import java.util.Set;
import java.util.TreeSet;
+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.NullProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextUtilities;
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.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
@@ -28,23 +29,18 @@
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.jboss.tools.common.model.XJob;
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.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
+import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class SeamELContentAssistTest extends TestCase {
+public class SeamELContentAssistTest extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "TestSeamELContentAssist";
private static final String PAGE_NAME = "/WebContent/login.xhtml";
@@ -72,6 +68,37 @@
}
}
+ /**
+ * Test for http://jira.jboss.com/jira/browse/JBIDE-1803
+ */
+ public void testVarAttributes() {
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+
+ IFile component = project.getFile("src/action/demo/TestComponentForVarAttributes.java");
+ IFile newComponent = project.getFile("src/action/demo/TestComponentForVarAttributes.1");
+ IFile emptyComponent = project.getFile("src/action/demo/TestComponentForVarAttributes.2");
+ try{
+ component.setContents(newComponent.getContents(), true, false, new NullProgressMonitor());
+ }catch(Exception e){
+ JUnitUtils.fail("Error during changing 'TestComponentForVarAttributes.java' content to 'TestComponentForVarAttributes.1'", e);
+ }
+ EditorTestHelper.joinJobs(1000,10000,500);
+
+ checkProposals("/WebContent/varAttributes.xhtml", 458, new String[]{"test.name"}, false);
+
+ try{
+ component.setContents(emptyComponent.getContents(), true, false, new NullProgressMonitor());
+ }catch(Exception e){
+ JUnitUtils.fail("Error during changing 'TestComponentForVarAttributes.java' content to 'TestComponentForVarAttributes.2'", e);
+ }
+ EditorTestHelper.joinJobs(1000,10000,500);
+ }
+
private static final String[] VALID_SEAM_EL_PROPOSALS = new String[] {
"TestSeamELContentAssistEntityManagerFactory",
"actor",
@@ -413,7 +440,6 @@
public void testSeamELContentAssist() {
try {
-// XJob.waitForJob();
EditorTestHelper.joinBackgroundActivities();
} catch (Exception e) {
e.printStackTrace();
@@ -444,7 +470,6 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
-// XJob.waitForJob();
EditorTestHelper.joinBackgroundActivities();
} catch (Exception e) {
e.printStackTrace();
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-02-27 17:10:34 UTC (rev 6606)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-02-27 17:24:48 UTC (rev 6607)
@@ -13,7 +13,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
import org.eclipse.jface.text.ITypedRegion;
@@ -26,13 +25,12 @@
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.jboss.tools.common.model.XJob;
-import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
import org.jboss.tools.seam.text.ext.hyperlink.SeamViewHyperlinkPartitioner;
import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class SeamViewHyperlinkPartitionerTest extends TestCase {
@@ -46,9 +44,8 @@
}
public void setUp() throws Exception {
- //provider = new TestProjectProvider("", null, PROJECT_NAME, makeCopy);
+ //provider = new TestProjectProvider("", null, PROJECT_NAME, makeCopy);
project = ResourcesUtils.importProject(Platform.getBundle("org.jboss.tools.seam.ui.test"), "/projects/TestSeamELContentAssist", new NullProgressMonitor());
- Throwable exception = null;
project.refreshLocal(IResource.DEPTH_INFINITE, null);
}
@@ -60,9 +57,10 @@
public void testSeamViewPartitioner() {
try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
e.printStackTrace();
+ fail("Waiting for the jobs to complete has failed.");
}
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
16 years, 11 months
JBoss Tools SVN: r6606 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-27 12:10:34 -0500 (Wed, 27 Feb 2008)
New Revision: 6606
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1807
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2008-02-27 16:58:32 UTC (rev 6605)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2008-02-27 17:10:34 UTC (rev 6606)
@@ -7,8 +7,7 @@
TestProjectProvider provider = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJspJbide1807Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting";
- private static final String[] PAGE_EXTENSIONS = { ".xhtml", ".jsp" };
+ private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
public void setUp() throws Exception {
provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
@@ -30,8 +29,7 @@
}
public void testJsfJspJbide1807Test(){
- String[][] proposals={
- {
+ String[] proposals={
"#{applicationScope}",
"#{cookie}",
"#{facesContext}",
@@ -43,23 +41,8 @@
"#{requestScope}",
"#{sessionScope}",
"#{view}"
- },
- {
- "jsp:attribute",
- "jsp:body",
- "jsp:element",
- "jsp:getProperty",
- "jsp:include",
- "jsp:output",
- "jsp:param",
- "JSP expression - JSP expression <%=..%>"
- }
};
- for(int i = 0; i < PAGE_EXTENSIONS.length; i++){
- System.out.println("Testing file "+PAGE_NAME+PAGE_EXTENSIONS[i]+"...");
- contentAssistantCommonTest(PAGE_NAME+PAGE_EXTENSIONS[i], "<input type=\"image\" src=\"", 25, proposals[i], true);
-
- }
+ contentAssistantCommonTest(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true);
}
}
16 years, 11 months
JBoss Tools SVN: r6605 - in trunk/jst/tests/org.jboss.tools.jst.jsp.test: projects/JsfJspJbide1807Test and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-27 11:58:32 -0500 (Wed, 27 Feb 2008)
New Revision: 6605
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.classpath
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.project
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.html
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.jsp
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.xhtml
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1807
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.classpath (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.classpath 2008-02-27 16:58:32 UTC (rev 6605)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.project (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/.project 2008-02-27 16:58:32 UTC (rev 6605)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JsfJspJbide1807Test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.html
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.html (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.html 2008-02-27 16:58:32 UTC (rev 6605)
@@ -0,0 +1,8 @@
+<html>
+<head>
+ <title>Facelets Greeting Page</title>
+</head>
+<body>
+ <input type="image" src=""/>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.jsp
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.jsp (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.jsp 2008-02-27 16:58:32 UTC (rev 6605)
@@ -0,0 +1,11 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<html>
+<head>
+ <title>Facelets Greeting Page</title>
+</head>
+<body>
+ <input type="image" src=""/>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.xhtml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.xhtml (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJspJbide1807Test/WebContent/pages/greeting.xhtml 2008-02-27 16:58:32 UTC (rev 6605)
@@ -0,0 +1,8 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <input type="image" src=""/>
+</html>
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-02-27 16:39:12 UTC (rev 6604)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-02-27 16:58:32 UTC (rev 6605)
@@ -2,6 +2,7 @@
import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1704Test;
import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1717Test;
+import org.jboss.tools.jst.jsp.test.ca.JsfJspJbide1807Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1585Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1641Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1759Test;
@@ -15,6 +16,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.jboss.tools.jst.jsp.test");
+ suite.addTestSuite(JsfJspJbide1807Test.class);
suite.addTestSuite(JstJspJbide1585Test.class);
suite.addTestSuite(StrutsJspJbide1648Test.class);
suite.addTestSuite(JstJspJbide1641Test.class);
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 2008-02-27 16:39:12 UTC (rev 6604)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-27 16:58:32 UTC (rev 6605)
@@ -85,16 +85,25 @@
(document instanceof IStructuredDocument));
}
+ protected void contentAssistantCommonTest(String fileName, int offset, String[] proposals, boolean exactly){
+ contentAssistantCommonTest(fileName, null, offset, proposals, exactly);
+ }
- protected void contentAssistantCommonTest(String fileName, int offset, String[] proposals, boolean exactly){
+ protected void contentAssistantCommonTest(String fileName, String substring, int offset, String[] proposals, boolean exactly){
openEditor(fileName);
+ int position = 0;
+ if(substring != null){
+ String documentContent = document.get();
+ position = documentContent.indexOf(substring);
+ }
+
ICompletionProposal[] result= null;
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, contentAssistant);
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, position+offset, contentAssistant);
if (p != null) {
try {
- result= p.computeCompletionProposals(viewer, offset);
+ result= p.computeCompletionProposals(viewer, position+offset);
} catch (Throwable x) {
x.printStackTrace();
}
@@ -102,6 +111,10 @@
assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
+// for (int i = 0; i < result.length; i++) {
+// System.out.println("proposal - "+result[i].getDisplayString());
+// }
+
for (int i = 0; i < proposals.length; i++) {
assertTrue("Proposal "+proposals[i]+" not found!", compareProposal(proposals[i], result));
}
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2008-02-27 16:58:32 UTC (rev 6605)
@@ -0,0 +1,65 @@
+package org.jboss.tools.jst.jsp.test.ca;
+
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class JsfJspJbide1807Test extends ContentAssistantTestCase{
+ TestProjectProvider provider = null;
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "JsfJspJbide1807Test";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting";
+ private static final String[] PAGE_EXTENSIONS = { ".xhtml", ".jsp" };
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, 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);
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testJsfJspJbide1807Test(){
+ String[][] proposals={
+ {
+ "#{applicationScope}",
+ "#{cookie}",
+ "#{facesContext}",
+ "#{header}",
+ "#{headerValues}",
+ "#{initParam}",
+ "#{param}",
+ "#{paramValues}",
+ "#{requestScope}",
+ "#{sessionScope}",
+ "#{view}"
+ },
+ {
+ "jsp:attribute",
+ "jsp:body",
+ "jsp:element",
+ "jsp:getProperty",
+ "jsp:include",
+ "jsp:output",
+ "jsp:param",
+ "JSP expression - JSP expression <%=..%>"
+ }
+ };
+
+ for(int i = 0; i < PAGE_EXTENSIONS.length; i++){
+ System.out.println("Testing file "+PAGE_NAME+PAGE_EXTENSIONS[i]+"...");
+ contentAssistantCommonTest(PAGE_NAME+PAGE_EXTENSIONS[i], "<input type=\"image\" src=\"", 25, proposals[i], true);
+
+ }
+ }
+}
16 years, 11 months
JBoss Tools SVN: r6604 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui: src/org/jboss/tools/jst/web/ui/navigator and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-27 11:39:12 -0500 (Wed, 27 Feb 2008)
New Revision: 6604
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java
Log:
JBIDE-1433 Extention point for decorating label in Web Projects view and tree selectors added
with example extension for TLD file.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2008-02-27 16:39:00 UTC (rev 6603)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2008-02-27 16:39:12 UTC (rev 6604)
@@ -567,5 +567,17 @@
<xclass id="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"
class="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"/>
</extension>
+
+ <extension
+ point="org.jboss.tools.common.model.ui.labelDecorator">
+ <labelDecorator
+ entities="FileTLD_PRO,FileTLD_1_2,FileTLD_2_0,FileTLD_2_1"
+ name="File TLD"
+ partition="Tag Libraries"
+ variables="shortname,uri,display-name"
+ defaultValue="{name} [{shortname}]"
+ >
+ </labelDecorator>
+ </extension>
</plugin>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java 2008-02-27 16:39:00 UTC (rev 6603)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java 2008-02-27 16:39:12 UTC (rev 6604)
@@ -11,6 +11,9 @@
package org.jboss.tools.jst.web.ui.navigator;
import org.jboss.tools.common.model.ui.navigator.NavigatorLabelProvider;
+import org.jboss.tools.common.model.ui.navigator.decorator.DecoratorManager;
+import org.jboss.tools.common.model.ui.navigator.decorator.DecoratorPart;
+import org.jboss.tools.common.model.ui.navigator.decorator.XModelObjectDecorator;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.*;
@@ -22,6 +25,13 @@
XModelObject o = (XModelObject)element;
if(o.getFileType() != XModelObject.FILE) return super.getText(element);
String entity = o.getModelEntity().getName();
+
+ XModelObjectDecorator d = DecoratorManager.getInstance().getDecoratorByEntity(entity);
+ if(d != null) {
+ String label = d.getLabel(o);
+ return applyModification(o, label);
+ }
+
if("FilePROPERTIES".equals(entity)) {
XModelObject fs = o;
while(fs != null && fs.getFileType() != XModelObject.SYSTEM) fs = fs.getParent();
@@ -33,7 +43,18 @@
} else if("FileSystemFolder".equals(entity)) {
String s = o.getAttributeValue("location").replace('\\', '/');
return s.substring(s.lastIndexOf('/') + 1);
- }
+ } else if(entity.startsWith("FileTLD")) {
+ String s = super.getText(element);
+ String shortname = o.getAttributeValue("shortname");
+ if(shortname != null) {
+ s += " " + shortname;
+ }
+ String uri = o.getAttributeValue("uri");
+ if(uri != null && uri.length() > 0) {
+ s += " " + uri;
+ }
+ return s;
+ }
return super.getText(element);
}
16 years, 11 months