JBoss Tools SVN: r25112 - in trunk: jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-22 19:58:55 -0400 (Wed, 22 Sep 2010)
New Revision: 25112
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
Log:
JBIDE-7021
https://jira.jboss.org/browse/JBIDE-7021
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2010-09-22 22:43:57 UTC (rev 25111)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2010-09-22 23:58:55 UTC (rev 25112)
@@ -253,6 +253,10 @@
markers.add(marker);
}
+ public boolean hasMarkers() {
+ return !markers.isEmpty();
+ }
+
/**
* Removes all markers from this EL.
*/
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-09-22 22:43:57 UTC (rev 25111)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-09-22 23:58:55 UTC (rev 25112)
@@ -17,8 +17,10 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -195,19 +197,17 @@
return false;
}
IProject project = file.getProject();
- if(currentProject==null || !project.equals(currentProject)) {
- enabled = isEnabled(project);
- currentProject = project;
- }
- if(!enabled) {
- return false;
- }
if(!file.isSynchronized(IResource.DEPTH_ZERO)) {
// The resource is out of sync with the file system
// Just ignore this resource.
return false;
}
if(!project.equals(currentProject)) {
+ currentProject = project;
+ enabled = isEnabled(project);
+ if(!enabled) {
+ return false;
+ }
if(webRootFolder!=null && !project.equals(webRootFolder.getProject())) {
webRootFolder = null;
}
@@ -367,9 +367,9 @@
startPosition = startPosition + startPr;
length = propertyName.length();
}
- addError(JSFValidationMessages.UNPAIRED_GETTER_OR_SETTER, JSFSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
-// IMarker marker = addError(JSFValidationMessages.UNPAIRED_GETTER_OR_SETTER, JSFSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
-// elReference.addMarker(marker);
+// addError(JSFValidationMessages.UNPAIRED_GETTER_OR_SETTER, JSFSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
+ IMarker marker = addError(JSFValidationMessages.UNPAIRED_GETTER_OR_SETTER, JSFSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
+ elReference.addMarker(marker);
}
}
}
@@ -403,13 +403,13 @@
}
// Mark invalid EL
if(unresolvedTokenIsVariable) {
- addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
-// IMarker marker = addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
-// elReference.addMarker(marker);
+// addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ IMarker marker = addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ elReference.addMarker(marker);
} else {
- addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
-// IMarker marker = addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
-// elReference.addMarker(marker);
+// addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ IMarker marker = addError(JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ elReference.addMarker(marker);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2010-09-22 22:43:57 UTC (rev 25111)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2010-09-22 23:58:55 UTC (rev 25112)
@@ -125,8 +125,8 @@
}
private PageContextFactory() {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- if (workspace != null) workspace.addResourceChangeListener(this);
+// IWorkspace workspace = ResourcesPlugin.getWorkspace();
+// if (workspace != null) workspace.addResourceChangeListener(this);
}
/*
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java 2010-09-22 22:43:57 UTC (rev 25111)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java 2010-09-22 23:58:55 UTC (rev 25112)
@@ -10,13 +10,12 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.validation;
+import java.text.MessageFormat;
import java.util.Set;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -24,15 +23,14 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;
-import org.eclipse.wst.validation.internal.TaskListUtility;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
+import org.eclipse.wst.validation.internal.plugin.ValidationPlugin;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidator;
import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.jst.web.kb.KbMessages;
-import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.validation.IValidationContext;
import org.jboss.tools.jst.web.kb.validation.IValidationErrorManager;
@@ -42,6 +40,10 @@
*/
public abstract class ValidationErrorManager implements IValidationErrorManager {
+ static String VALIDATION_MARKER = ValidationPlugin.PLUGIN_ID + ".problemmarker"; //$NON-NLS-1$
+ static String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$
+ static String VALIDATION_MARKER_GROUP = "groupName"; //$NON-NLS-1$
+
protected IStatus OK_STATUS = new Status(IStatus.OK,
"org.eclipse.wst.validation", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
@@ -217,22 +219,17 @@
*/
public static IMarker addError(String message, int severity, String[] messageArguments, int length, int offset, IResource target, TextFileDocumentProvider documentProvider, String markerId, Class markerOwner) {
IMarker marker = null;
- IMessage problemMessage = new ProblemMessage(message, severity, messageArguments, target, markerId);
- problemMessage.setLength(length);
- problemMessage.setOffset(offset);
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ int lineNumber = 1;
try {
- if (workspace != null) workspace.removeResourceChangeListener(PageContextFactory.getInstance());
if (documentProvider != null) {
documentProvider.connect(target);
IDocument doc = documentProvider.getDocument(target);
- if(doc != null)
- problemMessage.setLineNo(doc.getLineOfOffset(offset) + 1);
- else
- problemMessage.setLineNo(1);
+ if(doc != null){
+ lineNumber = doc.getLineOfOffset(offset) + 1;
+ }
}
- marker = TaskListUtility.addTask(markerOwner.getName().intern(), target, "" + problemMessage.getLineNumber(), problemMessage.getText(),
- problemMessage.getText(), severity, null, problemMessage.getGroupName(), problemMessage.getOffset(), problemMessage.getLength());
+// marker = addTask(markerOwner.getName().intern(), target, lineNumber, MessageFormat.format(message, messageArguments),
+// severity, null, markerId, offset, length);
} catch (BadLocationException e) {
WebKbPlugin.getDefault().logError(
NLS.bind(KbMessages.EXCEPTION_DURING_CREATING_MARKER, target.getFullPath()), e);
@@ -240,13 +237,75 @@
WebKbPlugin.getDefault().logError(
NLS.bind(KbMessages.EXCEPTION_DURING_CREATING_MARKER, target.getFullPath()), e);
} finally {
- documentProvider.disconnect(target);
- if (workspace != null) workspace.addResourceChangeListener(PageContextFactory.getInstance());
+ if (documentProvider != null) {
+ documentProvider.disconnect(target);
+ }
}
return marker;
}
+ private static IMarker addTask(String pluginId, IResource resource, int location,
+ String message, int markerType, String targetObjectName,
+ String groupName, int offset, int length) throws CoreException {
+
+ if ((message == null) || (resource == null) || (!resource.exists())) {
+ return null;
+ }
+ int severity = getSeverity(markerType);
+
+ IMarker item = resource.createMarker(VALIDATION_MARKER); // add a validation marker
+
+ boolean offsetSet = ((offset != IMessage.OFFSET_UNSET) && (length != IMessage.OFFSET_UNSET));
+ int size = (offsetSet) ? 7 : 5;
+ String[] attribNames = new String[size];
+ Object[] attribValues = new Object[size];
+
+ attribNames[0] = VALIDATION_MARKER_OWNER;
+ attribValues[0] = pluginId;
+ attribNames[1] = VALIDATION_MARKER_GROUP;
+ attribValues[1] = ((groupName == null) ? "" : groupName); //$NON-NLS-1$
+ attribNames[2] = IMarker.MESSAGE;
+ attribValues[2] = message;
+ attribNames[3] = IMarker.SEVERITY;
+ attribValues[3] = new Integer(severity);
+
+ Integer lineNumber = Integer.valueOf(location);
+ attribNames[4] = IMarker.LINE_NUMBER;
+ attribValues[4] = lineNumber;
+
+ if (offsetSet) {
+ attribNames[5] = IMarker.CHAR_START;
+ attribValues[5] = new Integer(offset);
+ attribNames[6] = IMarker.CHAR_END;
+ attribValues[6] = new Integer(offset + length);
+ }
+
+ item.setAttributes(attribNames, attribValues);
+
+ return item;
+ }
+
+ private static int getSeverity(int severityEnumValue) {
+ switch (severityEnumValue) {
+ case (IMessage.HIGH_SEVERITY) : {
+ return IMarker.SEVERITY_ERROR;
+ }
+ case (IMessage.LOW_SEVERITY) : {
+ return IMarker.SEVERITY_INFO;
+ }
+ case (IMessage.NORMAL_SEVERITY) : {
+ return IMarker.SEVERITY_WARNING;
+ }
+ case (IMessage.ALL_MESSAGES) :
+ case (IMessage.ERROR_AND_WARNING) :
+ default : {
+ // assume it's a warning.
+ return IMarker.SEVERITY_WARNING;
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
15 years, 7 months
JBoss Tools SVN: r25111 - trunk/hibernatetools/plugins/org.hibernate.eclipse/lib/tools.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-09-22 18:43:57 -0400 (Wed, 22 Sep 2010)
New Revision: 25111
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/lib/tools/hibernate-tools.jar
Log:
Fix JBIDE-7145
upgrade hibernate-tools.jar to Beta1
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/lib/tools/hibernate-tools.jar
===================================================================
(Binary files differ)
15 years, 7 months
JBoss Tools SVN: r25110 - trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-09-22 17:52:21 -0400 (Wed, 22 Sep 2010)
New Revision: 25110
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
Log:
Fixing build issue again... once more into the breach dear friends...
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-09-22 21:09:06 UTC (rev 25109)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-09-22 21:52:21 UTC (rev 25110)
@@ -27,7 +27,7 @@
javax.xml.rpc,
org.eclipse.wst.internet.monitor.core,
org.eclipse.wst.internet.monitor.ui,
- javax.wsdl,
+ javax.wsdl;bundle-version="1.6.2",
org.jdom,
javax.xml.ws,
org.eclipse.ui.forms,
15 years, 7 months
JBoss Tools SVN: r25109 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.rest/META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2010-09-22 17:09:06 -0400 (Wed, 22 Sep 2010)
New Revision: 25109
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/jcip-annotations.jar
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
Removed:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-web-jcr-rest-client-2.1-SNAPSHOT-jar-with-dependencies.jar
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-web-jcr-rest-client-2.1-SNAPSHOT-sources.jar
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/.classpath
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/build.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java
Log:
JBIDE-6984 Upgraded ModeShape plugin to use latest ModeShape JDBC jar. Upgraded to latest ModeShape client jar that is available. Tested with the ModeShape 2.2.x Hudson build of Sep 22 10:56. Each release of JBT will require a new ModeShape client jar.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/.classpath
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/.classpath 2010-09-22 21:05:55 UTC (rev 25108)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/.classpath 2010-09-22 21:09:06 UTC (rev 25109)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="modeshape-web-jcr-rest-client-2.1-SNAPSHOT-jar-with-dependencies.jar" sourcepath="modeshape-web-jcr-rest-client-2.1-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="modeshape-client.jar"/>
+ <classpathentry exported="true" kind="lib" path="jcip-annotations.jar"/>
<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"/>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2010-09-22 21:05:55 UTC (rev 25108)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2010-09-22 21:09:06 UTC (rev 25109)
@@ -15,8 +15,10 @@
org.jboss.tools.usage;bundle-version="1.0.0";resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: modeshape-web-jcr-rest-client-2.1-SNAPSHOT-jar-with-dependencies.jar,
+Bundle-ClassPath: modeshape-client.jar,
+ jcip-annotations.jar,
.
-Export-Package: org.jboss.tools.modeshape.rest,
+Export-Package: javax.jcr.nodetype,
+ org.jboss.tools.modeshape.rest,
org.modeshape.web.jcr.rest.client,
org.modeshape.web.jcr.rest.client.domain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/build.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/build.properties 2010-09-22 21:05:55 UTC (rev 25108)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/build.properties 2010-09-22 21:09:06 UTC (rev 25109)
@@ -21,7 +21,8 @@
.,\
docs/,\
about.html,\
- modeshape-web-jcr-rest-client-2.1-SNAPSHOT-jar-with-dependencies.jar
+ jcip-annotations.jar,\
+ modeshape-client.jar
src.includes = src/
jars.compile.order = .
source.. = src/
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/jcip-annotations.jar
===================================================================
(Binary files differ)
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/jcip-annotations.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
===================================================================
(Binary files differ)
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-web-jcr-rest-client-2.1-SNAPSHOT-jar-with-dependencies.jar
===================================================================
(Binary files differ)
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-web-jcr-rest-client-2.1-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2010-09-22 21:05:55 UTC (rev 25108)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2010-09-22 21:09:06 UTC (rev 25109)
@@ -19,9 +19,11 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.jcr.nodetype.NodeType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
@@ -37,6 +39,7 @@
import org.modeshape.web.jcr.rest.client.IRestClient;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
+import org.modeshape.web.jcr.rest.client.domain.QueryRow;
import org.modeshape.web.jcr.rest.client.domain.Repository;
import org.modeshape.web.jcr.rest.client.domain.Server;
import org.modeshape.web.jcr.rest.client.domain.Workspace;
@@ -241,6 +244,7 @@
* @throws RuntimeException if the server is not registered
* @see #isRegistered(Server)
*/
+ @Override
public Collection<Repository> getRepositories( Server server ) throws Exception {
CheckArg.isNotNull(server, "server");
@@ -265,6 +269,7 @@
* @see org.modeshape.web.jcr.rest.client.IRestClient#getUrl(java.io.File, java.lang.String,
* org.modeshape.web.jcr.rest.client.domain.Workspace)
*/
+ @Override
public URL getUrl( File file,
String path,
Workspace workspace ) throws Exception {
@@ -278,6 +283,7 @@
* @throws RuntimeException if the server is not registered
* @see #isRegistered(Server)
*/
+ @Override
public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
CheckArg.isNotNull(repository, "repository");
@@ -484,6 +490,7 @@
* java.lang.String, java.io.File)
* @see #isRegistered(Server)
*/
+ @Override
public Status publish( Workspace workspace,
String path,
File file ) {
@@ -626,6 +633,7 @@
* java.lang.String, java.io.File)
* @see #isRegistered(Server)
*/
+ @Override
public Status unpublish( Workspace workspace,
String path,
File file ) {
@@ -685,4 +693,68 @@
status.getException());
}
+ /**
+ * {@inheritDoc}
+ *
+ * @throws UnsupportedOperationException if this method is called
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#getNodeTypes(org.modeshape.web.jcr.rest.client.domain.Workspace)
+ */
+ @Override
+ public Map<String, NodeType> getNodeTypes( Workspace workspace ) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p>
+ * <strong>This method is unsupported and should not be called.</strong>
+ *
+ * @throws UnsupportedOperationException if this method is called
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.lang.String)
+ */
+ @Override
+ public List<QueryRow> query( Workspace arg0,
+ String arg1,
+ String arg2 ) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p>
+ * <strong>This method is unsupported and should not be called.</strong>
+ *
+ * @throws UnsupportedOperationException if this method is called
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.lang.String, int, int)
+ */
+ @Override
+ public List<QueryRow> query( Workspace arg0,
+ String arg1,
+ String arg2,
+ int arg3,
+ int arg4 ) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * {@inheritDoc}
+ * <p>
+ * <strong>This method is unsupported and should not be called.</strong>
+ *
+ * @throws UnsupportedOperationException if this method is called
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.lang.String, int, int, java.util.Map)
+ */
+ @Override
+ public List<QueryRow> query( Workspace arg0,
+ String arg1,
+ String arg2,
+ int arg3,
+ int arg4,
+ Map<String, String> arg5 ) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
}
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java 2010-09-22 21:05:55 UTC (rev 25108)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java 2010-09-22 21:09:06 UTC (rev 25109)
@@ -14,8 +14,12 @@
import java.io.File;
import java.net.URL;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import javax.jcr.nodetype.NodeType;
import org.modeshape.web.jcr.rest.client.IRestClient;
import org.modeshape.web.jcr.rest.client.Status;
+import org.modeshape.web.jcr.rest.client.domain.QueryRow;
import org.modeshape.web.jcr.rest.client.domain.Repository;
import org.modeshape.web.jcr.rest.client.domain.Server;
import org.modeshape.web.jcr.rest.client.domain.Workspace;
@@ -25,15 +29,22 @@
*/
public final class MockRestClient implements IRestClient {
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#getNodeTypes(org.modeshape.web.jcr.rest.client.domain.Workspace)
+ */
+ @Override
+ public Map<String, NodeType> getNodeTypes( Workspace arg0 ) throws Exception {
+ return null;
+ }
/**
* {@inheritDoc}
*
* @see org.modeshape.web.jcr.rest.client.IRestClient#getRepositories(org.modeshape.web.jcr.rest.client.domain.Server)
*/
+ @Override
public Collection<Repository> getRepositories( Server server ) throws Exception {
return null;
}
@@ -44,6 +55,7 @@
* @see org.modeshape.web.jcr.rest.client.IRestClient#getUrl(java.io.File, java.lang.String,
* org.modeshape.web.jcr.rest.client.domain.Workspace)
*/
+ @Override
public URL getUrl( File file,
String path,
Workspace workspace ) throws Exception {
@@ -55,6 +67,7 @@
*
* @see org.modeshape.web.jcr.rest.client.IRestClient#getWorkspaces(org.modeshape.web.jcr.rest.client.domain.Repository)
*/
+ @Override
public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
return null;
}
@@ -65,6 +78,7 @@
* @see org.modeshape.web.jcr.rest.client.IRestClient#publish(org.modeshape.web.jcr.rest.client.domain.Workspace,
* java.lang.String, java.io.File)
*/
+ @Override
public Status publish( Workspace workspace,
String path,
File file ) {
@@ -77,10 +91,55 @@
* @see org.modeshape.web.jcr.rest.client.IRestClient#unpublish(org.modeshape.web.jcr.rest.client.domain.Workspace,
* java.lang.String, java.io.File)
*/
+ @Override
public Status unpublish( Workspace workspace,
String path,
File file ) {
return null;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.lang.String)
+ */
+ @Override
+ public List<QueryRow> query( Workspace arg0,
+ String arg1,
+ String arg2 ) throws Exception {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.lang.String, int, int)
+ */
+ @Override
+ public List<QueryRow> query( Workspace arg0,
+ String arg1,
+ String arg2,
+ int arg3,
+ int arg4 ) throws Exception {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.lang.String, int, int, java.util.Map)
+ */
+ @Override
+ public List<QueryRow> query( Workspace arg0,
+ String arg1,
+ String arg2,
+ int arg3,
+ int arg4,
+ Map<String, String> arg5 ) throws Exception {
+ return null;
+ }
+
}
15 years, 7 months
JBoss Tools SVN: r25108 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test: src/org/jboss/tools/jsf/jsp/ca/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-22 17:05:55 -0400 (Wed, 22 Sep 2010)
New Revision: 25108
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
JBIDE-7123
Create JUnit test for JBIDE-6259: Add an option to Preferences to disable/enable code completion for getteres and setters in EL.
JUnit test is moved to UI plugin
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2010-09-22 21:02:05 UTC (rev 25107)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2010-09-22 21:05:55 UTC (rev 25108)
@@ -23,6 +23,7 @@
org.jboss.tools.jsf.text.ext.richfaces,
org.eclipse.wst.server.core;bundle-version="1.1.202",
org.eclipse.jst.server.tomcat.core;bundle-version="1.1.200",
- org.eclipse.ui;bundle-version="3.6.0"
+ org.eclipse.ui;bundle-version="3.6.0",
+ org.jboss.tools.common.el.core;bundle-version="3.2.0"
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Copied: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java (from rev 24999, trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1704Test.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1704Test.java 2010-09-22 21:05:55 UTC (rev 25108)
@@ -0,0 +1,115 @@
+package org.jboss.tools.jsf.jsp.ca.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+public class JsfJspJbide1704Test extends ContentAssistantTestCase {
+ TestProjectProvider provider = null;
+
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "JsfJbide1704Test";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting";
+
+ public static Test suite() {
+ return new TestSuite(JsfJspJbide1704Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.ui.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testJspJbide1704 () {
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+ doTestJsfJspJbide1704(PAGE_NAME + ".jsp");
+ }
+
+ public void testXhtmlJbide1704 () {
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+ doTestJsfJspJbide1704(PAGE_NAME + ".xhtml");
+ }
+
+ private static final String TEST_RESOURCES_VALUE = "\"resources\"";
+
+ private void doTestJsfJspJbide1704(String pageName) {
+
+ openEditor(pageName);
+
+ try {
+
+ final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ " var=\"msg\"", true, true, false, false);
+ String text = document.get();
+ String errorMessage = null;
+
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
+
+ assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
+
+ for (ICompletionProposal proposal : res) {
+ // There should not be a proposal of type AutoContentAssistantProposal in the result
+ // (the only exclusion is EL-proposals)
+
+ if (proposal instanceof AutoContentAssistantProposal) {
+ if(((AutoContentAssistantProposal)proposal).getReplacementString().startsWith("#{")) {
+ // The only EL template proposal is allowed to be shown here
+ continue;
+ }
+ }
+
+
+ if (proposal instanceof CustomCompletionProposal) {
+ // There are two cases are allowed to be shown
+ // AutoContentAssistantProposal which returns the "resources" string as replacement
+ // CustomCompletionProposal which returns the current value string as replacement
+
+ if (!(proposal instanceof AutoContentAssistantProposal)) {
+ int equalSignIndex = text.lastIndexOf('=', reg.getOffset());
+ if (equalSignIndex != -1) {
+ String prevAttrValue = text.substring(equalSignIndex+1, reg.getOffset()).trim();
+ if (((CustomCompletionProposal)proposal).getReplacementString().equals(prevAttrValue)){
+ // The old value for the attribute is allowed to be shown here
+ continue;
+ }
+ }
+ } else {
+ if (((CustomCompletionProposal)proposal).getReplacementString().equals(TEST_RESOURCES_VALUE)){
+ // The old value for the attribute is allowed to be shown here
+ continue;
+ }
+
+ }
+ }
+
+ assertFalse("Content Assistant peturned proposals of type (" + proposal.getClass().getName() + ").", (proposal instanceof AutoContentAssistantProposal));
+ }
+
+ } catch (BadLocationException e) {
+ fail(e.getMessage());
+ }
+
+ closeEditor();
+ }
+
+}
Copied: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java (from rev 24999, trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1717Test.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide1717Test.java 2010-09-22 21:05:55 UTC (rev 25108)
@@ -0,0 +1,117 @@
+package org.jboss.tools.jsf.jsp.ca.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+
+public class JsfJspJbide1717Test extends ContentAssistantTestCase {
+ TestProjectProvider provider = null;
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "JsfJbide1704Test";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
+ private static final String INSERT_BEFORE_STRING = "<h:outputText";
+ private static final String INSERTION_BEGIN_STRING = "<h:outputText value=\"";
+ private static final String INSERTION_END_STRING = "\" />";
+ private static final String JSF_EXPR_STRING = "#{msg.greeting}";
+
+ public static Test suite() {
+ return new TestSuite(JsfJspJbide1717Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.ui.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testJstJspJbide1717() {
+ openEditor(PAGE_NAME);
+
+ // Find start of <h:outputText> tag
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
+
+ assertTrue("Cannot find the starting point in the test file \"" + PAGE_NAME + "\"", (start != -1));
+
+ // First of all perform the test on a region placed in one space behind empty-valued attribute -
+ // this is to return normal list of attribute names proposal list
+
+ String documentContentModified = documentContent.substring(0, start) +
+ INSERTION_BEGIN_STRING + INSERTION_END_STRING + documentContent.substring(start);
+
+ int offsetToTest = start + INSERTION_BEGIN_STRING.length() + 2;
+
+ jspTextEditor.setText(documentContentModified);
+
+ String errorMessage = null;
+
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ List<String> customCompletionProposals = new ArrayList<String>();
+
+ if (res != null) {
+ for (ICompletionProposal proposal : res) {
+ // There should be at least one proposal of type CustomCompletionProposal in the result
+ if (proposal instanceof CustomCompletionProposal) {
+ customCompletionProposals.add(((CustomCompletionProposal)proposal).getReplacementString());
+ }
+ }
+ }
+ assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
+
+ try {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+
+ // Next perform the test on a region placed in one space behind an attribute those value is a container
+ // (contains JSF expression) - this has to return the same normal list of attribute names proposal list as
+ // we got at the first step (because the tag is the same, but only the attribute value is changed)
+
+ documentContentModified = documentContent.substring(0, start) +
+ INSERTION_BEGIN_STRING + JSF_EXPR_STRING + INSERTION_END_STRING + documentContent.substring(start);
+
+ offsetToTest = start + INSERTION_BEGIN_STRING.length() + JSF_EXPR_STRING.length() + 2;
+
+ String visualizeCursorPosition = documentContentModified.substring(0, offsetToTest) +
+ "|" + documentContentModified.substring(offsetToTest);
+
+ jspTextEditor.setText(documentContentModified);
+
+ res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ if (res != null) {
+ for (ICompletionProposal proposal : res) {
+ // There should be the same proposals as in the saved result
+ if (proposal instanceof CustomCompletionProposal) {
+ assertTrue("Content Assistant returned additional proposal (proposal returned doesn't exist in the saved list).",
+ customCompletionProposals.contains(((CustomCompletionProposal)proposal).getReplacementString()));
+ customCompletionProposals.remove(((CustomCompletionProposal)proposal).getReplacementString());
+ }
+ }
+ }
+ assertTrue("Content Assistant didn't returned some proposals.",customCompletionProposals.isEmpty());
+
+ closeEditor();
+ }
+
+
+}
Copied: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java (from rev 25102, trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide6259Test.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JsfJspJbide6259Test.java 2010-09-22 21:05:55 UTC (rev 25108)
@@ -0,0 +1,184 @@
+package org.jboss.tools.jsf.jsp.ca.test;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.jboss.tools.common.el.core.ELCorePlugin;
+import org.jboss.tools.common.el.core.ca.preferences.ELContentAssistPreferences;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.contentassist.AutoELContentAssistantProposal;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+public class JsfJspJbide6259Test extends ContentAssistantTestCase {
+ TestProjectProvider provider = null;
+
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "JsfJbide1704Test";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
+
+ public static Test suite() {
+ return new TestSuite(JsfJspJbide1704Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.ui.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ private static final String EXPRESSION_STRING = "#{person.";
+ private static final String[] TEST_PROPOSAL_EMPTY_SET_EMPTY = new String[0];
+ private static final String[] TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_TRUE = {
+ "name",
+ "getName",
+ "getName()"
+ };
+ private static final String[] TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE = {
+ "name"
+ };
+ private static final String[] TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE_WRONG_CASES = {
+ "getName",
+ "getName()"
+ };
+ private static final String[] TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE = {
+ "getName()"
+ };
+ private static final String[] TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE_WRONG_CASES = {
+ "getName"
+ };
+ private static final String[] TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_FALSE = {
+ "getName",
+ "getName()"
+ };
+
+ private void testProposals (List<ICompletionProposal> proposals, String[] testCases, String[] wrongCases) {
+ // testCases is the array of proposals which are strict to be present
+ // wrongCases is the array of proposals which are strict to be absent
+
+ Set<String> existingCases = new HashSet<String>();
+ for (ICompletionProposal p : proposals) {
+ if (!(p instanceof AutoELContentAssistantProposal))
+ continue;
+
+ AutoELContentAssistantProposal proposal = (AutoELContentAssistantProposal)p;
+ String replacement = proposal.getReplacementString();
+ if (replacement == null)
+ continue;
+
+ if (replacement.indexOf('.') > -1) {
+ replacement = replacement.substring(replacement.lastIndexOf('.') + 1);
+ }
+
+ for (int i = 0; i < testCases.length; i++) {
+ if (replacement.equals(testCases[i])) {
+ existingCases.add(testCases[i]); // add the proposal to existing set
+ continue;
+ }
+ }
+
+ for (int i = 0; i < wrongCases.length; i++) {
+ assertFalse("The proposal \'" + replacement + "\' is not allowed to be shown!", replacement.equals(wrongCases[i]));
+ }
+ }
+ assertTrue("Not all the required proposals are present!", (existingCases.size() == testCases.length));
+ }
+
+ private void setupELContentAssistPreferences(boolean methodsWithParenthesesOnly, boolean showGettersAndSetters) {
+ ELCorePlugin.getDefault().getPreferenceStore().setValue(ELContentAssistPreferences.SHOW_METHODS_WITH_PARENTHESES_ONLY, methodsWithParenthesesOnly);
+ ELCorePlugin.getDefault().getPreferenceStore().setValue(ELContentAssistPreferences.SHOW_GETTERS_AND_SETTERS, showGettersAndSetters);
+ }
+
+ public void testJspJbide6259 () {
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+
+ openEditor(PAGE_NAME);
+
+ try {
+
+ final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ EXPRESSION_STRING, true, true, false, false);
+ String errorMessage = null;
+
+ int offsetToTest = reg.getOffset() + EXPRESSION_STRING.length();
+
+ // Test method presentations: with and without parentheses
+
+ // Set up EL Content Assist preferences to:
+ // methods are to be shown with and without parentheses
+ // getters and setters are to be shown
+ setupELContentAssistPreferences(false, true);
+
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
+
+ testProposals(res, TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_FALSE, TEST_PROPOSAL_EMPTY_SET_EMPTY);
+
+ // Test method presentations: with parentheses only
+
+ // Set up EL Content Assist preferences to:
+ // methods are to be shown with parentheses only
+ // getters and setters are to be shown
+
+ setupELContentAssistPreferences(true, true);
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
+ res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
+
+ testProposals(res, TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE, TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE_WRONG_CASES);
+
+ // Test property presentations: property name, getters and setters are to be shown
+
+ // Set up EL Content Assist preferences to:
+ // methods are to be shown with and without parentheses
+ // getters and setters are to be shown
+
+ setupELContentAssistPreferences(false, true);
+
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
+ res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
+
+ testProposals(res, TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_TRUE, TEST_PROPOSAL_EMPTY_SET_EMPTY);
+
+ // Test property presentations: the only property name is to be shown
+
+ // Set up EL Content Assist preferences to:
+ // methods are to be shown with and without parentheses
+ // getters and setters are to be shown
+
+ setupELContentAssistPreferences(false, false);
+
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
+ res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
+
+ testProposals(res, TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE, TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE_WRONG_CASES);
+
+ } catch (BadLocationException e) {
+ fail(e.getMessage());
+ }
+
+ closeEditor();
+ }
+
+}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-09-22 21:02:05 UTC (rev 25107)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-09-22 21:05:55 UTC (rev 25108)
@@ -23,6 +23,9 @@
import org.jboss.tools.jsf.jsp.ca.test.CASuggestsNotOnlyELProposalsJBIDE2437Test;
import org.jboss.tools.jsf.jsp.ca.test.CAUnnecessaryElementsForDirAttributeInXHTMLPageJBIDE1813Test;
import org.jboss.tools.jsf.jsp.ca.test.CAVarAttributeForDataTableTagJBIDE2016;
+import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide1704Test;
+import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide1717Test;
+import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide6259Test;
import org.jboss.tools.jsf.jsp.ca.test.MissingKBBuilderTest;
import org.jboss.tools.jsf.ui.test.refactoring.ELReferencesRenameTest;
import org.jboss.tools.jsf.ui.test.AddJSFCapabilitiesTest;
@@ -49,7 +52,11 @@
suite.addTestSuite(FasesConfigEditorTest.class);
suite.addTestSuite(PropertiesNewWizardTest.class);
suite.addTestSuite(JsfUiPreferencesPagesTest.class);
- suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ suite.addTestSuite(JsfJspJbide6259Test.class);
+ suite.addTestSuite(JsfJspJbide1704Test.class);
+ suite.addTestSuite(JsfJspJbide1717Test.class);
+
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
ELReferencesRenameTest.class), "org.jboss.tools.jsf.ui.test", //$NON-NLS-1$
new String[] { "projects/testJSFProject", }, //$NON-NLS-1$
new String[] { "testJSFProject" })); //$NON-NLS-1$
@@ -69,6 +76,7 @@
"org.jboss.tools.jsf.ui.test",
new String[]{"projects/test_jsf_project"},
new String[]{"test_jsf_project"}));
+
return new TestWizardsProject(suite);
}
}
\ No newline at end of file
15 years, 7 months
JBoss Tools SVN: r25107 - in trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf: test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-22 17:02:05 -0400 (Wed, 22 Sep 2010)
New Revision: 25107
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1704Test.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1717Test.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide6259Test.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfCATests.java
Log:
JBIDE-7123
Create JUnit test for JBIDE-6259: Add an option to Preferences to disable/enable code completion for getteres and setters in EL.
JUnit test is moved to UI plugin
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1704Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1704Test.java 2010-09-22 20:59:40 UTC (rev 25106)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1704Test.java 2010-09-22 21:02:05 UTC (rev 25107)
@@ -1,115 +0,0 @@
-package org.jboss.tools.jsf.ca.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class JsfJspJbide1704Test extends ContentAssistantTestCase {
- TestProjectProvider provider = null;
-
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJbide1704Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting";
-
- public static Test suite() {
- return new TestSuite(JsfJspJbide1704Test.class);
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testJspJbide1704 () {
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
- doTestJsfJspJbide1704(PAGE_NAME + ".jsp");
- }
-
- public void testXhtmlJbide1704 () {
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
- doTestJsfJspJbide1704(PAGE_NAME + ".xhtml");
- }
-
- private static final String TEST_RESOURCES_VALUE = "\"resources\"";
-
- private void doTestJsfJspJbide1704(String pageName) {
-
- openEditor(pageName);
-
- try {
-
- final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- " var=\"msg\"", true, true, false, false);
- String text = document.get();
- String errorMessage = null;
-
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
-
- assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
-
- for (ICompletionProposal proposal : res) {
- // There should not be a proposal of type AutoContentAssistantProposal in the result
- // (the only exclusion is EL-proposals)
-
- if (proposal instanceof AutoContentAssistantProposal) {
- if(((AutoContentAssistantProposal)proposal).getReplacementString().startsWith("#{")) {
- // The only EL template proposal is allowed to be shown here
- continue;
- }
- }
-
-
- if (proposal instanceof CustomCompletionProposal) {
- // There are two cases are allowed to be shown
- // AutoContentAssistantProposal which returns the "resources" string as replacement
- // CustomCompletionProposal which returns the current value string as replacement
-
- if (!(proposal instanceof AutoContentAssistantProposal)) {
- int equalSignIndex = text.lastIndexOf('=', reg.getOffset());
- if (equalSignIndex != -1) {
- String prevAttrValue = text.substring(equalSignIndex+1, reg.getOffset()).trim();
- if (((CustomCompletionProposal)proposal).getReplacementString().equals(prevAttrValue)){
- // The old value for the attribute is allowed to be shown here
- continue;
- }
- }
- } else {
- if (((CustomCompletionProposal)proposal).getReplacementString().equals(TEST_RESOURCES_VALUE)){
- // The old value for the attribute is allowed to be shown here
- continue;
- }
-
- }
- }
-
- assertFalse("Content Assistant peturned proposals of type (" + proposal.getClass().getName() + ").", (proposal instanceof AutoContentAssistantProposal));
- }
-
- } catch (BadLocationException e) {
- fail(e.getMessage());
- }
-
- closeEditor();
- }
-
-}
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1717Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1717Test.java 2010-09-22 20:59:40 UTC (rev 25106)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide1717Test.java 2010-09-22 21:02:05 UTC (rev 25107)
@@ -1,117 +0,0 @@
-package org.jboss.tools.jsf.ca.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.TestProjectProvider;
-
-
-public class JsfJspJbide1717Test extends ContentAssistantTestCase {
- TestProjectProvider provider = null;
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJbide1704Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
- private static final String INSERT_BEFORE_STRING = "<h:outputText";
- private static final String INSERTION_BEGIN_STRING = "<h:outputText value=\"";
- private static final String INSERTION_END_STRING = "\" />";
- private static final String JSF_EXPR_STRING = "#{msg.greeting}";
-
- public static Test suite() {
- return new TestSuite(JsfJspJbide1717Test.class);
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- public void testJstJspJbide1717() {
- openEditor(PAGE_NAME);
-
- // Find start of <h:outputText> tag
- String documentContent = document.get();
- int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
-
- assertTrue("Cannot find the starting point in the test file \"" + PAGE_NAME + "\"", (start != -1));
-
- // First of all perform the test on a region placed in one space behind empty-valued attribute -
- // this is to return normal list of attribute names proposal list
-
- String documentContentModified = documentContent.substring(0, start) +
- INSERTION_BEGIN_STRING + INSERTION_END_STRING + documentContent.substring(start);
-
- int offsetToTest = start + INSERTION_BEGIN_STRING.length() + 2;
-
- jspTextEditor.setText(documentContentModified);
-
- String errorMessage = null;
-
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
-
- List<String> customCompletionProposals = new ArrayList<String>();
-
- if (res != null) {
- for (ICompletionProposal proposal : res) {
- // There should be at least one proposal of type CustomCompletionProposal in the result
- if (proposal instanceof CustomCompletionProposal) {
- customCompletionProposals.add(((CustomCompletionProposal)proposal).getReplacementString());
- }
- }
- }
- assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
-
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
-
- // Next perform the test on a region placed in one space behind an attribute those value is a container
- // (contains JSF expression) - this has to return the same normal list of attribute names proposal list as
- // we got at the first step (because the tag is the same, but only the attribute value is changed)
-
- documentContentModified = documentContent.substring(0, start) +
- INSERTION_BEGIN_STRING + JSF_EXPR_STRING + INSERTION_END_STRING + documentContent.substring(start);
-
- offsetToTest = start + INSERTION_BEGIN_STRING.length() + JSF_EXPR_STRING.length() + 2;
-
- String visualizeCursorPosition = documentContentModified.substring(0, offsetToTest) +
- "|" + documentContentModified.substring(offsetToTest);
-
- jspTextEditor.setText(documentContentModified);
-
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
-
- if (res != null) {
- for (ICompletionProposal proposal : res) {
- // There should be the same proposals as in the saved result
- if (proposal instanceof CustomCompletionProposal) {
- assertTrue("Content Assistant returned additional proposal (proposal returned doesn't exist in the saved list).",
- customCompletionProposals.contains(((CustomCompletionProposal)proposal).getReplacementString()));
- customCompletionProposals.remove(((CustomCompletionProposal)proposal).getReplacementString());
- }
- }
- }
- assertTrue("Content Assistant didn't returned some proposals.",customCompletionProposals.isEmpty());
-
- closeEditor();
- }
-
-
-}
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide6259Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide6259Test.java 2010-09-22 20:59:40 UTC (rev 25106)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/test/JsfJspJbide6259Test.java 2010-09-22 21:02:05 UTC (rev 25107)
@@ -1,184 +0,0 @@
-package org.jboss.tools.jsf.ca.test;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.jboss.tools.common.el.core.ELCorePlugin;
-import org.jboss.tools.common.el.core.ca.preferences.ELContentAssistPreferences;
-import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.contentassist.AutoELContentAssistantProposal;
-import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
-import org.jboss.tools.test.util.TestProjectProvider;
-
-public class JsfJspJbide6259Test extends ContentAssistantTestCase {
- TestProjectProvider provider = null;
-
- boolean makeCopy = false;
- private static final String PROJECT_NAME = "JsfJbide1704Test";
- private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
-
- public static Test suite() {
- return new TestSuite(JsfJspJbide1704Test.class);
- }
-
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, PROJECT_NAME, makeCopy);
- project = provider.getProject();
- }
-
- protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
- }
- }
-
- private static final String EXPRESSION_STRING = "#{person.";
- private static final String[] TEST_PROPOSAL_EMPTY_SET_EMPTY = new String[0];
- private static final String[] TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_TRUE = {
- "name",
- "getName",
- "getName()"
- };
- private static final String[] TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE = {
- "name"
- };
- private static final String[] TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE_WRONG_CASES = {
- "getName",
- "getName()"
- };
- private static final String[] TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE = {
- "getName()"
- };
- private static final String[] TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE_WRONG_CASES = {
- "getName"
- };
- private static final String[] TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_FALSE = {
- "getName",
- "getName()"
- };
-
- private void testProposals (List<ICompletionProposal> proposals, String[] testCases, String[] wrongCases) {
- // testCases is the array of proposals which are strict to be present
- // wrongCases is the array of proposals which are strict to be absent
-
- Set<String> existingCases = new HashSet<String>();
- for (ICompletionProposal p : proposals) {
- if (!(p instanceof AutoELContentAssistantProposal))
- continue;
-
- AutoELContentAssistantProposal proposal = (AutoELContentAssistantProposal)p;
- String replacement = proposal.getReplacementString();
- if (replacement == null)
- continue;
-
- if (replacement.indexOf('.') > -1) {
- replacement = replacement.substring(replacement.lastIndexOf('.') + 1);
- }
-
- for (int i = 0; i < testCases.length; i++) {
- if (replacement.equals(testCases[i])) {
- existingCases.add(testCases[i]); // add the proposal to existing set
- continue;
- }
- }
-
- for (int i = 0; i < wrongCases.length; i++) {
- assertFalse("The proposal \'" + replacement + "\' is not allowed to be shown!", replacement.equals(wrongCases[i]));
- }
- }
- assertTrue("Not all the required proposals are present!", (existingCases.size() == testCases.length));
- }
-
- private void setupELContentAssistPreferences(boolean methodsWithParenthesesOnly, boolean showGettersAndSetters) {
- ELCorePlugin.getDefault().getPreferenceStore().setValue(ELContentAssistPreferences.SHOW_METHODS_WITH_PARENTHESES_ONLY, methodsWithParenthesesOnly);
- ELCorePlugin.getDefault().getPreferenceStore().setValue(ELContentAssistPreferences.SHOW_GETTERS_AND_SETTERS, showGettersAndSetters);
- }
-
- public void testJspJbide6259 () {
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
-
- openEditor(PAGE_NAME);
-
- try {
-
- final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- EXPRESSION_STRING, true, true, false, false);
- String errorMessage = null;
-
- int offsetToTest = reg.getOffset() + EXPRESSION_STRING.length();
-
- // Test method presentations: with and without parentheses
-
- // Set up EL Content Assist preferences to:
- // methods are to be shown with and without parentheses
- // getters and setters are to be shown
- setupELContentAssistPreferences(false, true);
-
- List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
-
- assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
-
- testProposals(res, TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_FALSE, TEST_PROPOSAL_EMPTY_SET_EMPTY);
-
- // Test method presentations: with parentheses only
-
- // Set up EL Content Assist preferences to:
- // methods are to be shown with parentheses only
- // getters and setters are to be shown
-
- setupELContentAssistPreferences(true, true);
- TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
-
- assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
-
- testProposals(res, TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE, TEST_PROPOSAL_METHODS_WITH_PARENTHESES_ONLY_TRUE_WRONG_CASES);
-
- // Test property presentations: property name, getters and setters are to be shown
-
- // Set up EL Content Assist preferences to:
- // methods are to be shown with and without parentheses
- // getters and setters are to be shown
-
- setupELContentAssistPreferences(false, true);
-
- TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
-
- assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
-
- testProposals(res, TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_TRUE, TEST_PROPOSAL_EMPTY_SET_EMPTY);
-
- // Test property presentations: the only property name is to be shown
-
- // Set up EL Content Assist preferences to:
- // methods are to be shown with and without parentheses
- // getters and setters are to be shown
-
- setupELContentAssistPreferences(false, false);
-
- TestUtil.prepareCAInvokation(contentAssistant, viewer, 0); // drop the CA Window
- res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
-
- assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
-
- testProposals(res, TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE, TEST_PROPOSAL_SET_GETTERS_AND_SETTERS_FALSE_WRONG_CASES);
-
- } catch (BadLocationException e) {
- fail(e.getMessage());
- }
-
- closeEditor();
- }
-
-}
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfCATests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfCATests.java 2010-09-22 20:59:40 UTC (rev 25106)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfCATests.java 2010-09-22 21:02:05 UTC (rev 25107)
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.test;
-
-import org.jboss.tools.jsf.ca.test.JsfJspJbide1704Test;
-import org.jboss.tools.jsf.ca.test.JsfJspJbide1717Test;
-import org.jboss.tools.jsf.ca.test.JsfJspJbide6259Test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JsfCATests {
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.jboss.tools.jsf.test");
-
- suite.addTestSuite(JsfJspJbide6259Test.class);
- suite.addTestSuite(JsfJspJbide1704Test.class);
- suite.addTestSuite(JsfJspJbide1717Test.class);
-
- return suite;
- }
-}
15 years, 7 months
JBoss Tools SVN: r25106 - trunk/jsf/tests/org.jboss.tools.jsf.test/projects.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-22 16:59:40 -0400 (Wed, 22 Sep 2010)
New Revision: 25106
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide1704Test/
Log:
JBIDE-7123
Create JUnit test for JBIDE-6259: Add an option to Preferences to disable/enable code completion for getteres and setters in EL.
JUnit test is moved to UI plugin
15 years, 7 months
JBoss Tools SVN: r25105 - trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-09-22 14:00:29 -0400 (Wed, 22 Sep 2010)
New Revision: 25105
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
Log:
Fixing build issue again... one more time, with feeling...
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-09-22 17:54:32 UTC (rev 25104)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-09-22 18:00:29 UTC (rev 25105)
@@ -36,7 +36,7 @@
org.eclipse.osgi,
org.eclipse.jst.ws.annotations.core,
org.apache.commons.codec,
- javax.xml.soap;bundle-version="1.2.0"
+ javax.xml.soap;bundle-version="[1.2.0,1.3.0)"
Bundle-ActivationPolicy: lazy
Export-Package: javax.ws.rs,
javax.ws.rs.core,
15 years, 7 months
JBoss Tools SVN: r25104 - trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-09-22 13:54:32 -0400 (Wed, 22 Sep 2010)
New Revision: 25104
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
Log:
Fixing build issue again...
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-09-22 17:20:40 UTC (rev 25103)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-09-22 17:54:32 UTC (rev 25104)
@@ -36,7 +36,7 @@
org.eclipse.osgi,
org.eclipse.jst.ws.annotations.core,
org.apache.commons.codec,
- javax.xml.soap
+ javax.xml.soap;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy
Export-Package: javax.ws.rs,
javax.ws.rs.core,
15 years, 7 months
JBoss Tools SVN: r25103 - trunk/jsf/tests/org.jboss.tools.jsf.test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-22 13:20:40 -0400 (Wed, 22 Sep 2010)
New Revision: 25103
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/pom.xml
Log:
JBIDE-6404
https://jira.jboss.org/browse/JBIDE-6404
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/pom.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/pom.xml 2010-09-22 16:53:47 UTC (rev 25102)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/pom.xml 2010-09-22 17:20:40 UTC (rev 25103)
@@ -9,7 +9,7 @@
<groupId>org.jboss.tools.jsf.tests</groupId>
<artifactId>org.jboss.tools.jsf.test</artifactId>
<version>3.2.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
+ <packaging>eclipse-test-plugin</packaging>
<properties>
<emma.filter>org.jboss.tools.jsf*</emma.filter>
15 years, 7 months