JBoss Tools SVN: r40181 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-13 11:37:56 -0400 (Fri, 13 Apr 2012)
New Revision: 40181
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/requirements.properties
Log:
added portlet bridge to requirements.
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-04-13 15:36:26 UTC (rev 40180)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-04-13 15:37:56 UTC (rev 40181)
@@ -17,9 +17,10 @@
<jbosstools.test.jboss-seam-2.2.home>${requirement.build.root}/jboss-seam-2.2.1.Final</jbosstools.test.jboss-seam-2.2.home>
<jbosstools.test.jboss-portal.home>${requirement.build.root}/jboss-portal-2.7.2</jbosstools.test.jboss-portal.home>
<jbosstools.test.jboss-seam-2.0.home>${requirement.build.root}/jboss-seam-2.0.1.GA</jbosstools.test.jboss-seam-2.0.home>
+ <jbosstools.test.jboss-portlet-bridge.home>${requirement.build.root}</jbosstools.test.jboss-portlet-bridge.home>
<configurations.dir>resources/project_config_files</configurations.dir>
<additionalSystemProperties></additionalSystemProperties>
- <systemProperties>${additionalSystemProperties} -Djbosstools.test.jboss-gatein.home=${jbosstools.test.jboss-gatein.home} -Djbosstools.test.jboss-seam-2.2.home=${jbosstools.test.jboss-seam-2.2.home} -Djbosstools.test.jboss-portal.home=${jbosstools.test.jboss-portal.home} -Djbosstools.test.jboss-seam-2.0.home=${jbosstools.test.jboss-seam-2.0.home} -Dtest.configurations.dir=${configurations.dir} -Dorg.eclipse.swtbot.screenshots.dir=${project.build.directory}/screenshots</systemProperties>
+ <systemProperties>${additionalSystemProperties} -Djbosstools.test.jboss-gatein.home=${jbosstools.test.jboss-gatein.home} -Djbosstools.test.jboss-seam-2.2.home=${jbosstools.test.jboss-seam-2.2.home} -Djbosstools.test.jboss-portal.home=${jbosstools.test.jboss-portal.home} -Djbosstools.test.jboss-seam-2.0.home=${jbosstools.test.jboss-seam-2.0.home} -Djbosstools.test.jboss-portlet-bridge.home=${jbosstools.test.jboss-portlet-bridge.home} -Dtest.configurations.dir=${configurations.dir} -Dorg.eclipse.swtbot.screenshots.dir=${project.build.directory}/screenshots</systemProperties>
<test.class>org.jboss.tools.portlet.ui.bot.test.AllTestsSuite</test.class>
</properties>
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/requirements.properties
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/requirements.properties 2012-04-13 15:36:26 UTC (rev 40180)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/requirements.properties 2012-04-13 15:37:56 UTC (rev 40181)
@@ -1 +1 @@
-requirements=gatein-3.1.0.Final,seam-2.2.1.Final,JBoss-Portal-2.7.2.GA,seam-2.0.1.GA
\ No newline at end of file
+requirements=gatein-3.1.0.Final,seam-2.2.1.Final,JBoss-Portal-2.7.2.GA,seam-2.0.1.GA,JBossPortletBridge-2.1.0.FINAL
\ No newline at end of file
13 years, 8 months
JBoss Tools SVN: r40180 - in trunk/requirements: JBossPortletBridge-2.1.0.FINAL and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-13 11:36:26 -0400 (Fri, 13 Apr 2012)
New Revision: 40180
Added:
trunk/requirements/JBossPortletBridge-2.1.0.FINAL/
trunk/requirements/JBossPortletBridge-2.1.0.FINAL/build.properties
Log:
Added jboss portlet bridge.
Added: trunk/requirements/JBossPortletBridge-2.1.0.FINAL/build.properties
===================================================================
--- trunk/requirements/JBossPortletBridge-2.1.0.FINAL/build.properties (rev 0)
+++ trunk/requirements/JBossPortletBridge-2.1.0.FINAL/build.properties 2012-04-13 15:36:26 UTC (rev 40180)
@@ -0,0 +1,3 @@
+build.uri=http://sourceforge.net/projects/jboss/files/JBoss%20Portal/JBossPortletBridge-2.1.0.FINAL/
+build.archive=JBossPortletBridge-2.1.0.FINAL.zip
+md5=44a7b67d0b6e0995bec97e8c81bacab3
\ No newline at end of file
13 years, 8 months
JBoss Tools SVN: r40179 - trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-04-13 10:23:41 -0400 (Fri, 13 Apr 2012)
New Revision: 40179
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
Log:
JBIDE-11492
When inserting methods with parameters, CA sets cursor incorrectly
Issue is fixed.
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2012-04-13 14:04:18 UTC (rev 40178)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2012-04-13 14:23:41 UTC (rev 40179)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Copyright (c) 2007-2012 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,
@@ -146,7 +146,7 @@
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(IDocument)
*/
public Point getSelection(IDocument document) {
- return new Point(fNewPosition, 0);
+ return new Point(getCursorPosition(), 0);
}
/*
@@ -447,7 +447,22 @@
* Return cursor position of proposal replacement string.
*/
public int getCursorPosition() {
- return fNewPosition;
+ int cursorPosition = -1;
+
+ int openingQuoteInReplacement = fString.lastIndexOf('(');
+ int closingQuoteInReplacement = fString.lastIndexOf(')');
+ int openingQuoteInDisplay = fDisplayString.lastIndexOf('(');
+ int closingQuoteInDisplay = fDisplayString.lastIndexOf(')');
+
+ if (openingQuoteInReplacement != -1
+ && closingQuoteInReplacement != -1
+ && openingQuoteInDisplay != -1
+ && closingQuoteInDisplay != -1
+ && (closingQuoteInReplacement - openingQuoteInReplacement) != (closingQuoteInDisplay - openingQuoteInDisplay)) {
+ cursorPosition = openingQuoteInReplacement + 1;
+ }
+
+ return cursorPosition > -1 ? fOffset + cursorPosition : fNewPosition;
}
/**
13 years, 8 months
JBoss Tools SVN: r40178 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test: resources/product_config_files and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-13 10:04:18 -0400 (Fri, 13 Apr 2012)
New Revision: 40178
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/product_config_files/epp-4.properties
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/gatein.properties
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/jboss-portal.properties
Log:
Changed portlet bridge configuration
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch 2012-04-13 13:42:44 UTC (rev 40177)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch 2012-04-13 14:04:18 UTC (rev 40178)
@@ -12,6 +12,7 @@
<listEntry value="jbosstools.test.jboss-seam-2.2.home=${folder_prompt:Seam 2.2 installation directory}"/>
<listEntry value="jbosstools.test.jboss-portal.home=${folder_prompt:JBoss Portal 2.7 installation directory}"/>
<listEntry value="jbosstools.test.jboss-seam-2.0.home=${folder_prompt:Seam 2.0 installation directory}"/>
+<listEntry value="jbosstools.test.jboss-portlet-bridge.home=${folder_prompt:JBoss Portlet Bridge installation directory}"/>
</listAttribute>
<stringAttribute key="M2_RUNTIME" value="/home/ljelinko/programs/apache-maven-3.0.3"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/product_config_files/epp-4.properties
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/product_config_files/epp-4.properties 2012-04-13 13:42:44 UTC (rev 40177)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/product_config_files/epp-4.properties 2012-04-13 14:04:18 UTC (rev 40178)
@@ -1,4 +1,4 @@
SERVER=EPP,4.3,default,${jbosstools.test.jboss-epp-4.3.home}/jboss-as
SEAM=2.0,${jbosstools.test.jboss-epp-4.3.home}/seam2
DB=hsqldb18,internal, , , , ,
-PORTLET_BRIDGE=${jbosstools.test.jboss-epp-4.3.home}/jboss-as/server/default/deploy/jboss-portal.sar/portal-identity.sar/portal-identity.war/WEB-INF/lib
\ No newline at end of file
+PORTLET_BRIDGE=${jbosstools.test.jboss-portlet-bridge.home}
\ No newline at end of file
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/gatein.properties
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/gatein.properties 2012-04-13 13:42:44 UTC (rev 40177)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/gatein.properties 2012-04-13 14:04:18 UTC (rev 40178)
@@ -1,4 +1,4 @@
SERVER=EPP,5.1.0,default,${jbosstools.test.jboss-gatein.home}
SEAM=2.2,${jbosstools.test.jboss-seam-2.2.home}
DB=hsqldb18,internal, , , , ,
-PORTLET_BRIDGE=${jbosstools.test.jboss-gatein.home}/server/default/deploy/gatein.ear/lib/
\ No newline at end of file
+PORTLET_BRIDGE=${jbosstools.test.jboss-portlet-bridge.home}
\ No newline at end of file
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/jboss-portal.properties
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/jboss-portal.properties 2012-04-13 13:42:44 UTC (rev 40177)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/resources/project_config_files/jboss-portal.properties 2012-04-13 14:04:18 UTC (rev 40178)
@@ -1,4 +1,4 @@
SERVER=EPP,4.3,default,${jbosstools.test.jboss-portal.home}
SEAM=2.0,${jbosstools.test.jboss-seam-2.0.home}
DB=hsqldb18,internal, , , , ,
-PORTLET_BRIDGE=${jbosstools.test.jboss-portal.home}/server/default/deploy/jboss-portal.sar/portal-identity.sar/portal-identity.war/WEB-INF/lib
\ No newline at end of file
+PORTLET_BRIDGE=${jbosstools.test.jboss-portlet-bridge.home}
\ No newline at end of file
13 years, 8 months
JBoss Tools SVN: r40177 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-04-13 09:42:44 -0400 (Fri, 13 Apr 2012)
New Revision: 40177
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoELContentAssistantProposal.java
Log:
JBIDE-11492
When inserting methods with parameters, CA sets cursor incorrectly
Issue is fixed.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoELContentAssistantProposal.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoELContentAssistantProposal.java 2012-04-13 13:15:08 UTC (rev 40176)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoELContentAssistantProposal.java 2012-04-13 13:42:44 UTC (rev 40177)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010-2011 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jst.jsp.contentassist;
import java.io.Reader;
@@ -29,14 +29,15 @@
import org.jboss.tools.common.model.XModelObject;
/**
- * Class to provide EL proposals to Content Assistant.
- * The main purpose is to provide correct additional proposal information based on
- * IJavaElement objects collected for the proposal.
- *
+ * Class to provide EL proposals to Content Assistant. The main purpose is to
+ * provide correct additional proposal information based on IJavaElement objects
+ * collected for the proposal.
+ *
* @author Victor Rubezhny
*/
@SuppressWarnings("restriction")
-public class AutoELContentAssistantProposal extends AutoContentAssistantProposal {
+public class AutoELContentAssistantProposal extends
+ AutoContentAssistantProposal {
private IJavaElement[] fJavaElements;
private MessagesELTextProposal fProperySource;
private String fAdditionalProposalInfo;
@@ -54,12 +55,18 @@
* @param elements
* @param relevance
*/
- public AutoELContentAssistantProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, String alternateMatch, IContextInformation contextInformation, IJavaElement[] elements, int relevance) {
- super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, alternateMatch, contextInformation, null, relevance);
- this.fJavaElements = elements;
- this.fProperySource = null;
+ public AutoELContentAssistantProposal(String replacementString,
+ int replacementOffset, int replacementLength, int cursorPosition,
+ Image image, String displayString, String alternateMatch,
+ IContextInformation contextInformation, IJavaElement[] elements,
+ int relevance) {
+ super(replacementString, replacementOffset, replacementLength,
+ cursorPosition, image, displayString, alternateMatch,
+ contextInformation, null, relevance);
+ this.fJavaElements = elements;
+ this.fProperySource = null;
}
-
+
/**
* Constructs the proposal object
*
@@ -73,15 +80,24 @@
* @param properySource
* @param relevance
*/
- public AutoELContentAssistantProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, String alternateMatch, IContextInformation contextInformation, MessagesELTextProposal propertySource, int relevance) {
- super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, alternateMatch, contextInformation, null, relevance);
- this.fJavaElements = null;
- this.fProperySource = propertySource;
+ public AutoELContentAssistantProposal(String replacementString,
+ int replacementOffset, int replacementLength, int cursorPosition,
+ Image image, String displayString, String alternateMatch,
+ IContextInformation contextInformation,
+ MessagesELTextProposal propertySource, int relevance) {
+ super(replacementString, replacementOffset, replacementLength,
+ cursorPosition, image, displayString, alternateMatch,
+ contextInformation, null, relevance);
+ this.fJavaElements = null;
+ this.fProperySource = propertySource;
}
-
+
/*
* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal#getAdditionalProposalInfo()
+ *
+ * @see
+ * org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal
+ * #getAdditionalProposalInfo()
*/
public String getAdditionalProposalInfo() {
if (fAdditionalProposalInfo == null) {
@@ -95,31 +111,31 @@
}
/*
- * Extracts the additional proposal information based on Javadoc for the stored IJavaElement objects
+ * Extracts the additional proposal information based on Javadoc for the
+ * stored IJavaElement objects
*/
private String extractProposalContextInfo(IJavaElement[] elements) {
- int nResults= elements.length;
- StringBuffer buffer= new StringBuffer();
- boolean hasContents= false;
- IJavaElement element= null;
+ int nResults = elements.length;
+ StringBuffer buffer = new StringBuffer();
+ boolean hasContents = false;
+ IJavaElement element = null;
if (nResults > 1) {
-/* for (int i= 0; i < elements.length; i++) {
- if (elements[i] == null) continue;
- if (elements[i] instanceof IMember ||
- elements[i].getElementType() == IJavaElement.LOCAL_VARIABLE ||
- elements[i].getElementType() == IJavaElement.TYPE_PARAMETER) {
- buffer.append('\uE467').append(' ').append(getInfoText(elements[i]));
- hasContents= true;
- }
- buffer.append("<br/>"); //$NON-NLS-1$
- }
-*/
- for (int i=0; i < elements.length; i++) {
- if (elements[i] == null) continue;
- if (elements[i] instanceof IMember ||
- elements[i].getElementType() == IJavaElement.LOCAL_VARIABLE ||
- elements[i].getElementType() == IJavaElement.TYPE_PARAMETER) {
+ /*
+ * for (int i= 0; i < elements.length; i++) { if (elements[i] ==
+ * null) continue; if (elements[i] instanceof IMember ||
+ * elements[i].getElementType() == IJavaElement.LOCAL_VARIABLE ||
+ * elements[i].getElementType() == IJavaElement.TYPE_PARAMETER) {
+ * buffer
+ * .append('\uE467').append(' ').append(getInfoText(elements[i]));
+ * hasContents= true; } buffer.append("<br/>"); //$NON-NLS-1$ }
+ */
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] == null)
+ continue;
+ if (elements[i] instanceof IMember
+ || elements[i].getElementType() == IJavaElement.LOCAL_VARIABLE
+ || elements[i].getElementType() == IJavaElement.TYPE_PARAMETER) {
buffer.append('\uE467').append(' ');
addFullInfo(buffer, elements[i]);
buffer.append("<br/>"); //$NON-NLS-1$
@@ -127,73 +143,85 @@
}
}
} else {
- element= elements[0];
- if (element instanceof IMember ||
- element.getElementType() == IJavaElement.LOCAL_VARIABLE ||
- element.getElementType() == IJavaElement.TYPE_PARAMETER) {
+ element = elements[0];
+ if (element instanceof IMember
+ || element.getElementType() == IJavaElement.LOCAL_VARIABLE
+ || element.getElementType() == IJavaElement.TYPE_PARAMETER) {
addFullInfo(buffer, element);
- hasContents= true;
+ hasContents = true;
}
}
- if (!hasContents || buffer.length() == 0)
+ if (!hasContents || buffer.length() == 0)
return null;
-
- HTMLPrinter.insertPageProlog(buffer, 0, (String)null);
+
+ HTMLPrinter.insertPageProlog(buffer, 0, (String) null);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
/*
- * Extracts the additional proposal information based on Javadoc for the stored IJavaElement objects
+ * Extracts the additional proposal information based on Javadoc for the
+ * stored IJavaElement objects
*/
- private String extractProposalContextInfo(MessagesELTextProposal propertySource) {
- StringBuffer buffer= new StringBuffer();
- buffer.append(ELProposalProcessor.getELMessagesHoverInternal(propertySource.getBaseName(),
- propertySource.getPropertyName(), (List<XModelObject>)propertySource.getAllObjects()));
+ private String extractProposalContextInfo(
+ MessagesELTextProposal propertySource) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(ELProposalProcessor.getELMessagesHoverInternal(
+ propertySource.getBaseName(), propertySource.getPropertyName(),
+ (List<XModelObject>) propertySource.getAllObjects()));
- if (buffer.length() == 0)
+ if (buffer.length() == 0)
return null;
-
- HTMLPrinter.insertPageProlog(buffer, 0, (String)null);
+
+ HTMLPrinter.insertPageProlog(buffer, 0, (String) null);
HTMLPrinter.addPageEpilog(buffer);
return buffer.toString();
}
-
- private static final long LABEL_FLAGS= JavaElementLabels.ALL_FULLY_QUALIFIED
- | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS
- | JavaElementLabels.F_PRE_TYPE_SIGNATURE | JavaElementLabels.M_PRE_TYPE_PARAMETERS | JavaElementLabels.T_TYPE_PARAMETERS
+ private static final long LABEL_FLAGS = JavaElementLabels.ALL_FULLY_QUALIFIED
+ | JavaElementLabels.M_PRE_RETURNTYPE
+ | JavaElementLabels.M_PARAMETER_TYPES
+ | JavaElementLabels.M_PARAMETER_NAMES
+ | JavaElementLabels.M_EXCEPTIONS
+ | JavaElementLabels.F_PRE_TYPE_SIGNATURE
+ | JavaElementLabels.M_PRE_TYPE_PARAMETERS
+ | JavaElementLabels.T_TYPE_PARAMETERS
| JavaElementLabels.USE_RESOLVED;
- private static final long LOCAL_VARIABLE_FLAGS= LABEL_FLAGS & ~JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED;
- private static final long TYPE_PARAMETER_FLAGS= LABEL_FLAGS | JavaElementLabels.TP_POST_QUALIFIED;
+ private static final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS
+ & ~JavaElementLabels.F_FULLY_QUALIFIED
+ | JavaElementLabels.F_POST_QUALIFIED;
+ private static final long TYPE_PARAMETER_FLAGS = LABEL_FLAGS
+ | JavaElementLabels.TP_POST_QUALIFIED;
- /*
+ /*
* Returns the label for the IJavaElement objects
*/
private String getInfoText(IJavaElement element) {
long flags;
switch (element.getElementType()) {
- case IJavaElement.LOCAL_VARIABLE:
- flags= LOCAL_VARIABLE_FLAGS;
- break;
- case IJavaElement.TYPE_PARAMETER:
- flags= TYPE_PARAMETER_FLAGS;
- break;
- default:
- flags= LABEL_FLAGS;
- break;
+ case IJavaElement.LOCAL_VARIABLE:
+ flags = LOCAL_VARIABLE_FLAGS;
+ break;
+ case IJavaElement.TYPE_PARAMETER:
+ flags = TYPE_PARAMETER_FLAGS;
+ break;
+ default:
+ flags = LABEL_FLAGS;
+ break;
}
- StringBuffer label= new StringBuffer(JavaElementLinks.getElementLabel(element, flags));
-
- // The following lines were commented out because of JBIDE-8923 faced in Eclipse 3.7
+ StringBuffer label = new StringBuffer(JavaElementLinks.getElementLabel(
+ element, flags));
+
+ // The following lines were commented out because of JBIDE-8923 faced in
+ // Eclipse 3.7
//
-// StringBuffer buf= new StringBuffer();
-// buf.append("<span style='word-wrap:break-word;'>"); //$NON-NLS-1$
-// buf.append(label);
-// buf.append("</span>"); //$NON-NLS-1$
+ // StringBuffer buf= new StringBuffer();
+ // buf.append("<span style='word-wrap:break-word;'>"); //$NON-NLS-1$
+ // buf.append(label);
+ // buf.append("</span>"); //$NON-NLS-1$
-// return buf.toString();
+ // return buf.toString();
return label.toString();
}
@@ -201,21 +229,24 @@
* Adds full information to the additional proposal information
*
* @param buffer
+ *
* @param element
+ *
* @return
*/
private void addFullInfo(StringBuffer buffer, IJavaElement element) {
if (element instanceof IMember) {
- IMember member= (IMember) element;
+ IMember member = (IMember) element;
HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
Reader reader = null;
try {
- String content= JavadocContentAccess2.getHTMLContent(member, true);
- reader= content == null ? null : new StringReader(content);
+ String content = JavadocContentAccess2.getHTMLContent(member,
+ true);
+ reader = content == null ? null : new StringReader(content);
} catch (JavaModelException ex) {
JavaPlugin.log(ex);
}
-
+
if (reader == null) {
reader = new StringReader(Messages.NO_JAVADOC);
}
@@ -223,34 +254,36 @@
if (reader != null) {
buffer.append("<br/>"); //$NON-NLS-1$
buffer.append(HTMLPrinter.read(reader));
-// HTMLPrinter.addParagraph(buffer, reader);
+ // HTMLPrinter.addParagraph(buffer, reader);
}
- } else if (element.getElementType() == IJavaElement.LOCAL_VARIABLE || element.getElementType() == IJavaElement.TYPE_PARAMETER) {
+ } else if (element.getElementType() == IJavaElement.LOCAL_VARIABLE
+ || element.getElementType() == IJavaElement.TYPE_PARAMETER) {
HTMLPrinter.addSmallHeader(buffer, getInfoText(element));
}
}
-
+
/**
* Return cursor position of proposal replacement string.
*
* Method is added because of JBIDE-7168
*/
public int getCursorPosition() {
- int cursorPosition = -1;
-
- int openingQuoteInReplacement = getReplacementString().indexOf('(');
- int closingQuoteInReplacement = getReplacementString().indexOf(')');
- int openingQuoteInDisplay = getDisplayString().indexOf('(');
- int closingQuoteInDisplay = getDisplayString().indexOf(')');
-
- if (openingQuoteInReplacement != -1 && closingQuoteInReplacement != -1 &&
- openingQuoteInDisplay != -1 && closingQuoteInDisplay != -1 &&
- (closingQuoteInReplacement - openingQuoteInReplacement) !=
- (closingQuoteInDisplay - openingQuoteInDisplay)) {
- cursorPosition = openingQuoteInReplacement + 1;
- }
-
- return cursorPosition>-1?cursorPosition:super.getCursorPosition();
+ int cursorPosition = -1;
+
+ int openingQuoteInReplacement = getReplacementString().lastIndexOf('(');
+ int closingQuoteInReplacement = getReplacementString().lastIndexOf(')');
+ int openingQuoteInDisplay = getDisplayString().lastIndexOf('(');
+ int closingQuoteInDisplay = getDisplayString().lastIndexOf(')');
+
+ if (openingQuoteInReplacement != -1
+ && closingQuoteInReplacement != -1
+ && openingQuoteInDisplay != -1
+ && closingQuoteInDisplay != -1
+ && (closingQuoteInReplacement - openingQuoteInReplacement) != (closingQuoteInDisplay - openingQuoteInDisplay)) {
+ cursorPosition = openingQuoteInReplacement + 1;
+ }
+
+ return cursorPosition > -1 ? cursorPosition : super.getCursorPosition();
}
}
13 years, 8 months
JBoss Tools SVN: r40176 - trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-04-13 09:15:08 -0400 (Fri, 13 Apr 2012)
New Revision: 40176
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java
Log:
Secure storage fix
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java 2012-04-13 12:59:23 UTC (rev 40175)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java 2012-04-13 13:15:08 UTC (rev 40176)
@@ -72,9 +72,14 @@
private void storePasswordThenForward() {
if (bot.waitForShell(IDELabel.Shell.SECURE_STORAGE) != null) {
bot.text(0).setText(TestProperties.getPassphrase());
- if (bot.text(1) != null)
+ if (bot.text(1) != null){
bot.text(1).setText(TestProperties.getPassphrase());
- bot.button(IDELabel.Button.OK).click();
+ bot.button(IDELabel.Button.OK).click();
+ bot.waitForShell(IDELabel.Shell.SECURE_STORAGE);
+ bot.button(IDELabel.Button.CANCEL).click();
+ } else {
+ bot.button(IDELabel.Button.OK).click();
+ }
}
}
13 years, 8 months
JBoss Tools SVN: r40175 - in trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-04-13 08:59:23 -0400 (Fri, 13 Apr 2012)
New Revision: 40175
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java
Log:
Secure storage fix
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java 2012-04-13 12:51:38 UTC (rev 40174)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java 2012-04-13 12:59:23 UTC (rev 40175)
@@ -36,7 +36,7 @@
SWTBot wiz = open.newObject(OpenShiftUI.NewApplication.iNewObject);
storePasswordThenForward();
-
+
// set wrong user credentials
wiz.text(0).setText(TestProperties.getProperty("openshift.user.name"));
wiz.text(1).setText(
@@ -72,6 +72,8 @@
private void storePasswordThenForward() {
if (bot.waitForShell(IDELabel.Shell.SECURE_STORAGE) != null) {
bot.text(0).setText(TestProperties.getPassphrase());
+ if (bot.text(1) != null)
+ bot.text(1).setText(TestProperties.getPassphrase());
bot.button(IDELabel.Button.OK).click();
}
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java 2012-04-13 12:51:38 UTC (rev 40174)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java 2012-04-13 12:59:23 UTC (rev 40175)
@@ -47,10 +47,15 @@
* @param args
*/
public static void main(String[] args) {
- if (destroyDomain("rhtestdomain", "sbunciak", "rhtest123") == 200) {
+ int resp_code = DomainDestroyer.destroyDomain(
+ TestProperties.getProperty("openshift.domain.new"),
+ TestProperties.getProperty("openshift.user.name"),
+ TestProperties.getProperty("openshift.user.pwd"));
+
+ if (resp_code == 200) {
System.out.println("Domain destroyed.");
} else {
- System.out.println("Domain was not destroyed.");
+ System.out.println("Domain was not destroyed. Response code: "+resp_code);
}
}
}
13 years, 8 months
JBoss Tools SVN: r40174 - in trunk: tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-04-13 08:51:38 -0400 (Fri, 13 Apr 2012)
New Revision: 40174
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/FormatUtils.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/QuickFixHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/QuickFixBot.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/MarkersTest.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotEditorExt.java
Log:
Added Quick Fix Testing
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/MarkersTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/MarkersTest.java 2012-04-13 10:59:41 UTC (rev 40173)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/MarkersTest.java 2012-04-13 12:51:38 UTC (rev 40174)
@@ -10,12 +10,18 @@
******************************************************************************/
package org.jboss.tools.jsf.ui.bot.test.smoke;
+import java.util.LinkedList;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.MarkerHelper;
+import org.jboss.tools.ui.bot.ext.helper.QuickFixHelper;
import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
/**
* Test Markers position and attributes regarding to JSF components within jsp page
@@ -71,17 +77,58 @@
markerHelper.checkForMarker(String.valueOf(expectedMarkerLines[index] + 1),
expectedMarkerDesc[index]);
}
+ // check quick fix
+ LinkedList<String> expectedQuickFixes = new LinkedList<String>();
+ expectedQuickFixes.add("Configure Problem Severity for preference 'Property cannot be resolved'");
+ QuickFixHelper.checkQuickFixContent(SWTTestExt.bot,
+ TEST_PAGE,
+ textToSelect,
+ textToSelect.length(),
+ insertText.length(),
+ expectedQuickFixes);
+ editor.quickFix().useQuickFix(0);
+ final SWTBot botProperties = bot.shell(IDELabel.Shell.PREFERENCES_FILTERED).activate().bot();
+ String selectedTreeItemLabel = botProperties.tree().selection().get(0,0);
+ boolean isFilterValueOK = false;
+ final String expectedFilterValue = "Property cannot be resolved:";
+ try{
+ botProperties.text(expectedFilterValue);
+ isFilterValueOK = true;
+ } catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+ boolean isValidationOptionPresent = false;
+ final String expectedValidationOption = "Property cannot be resolved:";
+ try{
+ botProperties.label(expectedValidationOption);
+ isValidationOptionPresent = true;
+ } catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+ bot.button(IDELabel.Button.CANCEL).click();
+ final String expectedSelectedTreeItem = "Validation";
+ assertTrue("Selected tree item within Preferences Dialog has to have label "
+ + expectedSelectedTreeItem
+ + " but is " + selectedTreeItemLabel,
+ selectedTreeItemLabel.equals(expectedSelectedTreeItem));
+ assertTrue("Validation Filter has to have value " + expectedFilterValue
+ + " but it does not",
+ isFilterValueOK);
+ assertTrue("Validation Option has to have label " + expectedValidationOption
+ + " but it does not",
+ isValidationOptionPresent);
}
@Override
-public void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
openPage(TEST_PAGE);
editor = SWTTestExt.bot.swtBotEditorExtByTitle(TEST_PAGE);
originalEditorText = editor.getText();
}
+
@Override
-public void tearDown() throws Exception {
- if (editor != null){
+ public void tearDown() throws Exception {
+ if (editor != null) {
editor.setText(originalEditorText);
editor.saveAndClose();
}
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/FormatUtils.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/FormatUtils.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/FormatUtils.java 2012-04-13 12:51:38 UTC (rev 40174)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ui.bot.ext;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Utils for Formating
+ * @author Vladimir Pakan
+ */
+public class FormatUtils {
+ /**
+ * Get formatted difference between list0 and list1
+ * @param list0
+ * @param list1
+ * @return
+ */
+ public static String getListsDiffFormatted (List<String> list0 , List<String> list1){
+ StringBuffer sb = new StringBuffer("");
+ if (list0 == null && list1 == null){
+ sb.append("<null> == <null>");
+ }else if (list0 == null){
+ sb.append("<null> != <not null>");
+ }else if (list1 == null){
+ sb.append("<null> != <not null>");
+ } else{
+ Iterator<String> iterator0 = list0.iterator();
+ Iterator<String> iterator1 = list1.iterator();
+ boolean continueIteration = iterator0.hasNext() || iterator1.hasNext();
+ while (continueIteration){
+ String item0 = "<null>";
+ String item1 = "<null>";
+ sb.append(" ");
+ if (iterator0.hasNext()){
+ item0 = iterator0.next();
+ }
+ if (iterator1.hasNext()){
+ item1 = iterator1.next();
+ }
+ sb.append(" ");
+ sb.append(item0);
+ sb.append(item0.equals(item1) ? " == " : " != ");
+ sb.append(item1);
+ continueIteration = iterator0.hasNext() || iterator1.hasNext();
+ if (continueIteration){
+ sb.append("\n");
+ }
+ }
+ }
+ System.out.println(sb.toString());
+ for (String item : list1){
+ System.out.println("result.add(\"" + item.replaceAll("\"", "\\\"") + "\");");
+ }
+
+ return sb.toString();
+ }
+
+
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/FormatUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java 2012-04-13 10:59:41 UTC (rev 40173)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContentAssistHelper.java 2012-04-13 12:51:38 UTC (rev 40174)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Copyright (c) 2007-2012 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,
@@ -13,10 +13,10 @@
import static org.junit.Assert.assertTrue;
-import java.util.Iterator;
import java.util.List;
import org.apache.log4j.Logger;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.jboss.tools.ui.bot.ext.FormatUtils;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
@@ -56,7 +56,7 @@
List<String> currentProposalList = contentAssist.getProposalList();
assertTrue("Code Assist menu has incorrect menu items.\n" +
"Expected Proposal Menu Labels vs. Current Proposal Menu Labels :\n" +
- ContentAssistHelper.getListsDiffFormatted(expectedProposalList,currentProposalList),
+ FormatUtils.getListsDiffFormatted(expectedProposalList,currentProposalList),
expectedProposalList.equals(currentProposalList));
return editor;
@@ -86,50 +86,5 @@
expectedProposalList);
}
- /**
- * Get formatted difference between list0 and list1
- * @param list0
- * @param list1
- * @return
- */
- private static String getListsDiffFormatted (List<String> list0 , List<String> list1){
- StringBuffer sb = new StringBuffer("");
- if (list0 == null && list1 == null){
- sb.append("<null> == <null>");
- }else if (list0 == null){
- sb.append("<null> != <not null>");
- }else if (list1 == null){
- sb.append("<null> != <not null>");
- } else{
- Iterator<String> iterator0 = list0.iterator();
- Iterator<String> iterator1 = list1.iterator();
- boolean continueIteration = iterator0.hasNext() || iterator1.hasNext();
- while (continueIteration){
- String item0 = "<null>";
- String item1 = "<null>";
- sb.append(" ");
- if (iterator0.hasNext()){
- item0 = iterator0.next();
- }
- if (iterator1.hasNext()){
- item1 = iterator1.next();
- }
- sb.append(" ");
- sb.append(item0);
- sb.append(item0.equals(item1) ? " == " : " != ");
- sb.append(item1);
- continueIteration = iterator0.hasNext() || iterator1.hasNext();
- if (continueIteration){
- sb.append("\n");
- }
- }
- }
- System.out.println(sb.toString());
- for (String item : list1){
- System.out.println("result.add(\"" + item.replaceAll("\"", "\\\"") + "\");");
- }
-
- return sb.toString();
- }
}
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/QuickFixHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/QuickFixHelper.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/QuickFixHelper.java 2012-04-13 12:51:38 UTC (rev 40174)
@@ -0,0 +1,90 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ui.bot.ext.helper;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.jboss.tools.ui.bot.ext.FormatUtils;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.parts.QuickFixBot;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+
+/**
+ * Helper for Quick Fix functionality testing
+ * @author Vladimir Pakan
+ *
+ */
+public class QuickFixHelper {
+ protected static final Logger log = Logger.getLogger(QuickFixHelper.class);
+ /**
+ * Checks Quick Fix content on specified position within editor with editorTitle
+ * and checks if expectedQuickFixList is equal to current Quick Fix List
+ * @param editorTitle
+ * @param textToSelect
+ * @param selectionOffset
+ * @param selectionLength
+ * @param textToSelectIndex
+ * @param expectedQuickFixsList
+ */
+ public static SWTBotEditor checkQuickFixContent(SWTBotExt bot,
+ String editorTitle, String textToSelect, int selectionOffset,
+ int selectionLength, int textToSelectIndex, List<String> expectedQuickFixsList) {
+
+ SWTJBTExt.selectTextInSourcePane(bot,
+ editorTitle, textToSelect, selectionOffset, selectionLength,
+ textToSelectIndex);
+
+ bot.sleep(Timing.time1S());
+
+ SWTBotEditorExt editor = SWTTestExt.bot.swtBotEditorExtByTitle(editorTitle);
+ QuickFixBot quickFix = editor.quickFix();
+ List<String> currentQuickFixsList = quickFix.getQuickFixList();
+ assertTrue("Quick Fix menu has incorrect menu items.\n" +
+ "Expected Qucik Fix Menu Labels vs. Current Quick Fix Menu Labels :\n" +
+ FormatUtils.getListsDiffFormatted(expectedQuickFixsList,currentQuickFixsList),
+ expectedQuickFixsList.equals(currentQuickFixsList));
+
+ return editor;
+
+ }
+
+ /**
+ * Checks Quick Fix content on specified position within editor with editorTitle
+ * and checks if expectedQuickFixsList is equal to current Quick Fix List
+ * @param editorTitle
+ * @param textToSelect
+ * @param selectionOffset
+ * @param selectionLength
+ * @param textToSelectIndex
+ * @param expectedQuickFixsList
+ */
+ public static SWTBotEditor checkQuickFixContent(SWTBotExt bot,
+ String editorTitle, String textToSelect, int selectionOffset,
+ int selectionLength, List<String> expectedQuickFixsList) {
+
+ return QuickFixHelper.checkQuickFixContent(bot,
+ editorTitle,
+ textToSelect,
+ selectionOffset,
+ selectionLength,
+ 0,
+ expectedQuickFixsList);
+
+ }
+
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/QuickFixHelper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/QuickFixBot.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/QuickFixBot.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/QuickFixBot.java 2012-04-13 12:51:38 UTC (rev 40174)
@@ -0,0 +1,256 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ui.bot.ext.parts;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
+/**
+ * This provides working Content assist functionality.
+ * SWTBot (2.0.0#467) functionality provided in SWTEclipseEditor doesn't work (at least on GTK linux)
+ * @author jpeterka
+ *
+ */
+public class QuickFixBot {
+ /**
+ * Performs content assist for given editor and string
+ *
+ * @param editor
+ * @param text
+ */
+
+ Logger log = Logger.getLogger(QuickFixBot.class);
+ SWTBotEditorExt editor;
+ SWTBot bot;
+
+ // ------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------
+
+ /**
+ * Basic constructor
+ */
+ public QuickFixBot(SWTBotEditorExt editor) {
+ this.editor = editor;
+ this.bot = editor.bot();
+ }
+
+
+ // ------------------------------------------------------------
+ // Public
+ // ------------------------------------------------------------
+ /**
+ * Use selected Quick Fix with given Quick Fix text
+ */
+ public void useQuickFix(String text) {
+ SWTBotTable table = getQuickFixTable(openQuickFixList());
+ List<String> items = getTableItems(table);
+ if (items.contains(text)) {
+ final int index = items.indexOf(text);
+ seletctQFTableItem(table, index);
+ } else {
+ fail("Quick Fix doens't contain Quick Fix text");
+ }
+ }
+ /**
+ * Use selected Quick Fix with given Quick Fix index
+ */
+ public void useQuickFix(int index) {
+ SWTBotTable table = getQuickFixTable(openQuickFixList());
+ seletctQFTableItem(table, index);
+ }
+
+ /**
+ * Logs Quick Fix list contents, usual for debug purposes
+ *
+ * @param text
+ */
+ public void logQuickFixList() {
+ List<String> list = getQuickFixList();
+ log.info("Quick Fix item list: " + list.size() + " item(s)");
+ for (int i = 0; i < list.size(); i++) {
+ log.info("Item i:" + list.get(i));
+ }
+ }
+ /**
+ * Returns Quick Fix list
+ * @return
+ */
+ public List<String>getQuickFixList() {
+ List<String> result = null;
+ SWTBotShell shell = openQuickFixList();
+ SWTBotTable table = getQuickFixTable(shell);
+ result = getTableItems(table);
+ shell.close();
+
+ return result;
+ }
+ /**
+ * Logs Quick Fix list contents, when Quick Fixt window is already opened
+ * @param shellsBefore - list of shells before Content Assist was invoked
+ * @param shellsAfter - list of shells after Content Assist was invoked
+ * @param closeShell
+ * @return
+ */
+ public List<String>getQuickFixList(SWTBotShell[] shellsBefore, SWTBotShell[] shellsAfter, boolean closeShell) {
+ List<String> result = null;
+ SWTBotShell caShell = getQuickFixShell(shellsBefore, shellsAfter);
+ SWTBotTable caTable = getQuickFixTable(caShell);
+ result = getTableItems(caTable);
+ if (closeShell) {
+ caShell.close();
+ }
+
+ return result;
+ }
+ // ------------------------------------------------------------
+ // Private
+ // ------------------------------------------------------------
+ /*
+ * Invokes QuickFix shell action
+ */
+ private void invokeQuickFix() {
+ ContextMenuHelper.clickContextMenu(editor,
+ IDELabel.Menu.QUICK_FIX);
+ }
+
+ /**
+ * Return list of table items. Requires activated proposal table
+ * @param table
+ * @return
+ */
+ private List<String> getTableItems(SWTBotTable table) {
+ int rows = table.rowCount();
+ List<String> list = new ArrayList<String>();
+ for (int i = 0; i < rows; i++) {
+ list.add(table.cell(i, 0));
+ }
+ return list;
+ }
+
+ /**
+ * Returns Quick fix table from Quick Fix shell
+ * @param qfShell
+ * @return
+ */
+ private SWTBotTable getQuickFixTable(SWTBotShell qfShell) {
+ SWTBot qfBot = new SWTBot(qfShell.widget);
+ return qfBot.table();
+ }
+
+ /**
+ * Opens Quick Fix table
+ * @return Quick Fix bot shell
+ */
+ private SWTBotShell openQuickFixList() {
+ SWTBotShell[] shells1 = bot.shells();
+ invokeQuickFix();
+ SWTBotShell[] shells2 = bot.shells();
+ SWTBotShell qfShell = getQuickFixShell(shells1, shells2);
+ return qfShell;
+
+ }
+
+ /**
+ * Select table item from code completion table. It's workaround because
+ * SWTBotTable methods doesn't work property for this case
+ *
+ * @param botTable
+ * @param index
+ */
+ private void seletctQFTableItem(final SWTBotTable botTable, final int index) {
+ UIThreadRunnable.asyncExec(new VoidResult() {
+ public void run() {
+ Table table = botTable.widget;
+ table.setSelection(index);
+ Event event = new Event();
+ event.type = SWT.Selection;
+ event.widget = table;
+ event.item = table.getItem(index);
+ table.notifyListeners(SWT.Selection, event);
+ table.notifyListeners(SWT.DefaultSelection, event);
+ }
+ });
+ }
+
+ /**
+ * Return Quick Fix shell as new shell from two collections of shells
+ *
+ * @param s1
+ * @param s2
+ * @return
+ */
+ private SWTBotShell getQuickFixShell(SWTBotShell[] s1, SWTBotShell[] s2) {
+ SWTBotShell ccShell = null;
+ for (SWTBotShell bs2 : s2) {
+ boolean found = false;
+ for (SWTBotShell bs1 : s1) {
+ if (bs2.widget.equals(bs1.widget)) {
+ found = true;
+ break;
+ }
+ }
+ if (found == false) {
+ // New Shell has to contain table
+ try{
+ bs2.bot().table();
+ ccShell = bs2;
+ break;
+ }
+ catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+ }
+ }
+ return ccShell;
+ }
+ /**
+ * Check if quickFixItemLabel is present within Content Assist and
+ * choose it when applyQuickFix is true
+ * @param quickFixItemLabel
+ * @param applyQuickFix
+ */
+ public void checkQuickFix(String quickFixItemLabel,boolean applyQuickFix){
+ List<String> quickFixList = getQuickFixList();
+
+ assertNotNull("Editor Quick Fix doesn't containt item with label: " + quickFixItemLabel +
+ ". It's null",
+ quickFixList);
+
+ int itemIndex = quickFixList.indexOf(quickFixItemLabel);
+
+ assertTrue("Editor Quick Fix doesn't containt item with label: " + quickFixItemLabel,
+ itemIndex > -1);
+
+ if (applyQuickFix){
+ useQuickFix(itemIndex);
+ }
+
+ }
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/QuickFixBot.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotEditorExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotEditorExt.java 2012-04-13 10:59:41 UTC (rev 40173)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/SWTBotEditorExt.java 2012-04-13 12:51:38 UTC (rev 40174)
@@ -38,6 +38,11 @@
return caBot;
}
+ public QuickFixBot quickFix() {
+ QuickFixBot qfBot = new QuickFixBot(this);
+ return qfBot;
+ }
+
public void selectPage(int pageIndex){
try{
final CTabFolder tabFolder = this.findWidget(widgetOfType(CTabFolder.class));
13 years, 8 months
JBoss Tools SVN: r40173 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-04-13 06:59:41 -0400 (Fri, 13 Apr 2012)
New Revision: 40173
Modified:
trunk/build/aggregate/site/site.xml
Log:
JBIDE-11355:
(Ashamed) Fix site.xml
Modified: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml 2012-04-13 10:43:29 UTC (rev 40172)
+++ trunk/build/aggregate/site/site.xml 2012-04-13 10:59:41 UTC (rev 40173)
@@ -204,7 +204,7 @@
<feature url="features/org.jboss.tools.common.jdt.feature_0.0.0.jar" id="org.jboss.tools.common.jdt.feature" version="0.0.0">
<category name="AbridgedTools" />
- <category name="GeneralTools"/>
+ <category name="GeneralTools"/>
</feature>
<!-- include but do not categorize -->
@@ -235,54 +235,12 @@
<category name="AbridgedTools" />
<category name="GeneralTools"/>
</feature>
-
- <category-def name="AbridgedTools" label="Abridged JBoss Tools 3.3">
- <description>Contains most of the JBoss Tools features.
- Excluded are those related to integration with 3rd party
- plugins. Selecting this category will give you all tools
- needed for Web and Seam Development.
- </description>
- </category-def>
-
- <category-def name="WebTools" label="JBoss Web and Java EE Development">
- <description>Tools to help create web and enterprise applications,
- using JSF, Facelets,
- Seam, Hibernate/JPA, CSS, Webservices and more.
- </description>
- </category-def>
-
- <category-def name="GeneralTools" label="JBoss Application Development">
- <description>Tools for general application development.</description>
- </category-def>
-
- <category-def name="DataTools" label="JBoss Data Services">
- <description>Tools related to data services such as persistence and transformation.</description>
- </category-def>
-
- <category-def name="MavenTools" label="JBoss Maven Support">
- <description>Plugins related to Maven and m2eclipse support. Use these
- to enable use of Maven.</description>
- </category-def>
- <category-def name="CloudTools" label="JBoss Cloud Development Tools">
- <description>Tools for Cloud Development.
- </description>
- </category-def>
- <!-- Only in JBT -->
- <category-def name="ReportTools" label="JBoss Business Intelligence, Reporting and Charting">
- <description>Business Intelligence, Reporting and Charting. Use these
- if you plan to integrate Hibernate or Seam with Eclipse BIRT.
- </description>
- </category-def>
-
- <!------------->
+
+ <!-- ####### -->
<!-- SOURCES -->
- <!------------->
- <category-def name="AllSources" label="Sources">
- <description>Source code for JBoss Tools features</description>
- </category-def>
-
- <!--
+ <!-- ####### -->
+ <!--
<feature url="features/org.jboss.tools.central.feature.source_0.0.0.jar" id="org.jboss.tools.central.feature.source" version="0.0.0">
<category name="AllSources"/>
</feature>
@@ -417,21 +375,61 @@
<category name="AllSources" />
</feature>
- <feature url="features/org.jboss.tools.runtime.core.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.core.feature.source" version="0.0.0">
<category name="AllSources" />
</feature>
<feature url="features/org.jboss.tools.runtime.as.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature.source" version="0.0.0">
<category name="AllSources" />
</feature>
-
<feature url="features/org.jboss.tools.runtime.seam.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature.source" version="0.0.0">
<category name="AllSources" />
</feature>
-
<feature url="features/org.jboss.tools.usage.feature.source_0.0.0.jar" id="org.jboss.tools.usage.feature.source" version="0.0.0">
<category name="AllSources" />
</feature>
-->
+
+ <category-def name="AbridgedTools" label="Abridged JBoss Tools 3.3">
+ <description>Contains most of the JBoss Tools features.
+ Excluded are those related to integration with 3rd party
+ plugins. Selecting this category will give you all tools
+ needed for Web and Seam Development.
+ </description>
+ </category-def>
+
+ <category-def name="WebTools" label="JBoss Web and Java EE Development">
+ <description>Tools to help create web and enterprise applications,
+ using JSF, Facelets,
+ Seam, Hibernate/JPA, CSS, Webservices and more.
+ </description>
+ </category-def>
+
+ <category-def name="GeneralTools" label="JBoss Application Development">
+ <description>Tools for general application development.</description>
+ </category-def>
+
+ <category-def name="DataTools" label="JBoss Data Services">
+ <description>Tools related to data services such as persistence and transformation.</description>
+ </category-def>
+
+ <category-def name="MavenTools" label="JBoss Maven Support">
+ <description>Plugins related to Maven and m2eclipse support. Use these
+ to enable use of Maven.</description>
+ </category-def>
+ <category-def name="CloudTools" label="JBoss Cloud Development Tools">
+ <description>Tools for Cloud Development.
+ </description>
+ </category-def>
+ <!-- Only in JBT -->
+ <category-def name="ReportTools" label="JBoss Business Intelligence, Reporting and Charting">
+ <description>Business Intelligence, Reporting and Charting. Use these
+ if you plan to integrate Hibernate or Seam with Eclipse BIRT.
+ </description>
+ </category-def>
+
+ <category-def name="AllSources" label="Sources">
+ <description>Source code for JBoss Tools features</description>
+ </category-def>
+
</site>
13 years, 8 months
JBoss Tools SVN: r40172 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-04-13 06:43:29 -0400 (Fri, 13 Apr 2012)
New Revision: 40172
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
Log:
https://issues.jboss.org/browse/JBIDE-11118
Bad location exception fix
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2012-04-13 10:03:21 UTC (rev 40171)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2012-04-13 10:43:29 UTC (rev 40172)
@@ -119,7 +119,7 @@
if(consoleConfiguration != null) {
ConsoleExtension consoleExtension = ConsoleExtensionManager.getConsoleExtension(consoleConfiguration.getHibernateExtension());
if (consoleExtension != null){
- CompletionProposalsResult codeCompletions = consoleExtension.hqlCodeComplete(doc.get(), startOffset, currentOffset);
+ CompletionProposalsResult codeCompletions = consoleExtension.hqlCodeComplete(doc.get(), 0, currentOffset);
proposalList.addAll(codeCompletions.getCompletionProposals());
errorMessage = codeCompletions.getErrorMessage();//eclipseHQLCompletionCollector.getLastErrorMessage();
13 years, 8 months