JBoss Tools SVN: r37442 - in trunk/vpe/plugins: org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-19 19:42:06 -0500 (Mon, 19 Dec 2011)
New Revision: 37442
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XPCOM.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunction.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionAttrPresent.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagString.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagText.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
Log:
Fix for PMD violations
1. Eception processing
2. Memory consumption and performance
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -535,15 +535,11 @@
}
public void completed(ProgressEvent event) {
- try {
- if (MozillaEditor.this.getXulRunnerEditor().getWebBrowser() != null) {
- //process this code only in case when editor hasn't been disposed,
- //see https://jira.jboss.org/browse/JBIDE-6373
- MozillaEditor.this.onLoadWindow();
- xulRunnerEditor.getBrowser().removeProgressListener(this);
- }
- } catch (Exception ex) {
- showXulRunnerError(cmpEd, ex);
+ if (MozillaEditor.this.getXulRunnerEditor().getWebBrowser() != null) {
+ //process this code only in case when editor hasn't been disposed,
+ //see https://jira.jboss.org/browse/JBIDE-6373
+ MozillaEditor.this.onLoadWindow();
+ xulRunnerEditor.getBrowser().removeProgressListener(this);
}
}
});
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -218,11 +218,10 @@
function.setParameters(params.toArray(new VpeOperand[params.size()]));
}
String[] signatures = function.getSignatures();
- if (signatures != null) {
- for (int i = 0; i < signatures.length; i++) {
+ for (int i = 0; i < signatures.length; i++) {
dependencySet.add(signatures[i]);
- }
}
+
return function;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunction.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunction.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -10,11 +10,15 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template.expression;
+import java.util.Arrays;
+
import org.jboss.tools.vpe.messages.VpeUIMessages;
public abstract class VpeFunction extends VpeOperand {
+ private static final String[] EMPTY_SIGNS = new String[0];
private VpeOperand[] paramertes;
+ private String[] signatures = EMPTY_SIGNS;
VpeFunction() {
}
@@ -36,6 +40,6 @@
}
String[] getSignatures() {
- return null;
+ return signatures;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionAttrPresent.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionAttrPresent.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionAttrPresent.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -29,9 +29,10 @@
}
return new VpeValue(present);
}
-
+
+ public static final String[] SIGNATURE_ANY_ATTR_ARAY = new String[] {VpeExpressionBuilder.SIGNATURE_ANY_ATTR};
@Override
String[] getSignatures() {
- return new String[] {VpeExpressionBuilder.SIGNATURE_ANY_ATTR};
+ return SIGNATURE_ANY_ATTR_ARAY;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -29,7 +29,7 @@
@Override
String[] getSignatures() {
- return new String[] {VpeExpressionBuilder.SIGNATURE_ANY_ATTR};
+ return VpeFunctionAttrPresent.SIGNATURE_ANY_ATTR_ARAY;
}
@Override
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagString.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagString.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagString.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -35,6 +35,6 @@
}
String[] getSignatures() {
- return new String[] {VpeExpressionBuilder.SIGNATURE_ANY_ATTR};
+ return VpeFunctionAttrPresent.SIGNATURE_ANY_ATTR_ARAY;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagText.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagText.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTagText.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -47,6 +47,6 @@
}
String[] getSignatures() {
- return new String[] {VpeExpressionBuilder.SIGNATURE_ANY_ATTR};
+ return VpeFunctionAttrPresent.SIGNATURE_ANY_ATTR_ARAY;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -149,46 +149,42 @@
*/
public static Node getNodeByXPath(Document document, String xPath) {
Node currentNode = document;
- try {
- String[] nodeNames = xPath.split("/"); //$NON-NLS-1$
-
- // begin from 1 to skip the first element which is empty
- for (int i = 1; i < nodeNames.length; i++) {
- String nodeName = nodeNames[i];
- if (nodeName.charAt(0) != '@') {
- currentNode = currentNode.getFirstChild();
- if (nodeName.charAt(nodeName.length() - 1) != ']') {
- while (currentNode.getNodeType() != Node.ELEMENT_NODE
- || !currentNode.getNodeName().equals(nodeName)) {
- currentNode = currentNode.getNextSibling();
- }
- } else {
- int openingBracketIndex = nodeName.lastIndexOf('[');
- String stringPosition = nodeName.substring(
- openingBracketIndex + 1,
- nodeName.length() - 1);
- nodeName = nodeName.substring(0, openingBracketIndex);
-
- int position = Integer.parseInt(stringPosition);
- int curPosition = 0;
- while (true) {
- if (currentNode.getNodeType() == Node.ELEMENT_NODE
- && currentNode.getNodeName().equals(nodeName)) {
- ++curPosition;
- if (curPosition == position) {
- break;
- }
+ String[] nodeNames = xPath.split("/"); //$NON-NLS-1$
+
+ // begin from 1 to skip the first element which is empty
+ for (int i = 1; i < nodeNames.length; i++) {
+ String nodeName = nodeNames[i];
+ if (nodeName.charAt(0) != '@') {
+ currentNode = currentNode.getFirstChild();
+ if (nodeName.charAt(nodeName.length() - 1) != ']') {
+ while (currentNode.getNodeType() != Node.ELEMENT_NODE
+ || !currentNode.getNodeName().equals(nodeName)) {
+ currentNode = currentNode.getNextSibling();
+ }
+ } else {
+ int openingBracketIndex = nodeName.lastIndexOf('[');
+ String stringPosition = nodeName.substring(
+ openingBracketIndex + 1,
+ nodeName.length() - 1);
+ nodeName = nodeName.substring(0, openingBracketIndex);
+
+ int position = Integer.parseInt(stringPosition);
+ int curPosition = 0;
+ while (true) {
+ if (currentNode.getNodeType() == Node.ELEMENT_NODE
+ && currentNode.getNodeName().equals(nodeName)) {
+ ++curPosition;
+ if (curPosition == position) {
+ break;
}
- currentNode = currentNode.getNextSibling();
}
+ currentNode = currentNode.getNextSibling();
}
- } else {
- String attributeName = nodeName.substring(1, nodeName.length());
- currentNode = currentNode.getAttributes().getNamedItem(attributeName);
}
+ } else {
+ String attributeName = nodeName.substring(1, nodeName.length());
+ currentNode = currentNode.getAttributes().getNamedItem(attributeName);
}
- } catch (Exception e) {
- return null;
}
return currentNode;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XPCOM.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XPCOM.java 2011-12-20 00:36:33 UTC (rev 37441)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XPCOM.java 2011-12-20 00:42:06 UTC (rev 37442)
@@ -104,11 +104,13 @@
String interfaceId = interfaceIdByType.get(type);
if (interfaceId == null) {
String interfaceIdFieldName = getInterfaceIdFieldName(type);
- try {
- interfaceId = (String) type.getField(interfaceIdFieldName).get(null);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ try {
+ interfaceId = (String) type.getField(interfaceIdFieldName).get(null);
+ } catch (NoSuchFieldException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
interfaceIdByType.put(type, interfaceId);
}
return interfaceId;
14 years
JBoss Tools SVN: r37441 - in trunk/maven/docs/maven_reference_guide/en-US: images/references and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-12-19 19:36:33 -0500 (Mon, 19 Dec 2011)
New Revision: 37441
Modified:
trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml
trunk/maven/docs/maven_reference_guide/en-US/images/references/JBossMavenIntegrationPreferencePage.png
trunk/maven/docs/maven_reference_guide/en-US/references.xml
Log:
updated references chapter
Modified: trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml 2011-12-19 20:08:37 UTC (rev 37440)
+++ trunk/maven/docs/maven_reference_guide/en-US/Book_Info.xml 2011-12-20 00:36:33 UTC (rev 37441)
@@ -13,7 +13,7 @@
<edition>5.0.0</edition>
- <pubsnumber>1</pubsnumber>
+ <pubsnumber>2</pubsnumber>
<abstract>
<para>
Modified: trunk/maven/docs/maven_reference_guide/en-US/images/references/JBossMavenIntegrationPreferencePage.png
===================================================================
(Binary files differ)
Modified: trunk/maven/docs/maven_reference_guide/en-US/references.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/references.xml 2011-12-19 20:08:37 UTC (rev 37440)
+++ trunk/maven/docs/maven_reference_guide/en-US/references.xml 2011-12-20 00:36:33 UTC (rev 37441)
@@ -19,7 +19,7 @@
<section id="preferencespage">
<title>JBoss Maven Integration preference page</title>
- <para>To adjust <property>Maven</property> project import settings for <property>JBoss Tools</property> projects you need to open <property>Preferences</property> dialog by clicking <emphasis><property>Window > Preferences</property></emphasis> and select <emphasis><property>JBoss Tools >JBoss Maven Integration</property></emphasis>. This page provides configuration for <property>Seam</property>, <property>JSF</property> and <property>Portlet</property> projects import.
+ <para>To adjust <property>Maven</property> project import settings for JBoss Tools projects, you need to open the <property>Preferences</property> dialog by navigating to <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>JBoss Tools</guimenuitem><guimenuitem>JBoss Maven Integration</guimenuitem></menuchoice>. This page provides configuration for all imported Maven projects.
</para>
<figure>
<title>JBoss Maven Integration Preference Page</title>
@@ -49,54 +49,112 @@
<tbody>
<row>
- <entry><para>Configure Seam when importing Maven projects </para></entry>
- <entry><para>If on, the Maven Integration Tool starts to check Seam dependencies and switch on the Seam Configurator for existing Maven projects import.</para>
+ <entry><para>Seam </para></entry>
+ <entry><para>If on, the Maven Integration Tool starts to check Seam dependencies and switch on the Seam Configurator for imported Maven projects.</para>
</entry>
<entry><para>On</para></entry>
</row>
<row>
- <entry><para>Configure Seam Runtime</para></entry>
- <entry><para>If on, the Maven Integration Tool will try to define Seam Runtime basing on information from pom.xml and workspace configuration.</para></entry>
+ <entry><para>Seam Runtime</para></entry>
+ <entry><para>If on, the Maven Integration Tool will try to define the Seam Runtime based on information from the projects <filename>pom.xml</filename> and workspace configuration.</para></entry>
<entry><para>On</para></entry>
</row>
<row>
- <entry><para>Configure Seam Artifacts (view folder, model source folder and package...)</para>
+ <entry><para>Seam Artifacts (view folder, model source folder and package...)</para>
</entry>
- <entry><para>If the option is checked, the Seam configurator will start to recognize Seam Artifacts during importing Seam Maven project.
+ <entry><para>If the option is checked, the Seam configurator will start to recognize Seam Artifacts when importing Seam Maven projects.
</para>
</entry>
<entry><para>On</para>
</entry>
</row>
<row>
- <entry><para>Configure JSF facet when importing Maven projects
+ <entry><para>JSF facet
</para></entry>
- <entry><para>This option is switch on picking up JSF facet from a pom.xml
+ <entry><para>When this option is selected, the <filename>pom.xml</filename> file will be searched for JSF facet information.
</para> </entry>
<entry><para>On</para>
</entry>
</row>
- <row><entry><para>Configure JBoss Portlet Core when importing Maven projects
+ <row>
+ <entry>
+ <para>web.xml for JSF 2 facet
+ </para>
+ </entry>
+ <entry>
+ <para>When this option is selected, a <filename>web.xml</filename> file will be created for Maven imported JSF 2 projects.
+ </para>
+ </entry>
+ <entry><para>Off</para>
+ </entry>
+ </row>
+ <row><entry><para>JBoss Portlet Core facet
</para></entry>
<entry></entry>
<entry><para>On</para></entry>
</row>
<row>
- <entry><para>Configure JBoss JSF Portlet facet when importing Maven projects
+ <entry><para>JBoss JSF Portlet Core facet
</para></entry>
<entry></entry>
<entry><para>On</para></entry>
</row>
+ <row>
+ <entry>
+ <para>JBoss JSF Portlet facet
+ </para>
+ </entry>
+ <entry>
+ </entry>
+ <entry><para>On</para></entry>
+
+ </row>
<row>
- <entry><para>Configure JBoss Seam Portlet facet when importing Maven projects
+ <entry><para>JBoss Seam Portlet facet
</para></entry>
<entry></entry>
- <entry><para>Off</para>
+ <entry><para>On</para>
</entry>
</row>
+ <row>
+ <entry>
+ <para>CDI facet
+ </para>
+ </entry>
+ <entry>
+ </entry>
+ <entry>
+ <para>On</para>
+ </entry>
+
+ </row>
+ <row>
+ <entry>
+ <para>Hibernate facet
+ </para>
+ </entry>
+ <entry>
+ </entry>
+ <entry>
+ <para>On</para>
+ </entry>
+
+ </row>
+ <row>
+ <entry>
+ <para>JAX-RS facet
+ </para>
+ </entry>
+ <entry>
+ </entry>
+ <entry>
+ <para>On</para>
+ </entry>
+
+ </row>
14 years
JBoss Tools SVN: r37440 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-19 15:08:37 -0500 (Mon, 19 Dec 2011)
New Revision: 37440
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/refactoring/JSFPagesRefactoringChange.java
Log:
Fix for PMD error. Exception catch block removed.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/refactoring/JSFPagesRefactoringChange.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/refactoring/JSFPagesRefactoringChange.java 2011-12-19 20:03:49 UTC (rev 37439)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/refactoring/JSFPagesRefactoringChange.java 2011-12-19 20:08:37 UTC (rev 37440)
@@ -57,18 +57,14 @@
if(list != null && list.size() > 0) {
newJsfResourcePath = list.get(0).toString();
}
- try {
- addChanges();
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
+ addChanges();
}
public XModel getModel() {
return model;
}
- private void addChanges() throws Exception {
+ private void addChanges() {
if(model == null) return;
XModelObject webRoot = FileSystemsHelper.getWebRoot(model);
if(webRoot == null) return;
14 years
JBoss Tools SVN: r37439 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-19 15:03:49 -0500 (Mon, 19 Dec 2011)
New Revision: 37439
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
Log:
Fix for PMD error. Exception catch changed to IOException.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2011-12-19 19:57:28 UTC (rev 37438)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2011-12-19 20:03:49 UTC (rev 37439)
@@ -14,6 +14,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
+
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -114,7 +115,7 @@
else
s = s1 + File.separator;
return new Path(s);
- } catch(Exception exception) {
+ } catch(IOException exception) {
getDefault().logError(exception);
}
return null;
14 years
JBoss Tools SVN: r37438 - in trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common: web and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-12-19 14:57:28 -0500 (Mon, 19 Dec 2011)
New Revision: 37438
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java
Log:
fix for PMD warnings
1. is not null check removed from instanceof condition
2. ps.toArray(new Object[0]) changed to ps.toArray(new Object[ps.size()])
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-12-19 18:28:44 UTC (rev 37437)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2011-12-19 19:57:28 UTC (rev 37438)
@@ -245,7 +245,7 @@
}
if(checkParents) {
IJavaElement parent = element.getParent();
- if(parent!=null && parent instanceof IMember) {
+ if(parent instanceof IMember) {
return findAnnotationByShortName((IMember)parent, name, true);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java 2011-12-19 18:28:44 UTC (rev 37437)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java 2011-12-19 19:57:28 UTC (rev 37438)
@@ -47,7 +47,7 @@
}
}
}
- return ps.toArray(new IPath[0]);
+ return ps.toArray(new IPath[ps.size()]);
}
return new IPath[0];
}
@@ -63,7 +63,7 @@
ps.add(c.getFullPath());
}
}
- return ps.toArray(new IPath[0]);
+ return ps.toArray(new IPath[ps.size()]);
}
return new IPath[0];
}
14 years
JBoss Tools SVN: r37437 - trunk/common/tests/org.jboss.tools.common.verification.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-12-19 13:28:44 -0500 (Mon, 19 Dec 2011)
New Revision: 37437
Modified:
trunk/common/tests/org.jboss.tools.common.verification.test/META-INF/MANIFEST.MF
Log:
JBIDE-10529 running locally, doesn't seem to matter if manifest states junit or junit4, so switch to junit4 for shi*s and giggles to test in Jenkins
Modified: trunk/common/tests/org.jboss.tools.common.verification.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.verification.test/META-INF/MANIFEST.MF 2011-12-19 17:50:39 UTC (rev 37436)
+++ trunk/common/tests/org.jboss.tools.common.verification.test/META-INF/MANIFEST.MF 2011-12-19 18:28:44 UTC (rev 37437)
@@ -7,7 +7,7 @@
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.common.verification.test
Require-Bundle:
- org.junit,
+ org.junit4,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.jboss.tools.common.model,
14 years
JBoss Tools SVN: r37436 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-12-19 12:50:39 -0500 (Mon, 19 Dec 2011)
New Revision: 37436
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
Log:
fixed compilation error
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2011-12-19 17:26:08 UTC (rev 37435)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2011-12-19 17:50:39 UTC (rev 37436)
@@ -6,11 +6,7 @@
Bundle-ClassPath: .,
resources/drv/hsqldb.jar
Bundle-Activator: org.jboss.tools.ui.bot.ext.Activator
-Export-Package: org,
- org.jboss,
- org.jboss.tools,
- org.jboss.tools.ui,
- org.jboss.tools.ui.bot,
+Export-Package:
org.jboss.tools.ui.bot.ext,
org.jboss.tools.ui.bot.ext.condition,
org.jboss.tools.ui.bot.ext.config,
14 years
JBoss Tools SVN: r37435 - in trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-19 12:26:08 -0500 (Mon, 19 Dec 2011)
New Revision: 37435
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
Log:
JBIDE-10504 : fix selecting a package from the previous history to enable the Finish Button
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2011-12-19 16:45:49 UTC (rev 37434)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2011-12-19 17:26:08 UTC (rev 37435)
@@ -19,13 +19,9 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.m2e.core.MavenPlugin;
@@ -33,7 +29,6 @@
import org.eclipse.m2e.core.project.LocalProjectScanner;
import org.eclipse.m2e.core.project.MavenProjectInfo;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.maven.project.examples.wizard.ArchetypeExamplesWizard;
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2011-12-19 16:45:49 UTC (rev 37434)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2011-12-19 17:26:08 UTC (rev 37435)
@@ -20,13 +20,11 @@
import org.apache.maven.model.Model;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -35,7 +33,6 @@
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
import org.eclipse.osgi.util.NLS;
@@ -43,11 +40,9 @@
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
-import org.jboss.tools.maven.project.examples.ImportMavenArchetypeProjectExample;
import org.jboss.tools.maven.project.examples.MavenProjectExamplesActivator;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
@@ -180,15 +175,17 @@
@Override
public void modifyText(ModifyEvent e) {
wizardPage.setArtifactId(simplePage.getProjectName());
+ ArchetypeExamplesWizard.this.getContainer().updateButtons();
}
});
simplePage.setPackageNameModifyListener(new ModifyListener() {
-
+
@Override
public void modifyText(ModifyEvent e) {
String packageName = ((Combo)e.getSource()).getText();
wizardPage.setPackageName(packageName);
+ ArchetypeExamplesWizard.this.getContainer().updateButtons();
}
});
@@ -201,11 +198,7 @@
});
}
- @Override
- public boolean canFinish() {
- // TODO Auto-generated method stub
- return super.canFinish();
- }
+
public String getProjectName() {
return projectName;
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-12-19 16:45:49 UTC (rev 37434)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2011-12-19 17:26:08 UTC (rev 37435)
@@ -33,7 +33,6 @@
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ViewerColumn;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
14 years
JBoss Tools SVN: r37434 - in trunk/ws/tests/org.jboss.tools.ws.ui.bot.test: src/org/jboss/tools/ws/ui/bot/test and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-12-19 11:45:49 -0500 (Mon, 19 Dec 2011)
New Revision: 37434
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java
Removed:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java
Log:
SimpleRESTWebServiceTest and SimpleSoapWebServiceTest added
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/resources/jbossws/Rest.java.ws 2011-12-19 16:45:49 UTC (rev 37434)
@@ -1,49 +0,0 @@
-package rest.sample;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-@Path("/RESTSample")
-public class Sample {
-
- @GET()
- @Produces("text/plain")
- public String method1() {
- return "Hello World!";
- }
-
-
-
- @GET()
- @Path("{name}")
- @Produces("text/plain")
- public String method2(@PathParam("name")String name) {
- return "Hello " + name;
- }
-
- @POST()
- @Path("PostMethod")
- @Produces("text/plain")
- public void method3() {
-
- }
-
- @PUT()
- @Path("PutMethod")
- public void method4() {
-
- }
-
-
- @DELETE()
- @Path("DeleteMethod")
- public void method5() {
-
- }
-
-}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -11,8 +11,10 @@
package org.jboss.tools.ws.ui.bot.test;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ws.ui.bot.test.sample.SampleRESTWebServiceTest;
-import org.jboss.tools.ws.ui.bot.test.sample.SampleSoapWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SampleRESTWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SampleSoapWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SimpleRESTWebServiceTest;
+import org.jboss.tools.ws.ui.bot.test.sample.test.SimpleSoapWebServiceTest;
import org.jboss.tools.ws.ui.bot.test.webservice.BottomUpWSTest;
import org.jboss.tools.ws.ui.bot.test.webservice.TopDownWSTest;
import org.jboss.tools.ws.ui.bot.test.webservice.eap.EAPFromJavaTest;
@@ -45,6 +47,8 @@
@SuiteClasses({
SampleSoapWebServiceTest.class,
SampleRESTWebServiceTest.class,
+ SimpleSoapWebServiceTest.class,
+ SimpleRESTWebServiceTest.class,
BottomUpWSTest.class,
TopDownWSTest.class,
WsClientTest.class,
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSTestBase.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -69,12 +69,6 @@
servers.removeAllProjectsFromServer();
}
- @AfterClass
- public static void cleanAll() {
- LOGGER.info("cleanAll");
- projectExplorer.deleteAllProjects();
- }
-
protected Slider_Level getLevel() {
return level;
}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTTestBase.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.sample;
+
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleRESTTestBase extends SampleWSBase {
+
+ protected void createSampleRESTWS(String project, String name, String pkg,
+ String cls, String appCls) {
+ createSampleService(Type.REST, project, name, pkg, cls, appCls);
+ }
+
+ protected void createSimpleRESTWS(String project, String name, String pkg,
+ String cls, String appCls) {
+ createSimpleService(Type.REST, project, name, pkg, cls, appCls);
+ }
+
+ protected void checkRESTService(String project, String svcName,
+ String svcPkg, String svcClass, String msgContent, String appCls) {
+ checkService(Type.REST, project, svcName, svcPkg, svcClass, msgContent, appCls);
+ }
+
+}
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleRESTWebServiceTest.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.bot.test.sample;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ws.ui.bot.test.uiutils.actions.TreeItemAction;
-import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard.Type;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- * @author jjankovi
- *
- */
-public class SampleRESTWebServiceTest extends SampleWSBase {
-
- private final String REST_WS_NODE = "JAX-RS REST Web Services";
- private final String REST_SUPPORT = "Add JAX-RS 1.1 support...";
- private final String CONFIGURE_CONTEXT = "Configure";
-
- @Override
- protected String getWsProjectName() {
- return "SampleRESTWS";
- }
-
- @Test
- public void testSampleRestWS() {
- if ("JBOSS_AS".equals(configuredState.getServer().type)) {
- fail("This test requires RESTEasy jars in the server");
- }
- IFile dd = getDD(getWsProjectName());
- if (!dd.exists()) {
- createDD(getWsProjectName());
- }
- assertTrue(dd.exists());
- createSampleRESTWS(getWsProjectName(), "RESTSample", "rest.sample", "Sample", "RESTApp");
- checkRESTService(getWsProjectName(), "RESTSample", "rest.sample", "Sample", "Hello World!", "RESTApp");
- }
- @Ignore //not implemented yet
- @Test
- public void testSimpleRestWS() {
-
- }
-
- private int numberOfService(ArrayList<String> services, String serviceType) {
- int count = 0;
- for (String service: services) {
- if (service.contains(serviceType)) {
- count++;
- }
- }
- return count;
- }
-
- private void checkRESTService(String project, String svcName, String svcPkg, String svcClass, String msgContent, String appCls) {
- checkService(Type.REST, project, svcName, svcPkg, svcClass, msgContent, appCls);
- checkRestSupport(project,svcName);
- }
-
- private void createSampleRESTWS(String project, String name, String pkg, String cls, String appCls) {
- SWTBotEditor ed = createSampleService(Type.REST, project, name, pkg, cls, appCls);
- resourceHelper.copyResourceToClass(ed, SampleRESTWebServiceTest.class.
- getResourceAsStream("/resources/jbossws/Rest.java.ws"),false);
- }
-
- private void checkRestSupport(String project, String servName) {
- addRestSupport(project);
- testRestSupport(project, servName);
- }
-
- private void addRestSupport(String project) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem ti = tree.expandNode(project);
- new TreeItemAction(ti, CONFIGURE_CONTEXT, REST_SUPPORT).run();
- bot.sleep(Timing.time500MS());
- util.waitForNonIgnoredJobs();
- try {
- ti.getNode(REST_WS_NODE);
- }catch (WidgetNotFoundException exc) {
- fail("REST support was not configured properly");
- }
- }
-
- private void testRestSupport(String project, String servName) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem ti = tree.expandNode(project, REST_WS_NODE);
- ArrayList<String> nodes = (ArrayList<String>)ti.getNodes();
-
-
- assertTrue("Should be 2 GET services instead of " +
- numberOfService(nodes,"GET"), numberOfService(nodes,"GET") == 2);
- assertTrue("Should be 1 DELETE service instead of " +
- numberOfService(nodes,"DELETE"), numberOfService(nodes,"DELETE") == 1);
- assertTrue("Should be 1 POST service instead of " +
- numberOfService(nodes,"POST"), numberOfService(nodes,"POST") == 1);
- assertTrue("Should be 1 PUT service instead of " +
- numberOfService(nodes,"PUT"), numberOfService(nodes,"PUT") == 1);
-
-
- assertTrue("Node's form should be {GET /RESTSample} instead of {" +
- nodes.get(0) + "}",nodes.get(0).equals("GET /" + servName));
- assertTrue("Node's form should be {DELETE /RESTSample/DeleteMethod} instead of {" +
- nodes.get(1) + "}",nodes.get(1).equals("DELETE /" + servName + "/DeleteMethod"));
- assertTrue("Node's form should be {POST /RESTSample/PostMethod} instead of {" +
- nodes.get(2) + "}",nodes.get(2).equals("POST /" + servName + "/PostMethod"));
- assertTrue("Node's form should be {PUT /RESTSample/PutMethod} instead of {" +
- nodes.get(3) + "}",nodes.get(3).equals("PUT /" + servName + "/PutMethod"));
- assertTrue("Node's form should be {GET /RESTSample/{name}} instead of {" +
- nodes.get(4) + "}",nodes.get(4).equals("GET /" + servName + "/{name}"));
-
- }
-
-}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapTestBase.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.sample;
+
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleSoapTestBase extends SampleWSBase {
+
+ protected void createSampleSOAPWS(String project, String name, String pkg, String cls) {
+ createSampleService(Type.SOAP, project, name, pkg, cls, null);
+ }
+
+ protected void createSimpleSOAPWS(String project, String name, String pkg, String cls) {
+ createSimpleService(Type.SOAP, project, name, pkg, cls, null);
+ }
+
+ protected void checkSOAPService(String project, String svcName, String svcPkg, String svcClass, String msgContent) {
+ checkService(Type.SOAP, project, svcName, svcPkg, svcClass, msgContent, null);
+ }
+
+}
Deleted: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleSoapWebServiceTest.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.ui.bot.test.sample;
-
-import org.eclipse.core.resources.IFile;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- * @author jjankovi
- *
- */
-public class SampleSoapWebServiceTest extends SampleWSBase {
-
- @Override
- protected String getWsProjectName() {
- return "SampleSOAPWS";
- }
-
- @Test
- public void testSampleSoapWS() {
- IFile dd = getDD(getWsProjectName());
- if (!dd.exists()) {
- createDD(getWsProjectName());
- }
- assertTrue(dd.exists());
- createSampleSOAPWS(getWsProjectName(), "HelloService", "sample", "SampleService");
- checkSOAPService(getWsProjectName(), "HelloService", "sample", "SampleService", "You");
-
- createSampleSOAPWS(getWsProjectName(), "GreetService", "greeter", "Greeter");
- checkSOAPService(getWsProjectName(), "GreetService", "greeter", "Greeter", "Tester");
- }
- @Ignore //not implemented yet
- @Test
- public void testSimpleSoapWS() {
-
- }
-}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/SampleWSBase.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -27,11 +27,12 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ws.ui.bot.test.WSTestBase;
import org.jboss.tools.ws.ui.bot.test.uiutils.actions.NewSampleWSWizardAction;
+import org.jboss.tools.ws.ui.bot.test.uiutils.actions.NewSimpleWSWizardAction;
import org.jboss.tools.ws.ui.bot.test.uiutils.actions.TreeItemAction;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard;
-import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard.Type;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SimpleWSWizard;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
import org.jboss.tools.ws.ui.bot.test.wsclient.WSClient;
-import org.junit.AfterClass;
/**
*
@@ -42,11 +43,6 @@
protected static final String SOAP_REQUEST = getSoapRequest("<ns1:sayHello xmlns:ns1=\"http://{0}/\"><arg0>{1}</arg0></ns1:sayHello>");
protected static final String SERVER_URL = "localhost:8080";
-
- @AfterClass
- public static void clean() {
- servers.removeAllProjectsFromServer();
- }
protected void createDD(String project) {
SWTBotTree tree = projectExplorer.bot().tree();
@@ -58,22 +54,35 @@
util.waitForNonIgnoredJobs();
bot.sleep(1500);
}
-
- protected void createSampleSOAPWS(String project, String name, String pkg, String cls) {
- createSampleService(Type.SOAP, project, name, pkg, cls, null);
+
+ protected IProject getProject(String project) {
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ }
+
+ protected IFile getDD(String project) {
+ return getProject(project).getFile("WebContent/WEB-INF/web.xml");
+ }
+
+ protected SWTBotEditor createSampleService(Type type, String project, String name, String pkg, String cls, String appCls) {
+ SampleWSWizard w = new NewSampleWSWizardAction(type).run();
+ w.setProjectName(project).setServiceName(name);
+ w.setPackageName(pkg).setClassName(cls);
+ if (type == Type.REST) {
+ w.setApplicationClassName(appCls);
+ w.addRESTEasyLibraryFromRuntime();
+ }
+ w.finish();
+ util.waitForNonIgnoredJobs();
+ return bot.editorByTitle(cls + ".java");
}
-
- protected void checkSOAPService(String project, String svcName, String svcPkg, String svcClass, String msgContent) {
- checkService(Type.SOAP, project, svcName, svcPkg, svcClass, msgContent, null);
- }
-
- protected SWTBotEditor createSampleService(Type type, String project, String name, String pkg, String cls, String appCls) {
- SampleWSWizard w = new NewSampleWSWizardAction(type).run();
+
+ protected SWTBotEditor createSimpleService(Type type, String project, String name, String pkg, String cls, String appCls) {
+ SimpleWSWizard w = new NewSimpleWSWizardAction(type).run();
w.setProjectName(project).setServiceName(name);
w.setPackageName(pkg).setClassName(cls);
if (type == Type.REST) {
- w.setApplicationClassName(appCls);
- w.addRESTEasyLibraryFromRuntime();
+ w.addRESTEasyLibraryFromRuntime();
+ w.setApplicationClassName(appCls);
}
w.finish();
util.waitForNonIgnoredJobs();
@@ -81,8 +90,8 @@
}
protected void checkService(Type type, String project, String svcName, String svcPkg, String svcClass, String msgContent, String appCls) {
- SWTBotEditor ed = bot.activeEditor();
- assertEquals(svcClass + ".java", ed.getTitle());
+ SWTBotEditor ed = bot.editorByTitle(svcClass + ".java");
+ ed.show();
String code = ed.toTextEditor().getText();
assertContains("package " + svcPkg + ";", code);
String dd = resourceHelper.readFile(getDD(project));
@@ -124,13 +133,4 @@
}
}
- protected IProject getProject(String project) {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- }
-
- protected IFile getDD(String project) {
- return getProject(project).getFile("WebContent/WEB-INF/web.xml");
- }
-
-
}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleRESTWebServiceTest.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleRESTTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleRESTWebServiceTest extends SampleRESTTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SampleRESTWS";
+ }
+
+ @Test
+ public void testSampleRestWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSampleRESTWS(getWsProjectName(), "RESTSample", "rest.sample", "Sample", "RESTApp");
+ checkRESTService(getWsProjectName(), "RESTSample", "rest.sample", "Sample", "Hello World!", "RESTApp");
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SampleSoapWebServiceTest.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleSoapTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SampleSoapWebServiceTest extends SampleSoapTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SampleSOAPWS";
+ }
+
+ @Test
+ public void testSampleSoapWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSampleSOAPWS(getWsProjectName(), "HelloService", "sample", "SampleService");
+ checkSOAPService(getWsProjectName(), "HelloService", "sample", "SampleService", "You");
+
+ createSampleSOAPWS(getWsProjectName(), "GreetService", "greeter", "Greeter");
+ checkSOAPService(getWsProjectName(), "GreetService", "greeter", "Greeter", "Tester");
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleRESTWebServiceTest.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleRESTTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SimpleRESTWebServiceTest extends SampleRESTTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SimpleRESTWS";
+ }
+
+ @Test
+ public void testSimpleRestWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSimpleRESTWS(getWsProjectName(), "RESTSample", "rest.sample", "Sample", "RESTApp");
+ checkRESTService(getWsProjectName(), "RESTSample", "rest.sample", "Sample", "Hello World!", "RESTApp");
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/sample/test/SimpleSoapWebServiceTest.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.sample.test;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.ws.ui.bot.test.sample.SampleSoapTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SimpleSoapWebServiceTest extends SampleSoapTestBase {
+
+ @Override
+ protected String getWsProjectName() {
+ return "SimpleSOAPWS";
+ }
+
+ @Test
+ public void testSimpleSoapWS() {
+ IFile dd = getDD(getWsProjectName());
+ if (!dd.exists()) {
+ createDD(getWsProjectName());
+ }
+ assertTrue(dd.exists());
+ createSimpleSOAPWS(getWsProjectName(), "HelloService", "sample", "SampleService");
+ checkSOAPService(getWsProjectName(), "HelloService", "sample", "SampleService", "You");
+
+ createSimpleSOAPWS(getWsProjectName(), "GreetService", "greeter", "Greeter");
+ checkSOAPService(getWsProjectName(), "GreetService", "greeter", "Greeter", "Tester");
+ }
+
+}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSampleWSWizardAction.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -11,7 +11,7 @@
package org.jboss.tools.ws.ui.bot.test.uiutils.actions;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard;
-import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard.Type;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Wizard;
public class NewSampleWSWizardAction extends NewFileWizardAction {
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java 2011-12-19 16:39:59 UTC (rev 37433)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/SampleWSWizard.java 2011-12-19 16:45:49 UTC (rev 37434)
@@ -10,32 +10,13 @@
******************************************************************************/
package org.jboss.tools.ws.ui.bot.test.uiutils.wizards;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
-import org.osgi.framework.Bundle;
public class SampleWSWizard extends Wizard {
- private static final Bundle WSUI_BUNDLE = Platform.getBundle("org.jboss.tools.ws.ui");
-
- public enum Type {
- SOAP, REST;
-
- public String getLabel() {
- switch (this) {
- case SOAP:
- return getStringFromBundle("%JBOSSWS_GENERATEACTION_LABEL");
- case REST:
- return getStringFromBundle("%restful.wizard.name");
- default:
- throw new IllegalArgumentException("Unknown type: " + this);
- }
- }
- }
-
private Type type;
public SampleWSWizard(Type type) throws WidgetNotFoundException {
@@ -79,7 +60,4 @@
return this;
}
- private static String getStringFromBundle(String key) {
- return Platform.getResourceString(WSUI_BUNDLE, key);
- }
}
14 years
JBoss Tools SVN: r37433 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-12-19 11:39:59 -0500 (Mon, 19 Dec 2011)
New Revision: 37433
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSimpleWSWizardAction.java
Log:
NewSimpleWSWizardAction added
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSimpleWSWizardAction.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSimpleWSWizardAction.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/actions/NewSimpleWSWizardAction.java 2011-12-19 16:39:59 UTC (rev 37433)
@@ -0,0 +1,24 @@
+package org.jboss.tools.ws.ui.bot.test.uiutils.actions;
+
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SimpleWSWizard;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Type;
+import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.Wizard;
+
+public class NewSimpleWSWizardAction extends NewFileWizardAction {
+
+ private final Type type;
+
+ public NewSimpleWSWizardAction(Type type) {
+ super();
+ this.type = type;
+ }
+
+ @Override
+ public SimpleWSWizard run() {
+ Wizard w = super.run();
+ w.selectTemplate("Web Services", "Simple Web Service");
+ w.next();
+ return new SimpleWSWizard(type);
+ }
+
+}
14 years