JBoss Tools SVN: r22255 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 21:22:11 -0400 (Fri, 21 May 2010)
New Revision: 22255
Modified:
trunk/build/build.xml
Log:
add collect.test.results.for.hudson target so we can call this AFTER a pure maven build to just collect tests
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2010-05-21 23:38:12 UTC (rev 22254)
+++ trunk/build/build.xml 2010-05-22 01:22:11 UTC (rev 22255)
@@ -516,14 +516,7 @@
<echo level="warning">All components up to date: nothing to do!
To force a build of unchanged components, use -Dbuild.if.sources.unchanged=true</echo>
- <!-- create fake test result file to avoid Hudson failure -->
- <delete dir="${basedir}/surefire-reports/NoTestsRun" includeemptydirs="true" />
- <mkdir dir="${basedir}/surefire-reports/NoTestsRun" />
- <echo file="${basedir}/surefire-reports/NoTestsRun/TEST-org.jboss.tools.NoTestsRun.xml"><?xml version="1.0" encoding="UTF-8" ?>
-<testsuite failures="0" time="0.001" errors="0" skipped="0" tests="1" name="org.jboss.tools.NoTestsRun">
- <testcase time="0.001" classname="org.jboss.tools.NoTestsRun" name="NoTestsRun"/>
-</testsuite>
-</echo>
+ <antcall target="create.empty.test.results.file" />
<property name="no.tests.run" value="true" />
<property name="no.overall" value="true" />
</then>
@@ -551,6 +544,45 @@
</if>
</target>
+ <target name="collect.test.results.for.hudson" description="collect test results after a pure maven build so Hudson has something to see">
+ <var name="tests.results.found" value="false" />
+ <for param="test.dir">
+ <path>
+ <dirset dir="${WORKINGDIR}"
+ includes="**/target/surefire-reports/TEST-*.xml"
+ excludes="**/*NoTestsRun.xml"
+ />
+ </path>
+ <sequential>
+ <var name="tests.results.found" value="true" />
+ </sequential>
+ </for>
+ <if>
+ <equals arg1="${tests.results.found}" arg2="false" />
+ <then>
+ <antcall target="create.empty.test.results.file" />
+ <property name="no.tests.run" value="true" />
+ </then>
+ <else>
+ <antcall target="collect.test.results">
+ <param name="COMPONENT" value="." />
+ </antcall>
+ <antcall target="collect.all.test.results"/>
+ </else>
+ </if>
+ </target>
+
+ <target name="create.empty.test.results.file">
+ <!-- create fake test result file to avoid Hudson failure -->
+ <delete dir="${basedir}/surefire-reports/NoTestsRun" includeemptydirs="true" />
+ <mkdir dir="${basedir}/surefire-reports/NoTestsRun" />
+ <echo file="${basedir}/surefire-reports/NoTestsRun/TEST-org.jboss.tools.NoTestsRun.xml"><?xml version="1.0" encoding="UTF-8" ?>
+<testsuite failures="0" time="0.001" errors="0" skipped="0" tests="1" name="org.jboss.tools.NoTestsRun">
+<testcase time="0.001" classname="org.jboss.tools.NoTestsRun" name="NoTestsRun"/>
+</testsuite>
+</echo>
+ </target>
+
<target name="run.build">
<!-- could set -Dmaven.test.skip to skip tests, or use osgi-test:test to just (re-)run tests w/o first building -->
<property name="MAVEN_FLAGS" value="clean install -B -fn -q -U -e" />
@@ -742,7 +774,7 @@
preservelastmodified="true"
overwrite="true"
>
- <fileset dir="${WORKINGDIR}/${COMPONENT}" includes="**/target/surefire-reports/*.xml" />
+ <fileset dir="${WORKINGDIR}/${COMPONENT}" includes="**/target/surefire-reports/TEST-*.xml" />
</copy>
</target>
@@ -754,10 +786,7 @@
<for param="testresultfile" delimiter=",
">
<path>
- <fileset dir="${basedir}/surefire-reports/"
- includes="**/TEST-*.xml"
- excludes="**/*pom.xml, **/build.xml"
- />
+ <fileset dir="${basedir}/surefire-reports/" includes="**/TEST-*.xml" />
</path>
<sequential>
<var name="testsuite.name" unset="true" />
@@ -918,7 +947,7 @@
/>
</sequential>
</for>
-
+
<for param="updateZip">
<path>
<fileset dir="${WORKINGDIR}/@{COMPONENT}" includes="**/JBossTools*Update*.zip" />
@@ -1194,10 +1223,26 @@
</echo>
<mkdir dir="${updateSiteJarDir}/../features" />
+ <if>
+ <!-- special case: for tests component, we WANT test features; for everyone else, test features shouldn't be on the site -->
+ <equals arg1="${COMPONENT}" arg2="tests" />
+ <then>
+ <path id="featureJars">
+ <fileset dir="${updateSiteJarDir}/../features" includes="**/target/*.jar" />
+ </path>
+ </then>
+ <else>
+ <path id="featureJars">
+ <fileset dir="${updateSiteJarDir}/../features"
+ includes="**/target/*.jar"
+ excludes="**/*test*"
+ id=""
+ />
+ </path>
+ </else>
+ </if>
<for param="featureJar">
- <path>
- <fileset dir="${updateSiteJarDir}/../features" includes="**/target/*.jar" excludes="**/*test*" />
- </path>
+ <path refid="featureJars" />
<sequential>
<var name="feature.jarfile" unset="true" />
<var name="feature.id" unset="true" />
15 years, 11 months
JBoss Tools SVN: r22254 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 19:38:12 -0400 (Fri, 21 May 2010)
New Revision: 22254
Modified:
trunk/build/publish.sh
Log:
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-05-21 23:19:37 UTC (rev 22253)
+++ trunk/build/publish.sh 2010-05-21 23:38:12 UTC (rev 22254)
@@ -5,10 +5,10 @@
ZIPNAME=${JOB_NAME}-Update-H${BUILD_NUMBER}-${BUILD_ID}.zip
# copy into workspace for archiving
-rm -fr ${WORKSPACE}/site; mkdir -p ${WORKSPACE}/site
-rsync -aq ${WORKSPACE}/*/site/target/site.zip ${WORKSPACE}/site/${ZIPNAME}
+rm -fr ${WORKSPACE}/site; mkdir -p ${WORKSPACE}/site/${JOB_NAME}
+rsync -aq ${WORKSPACE}/*/site/target/site.zip ${WORKSPACE}/site/${JOB_NAME}/${ZIPNAME}
# publish to download.jboss.org
if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools"; fi
-rsync -arzq --delete ${WORKSPACE}/site/* $DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/
+rsync -arzq --delete ${WORKSPACE}/site/${JOB_NAME} $DESTINATION/builds/nightly/3.2.helios/
15 years, 11 months
JBoss Tools SVN: r22253 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 19:19:37 -0400 (Fri, 21 May 2010)
New Revision: 22253
Modified:
trunk/build/publish.sh
Log:
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-05-21 23:05:17 UTC (rev 22252)
+++ trunk/build/publish.sh 2010-05-21 23:19:37 UTC (rev 22253)
@@ -10,5 +10,5 @@
# publish to download.jboss.org
if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools"; fi
-rsync -aq --delete ${WORKSPACE}/site/* $DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/
+rsync -arzq --delete ${WORKSPACE}/site/* $DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/
15 years, 11 months
JBoss Tools SVN: r22252 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 19:05:17 -0400 (Fri, 21 May 2010)
New Revision: 22252
Modified:
trunk/build/publish.sh
Log:
move zip into site/ folder to allow better 'rsync --delete'
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-05-21 22:29:32 UTC (rev 22251)
+++ trunk/build/publish.sh 2010-05-21 23:05:17 UTC (rev 22252)
@@ -5,11 +5,10 @@
ZIPNAME=${JOB_NAME}-Update-H${BUILD_NUMBER}-${BUILD_ID}.zip
# copy into workspace for archiving
-rm -fr ${WORKSPACE}/${JOB_NAME}-Update*.zip
-rsync -aq ${WORKSPACE}/*/site/target/site.zip ${WORKSPACE}/${ZIPNAME}
+rm -fr ${WORKSPACE}/site; mkdir -p ${WORKSPACE}/site
+rsync -aq ${WORKSPACE}/*/site/target/site.zip ${WORKSPACE}/site/${ZIPNAME}
# publish to download.jboss.org
if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools"; fi
-rsync -aq --delete ${WORKSPACE}/${ZIPNAME} $DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/
+rsync -aq --delete ${WORKSPACE}/site/* $DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/
-
15 years, 11 months
JBoss Tools SVN: r22251 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 18:29:32 -0400 (Fri, 21 May 2010)
New Revision: 22251
Added:
trunk/build/publish.sh
Log:
new publishing script for use with Hudson jobs
Added: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh (rev 0)
+++ trunk/build/publish.sh 2010-05-21 22:29:32 UTC (rev 22251)
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Hudson script used to publish Tycho-built p2 update sites
+
+# define target zip filename
+ZIPNAME=${JOB_NAME}-Update-H${BUILD_NUMBER}-${BUILD_ID}.zip
+
+# copy into workspace for archiving
+rm -fr ${WORKSPACE}/${JOB_NAME}-Update*.zip
+rsync -aq ${WORKSPACE}/*/site/target/site.zip ${WORKSPACE}/${ZIPNAME}
+
+# publish to download.jboss.org
+if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools"; fi
+rsync -aq --delete ${WORKSPACE}/${ZIPNAME} $DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/
+
+
15 years, 11 months
JBoss Tools SVN: r22250 - trunk/modeshape.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 17:25:44 -0400 (Fri, 21 May 2010)
New Revision: 22250
Modified:
trunk/modeshape/pom.xml
Log:
add site to pom
Modified: trunk/modeshape/pom.xml
===================================================================
--- trunk/modeshape/pom.xml 2010-05-21 21:25:19 UTC (rev 22249)
+++ trunk/modeshape/pom.xml 2010-05-21 21:25:44 UTC (rev 22250)
@@ -15,6 +15,7 @@
<module>features</module>
<module>plugins</module>
<module>tests</module>
+ <module>site</module>
</modules>
</project>
-
\ No newline at end of file
+
15 years, 11 months
JBoss Tools SVN: r22249 - in trunk/modeshape: site and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-21 17:25:19 -0400 (Fri, 21 May 2010)
New Revision: 22249
Added:
trunk/modeshape/site/
trunk/modeshape/site/pom.xml
trunk/modeshape/site/site.xml
Log:
add update site
Added: trunk/modeshape/site/pom.xml
===================================================================
--- trunk/modeshape/site/pom.xml (rev 0)
+++ trunk/modeshape/site/pom.xml 2010-05-21 21:25:19 UTC (rev 22249)
@@ -0,0 +1,13 @@
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>modeshape.site</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>eclipse-update-site</packaging>
+</project>
Added: trunk/modeshape/site/site.xml
===================================================================
--- trunk/modeshape/site/site.xml (rev 0)
+++ trunk/modeshape/site/site.xml 2010-05-21 21:25:19 UTC (rev 22249)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>To install these features, point Eclipse at this site.</description>
+ <!-- JBoss Tools modeshape Nightly Build Update Site -->
+ <category-def label="JBoss Tools modeshape Nightly Build Update Site" name="JBoss Tools modeshape Nightly Build Update Site">
+ <description>JBoss Tools modeshape Nightly Build Update Site: contains all features in this build.</description>
+ </category-def>
+ <feature url="features/org.jboss.tools.modeshape.rest.feature_0.0.0.jar" id="org.jboss.tools.modeshape.rest.feature" version="0.0.0">
+ <category name="JBoss Tools modeshape Nightly Build Update Site"/>
+ </feature>
+
+</site>
15 years, 11 months
JBoss Tools SVN: r22248 - in trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui: preferences and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-05-21 17:15:03 -0400 (Fri, 21 May 2010)
New Revision: 22248
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorageInput.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
Log:
JBIDE-6326 - adding ability to open WS invoke results in the XML editor
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-05-21 15:14:04 UTC (rev 22247)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-05-21 21:15:03 UTC (rev 22248)
@@ -71,6 +71,7 @@
JAXRSWSTestView_Action_URL_Label=Action URL:
JAXRSWSTestView_Configure_Monitor_Button=Configure Monitor
+JAXRSWSTestView_CopyResultsMenu=&Copy
JAXRSWSTestView_Exception_Status=Exception:
JAXRSWSTestView_HTTP_Method_Label=HTTP Method:
JAXRSWSTestView_Invoke_Label=Invoke
@@ -78,6 +79,8 @@
JAXRSWSTestView_JAXRS_Success_Status=Successful JAX-RS Web Service Execution
JAXRSWSTestView_JAXWS_Success_Status=Successful JAX-WS Web Service Execution
JAXRSWSTestView_Open_Monitor_Button=Open Monitor
+JAXRSWSTestView_Open_Response_Tag_Contents_in_XML_Editor=Open &Response tag contents in XML Editor
+JAXRSWSTestView_Open_Result_in_XML_Editor=&Open in XML Editor
JAXRSWSTestView_Request_Body_Label=Request Body
JAXRSWSTestView_Request_Header_Label=Request Header
JAXRSWSTestView_Request_Parameters_Label=Request Parameters
@@ -86,3 +89,4 @@
JAXRSWSTestView_Service_URL_Label=Service URL:
JAXRSWSTestView_Set_Sample_Data_Label=Set Sample Data
JAXRSWSTestView_Web_Service_Type_Label=Web Service Type:
+ResultsXMLStorageInput_WS_Invocation_Results_Prefix=Web Service Invocation Results:
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-05-21 15:14:04 UTC (rev 22247)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-05-21 21:15:03 UTC (rev 22248)
@@ -94,6 +94,7 @@
public static String JBossWS_DelimitedStringList_EditValue_Dialog_Message;
public static String JAXRSWSTestView_Action_URL_Label;
public static String JAXRSWSTestView_Configure_Monitor_Button;
+ public static String JAXRSWSTestView_CopyResultsMenu;
public static String JAXRSWSTestView_Exception_Status;
public static String JAXRSWSTestView_HTTP_Method_Label;
public static String JAXRSWSTestView_Invoke_Label;
@@ -101,6 +102,8 @@
public static String JAXRSWSTestView_JAXRS_Success_Status;
public static String JAXRSWSTestView_JAXWS_Success_Status;
public static String JAXRSWSTestView_Open_Monitor_Button;
+ public static String JAXRSWSTestView_Open_Response_Tag_Contents_in_XML_Editor;
+ public static String JAXRSWSTestView_Open_Result_in_XML_Editor;
public static String JAXRSWSTestView_Request_Body_Label;
public static String JAXRSWSTestView_Request_Header_Label;
public static String JAXRSWSTestView_Request_Parameters_Label;
@@ -109,6 +112,7 @@
public static String JAXRSWSTestView_Service_URL_Label;
public static String JAXRSWSTestView_Set_Sample_Data_Label;
public static String JAXRSWSTestView_Web_Service_Type_Label;
+ public static String ResultsXMLStorageInput_WS_Invocation_Results_Prefix;
static {
NLS.initializeMessages(BUNDLE_NAME, JBossWSUIMessages.class);
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java 2010-05-21 15:14:04 UTC (rev 22247)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSRuntimeListFieldEditor.java 2010-05-21 21:15:03 UTC (rev 22248)
@@ -1073,7 +1073,6 @@
setDefaultRuntime();
}
- @SuppressWarnings("unchecked")
private void removeRuntime(JBossWSRuntime r) {
boolean used = JBossWSRuntimeManager.isRuntimeUsed(r.getName());
String title = JBossWSUIMessages.JBossWS_Runtime_Delete_Confirm_Title;
@@ -1092,7 +1091,7 @@
if (added.contains(r)) {
added.remove(r);
}
- ((List) getValue()).remove(r);
+ ((List<?>) getValue()).remove(r);
}
if (checkedElement == r) {
checkedElement = null;
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java 2010-05-21 15:14:04 UTC (rev 22247)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java 2010-05-21 21:15:03 UTC (rev 22248)
@@ -34,6 +34,8 @@
// the response message to pass back
private String resultBody;
+ private SOAPEnvelope resultSOAP;
+
// the result HTTP headers to pass back
private HashMap<String, String> resultHeaders;
@@ -63,6 +65,10 @@
return this.resultHeaders;
}
+ public SOAPEnvelope getResultSOAP(){
+ return this.resultSOAP;
+ }
+
/**
* Invoke the JAX-WS service
* @param endpointurl
@@ -91,16 +97,16 @@
}
Message message = new Message(document);
- SOAPEnvelope envelope = null;
+ resultSOAP = null;
this.resultBody = EMPTY_STRING;
try {
- envelope = call.invoke( message );
+ resultSOAP = call.invoke( message );
// Get back the response message
- if (envelope != null && envelope.getBody() != null) {
- this.resultBody = envelope.getBody().toString();
+ if (resultSOAP != null && resultSOAP.getBody() != null) {
+ this.resultBody = resultSOAP.getBody().toString();
}
// Get back the response HTTP headers and pass back as a Map
@@ -122,7 +128,7 @@
if (fault.getFaultString() != null) {
this.resultBody = fault.getFaultString();
}
-
+
// Get back the response HTTP headers and pass back as a Map
if (fault.getHeaders() != null && !fault.getHeaders().isEmpty()) {
Iterator<?> iter = fault.getHeaders().iterator();
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorage.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorage.java 2010-05-21 21:15:03 UTC (rev 22248)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.utils;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Temporary in-memory storage for WS invocation results
+ * to pass to the XML editor.
+ * @author bfitzpat
+ *
+ */
+public class ResultsXMLStorage implements IStorage {
+ private String string;
+
+ public ResultsXMLStorage(String input) {
+ this.string = input;
+ }
+
+ public InputStream getContents() throws CoreException {
+ return new ByteArrayInputStream(string.getBytes());
+ }
+
+ public IPath getFullPath() {
+ return null;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public String getName() {
+ int len = Math.min(5, string.length());
+ return string.substring(0, len).concat("..."); //$NON-NLS-1$
+ }
+
+ public boolean isReadOnly() {
+ return true;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorageInput.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorageInput.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorageInput.java 2010-05-21 21:15:03 UTC (rev 22248)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.utils;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
+
+/**
+ * Temporary in-memory storage for WS invocation results
+ * to pass to the XML editor.
+ * @author bfitzpat
+ */
+public class ResultsXMLStorageInput implements IStorageEditorInput {
+
+ private IStorage storage;
+
+ public ResultsXMLStorageInput(IStorage storage) {
+ this.storage = storage;
+ }
+
+ public boolean exists() {
+ return true;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return storage.getName();
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public IStorage getStorage() {
+ return storage;
+ }
+
+ public String getToolTipText() {
+ return JBossWSUIMessages.ResultsXMLStorageInput_WS_Invocation_Results_Prefix + storage.getName();
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/ResultsXMLStorageInput.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2010-05-21 15:14:04 UTC (rev 22247)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2010-05-21 21:15:03 UTC (rev 22248)
@@ -17,6 +17,10 @@
import java.util.Iterator;
import java.util.Map.Entry;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+
+import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -27,6 +31,8 @@
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionEvent;
@@ -40,9 +46,14 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
@@ -52,7 +63,11 @@
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
import org.jboss.tools.ws.ui.utils.JAXRSTester;
import org.jboss.tools.ws.ui.utils.JAXWSTester;
+import org.jboss.tools.ws.ui.utils.ResultsXMLStorage;
+import org.jboss.tools.ws.ui.utils.ResultsXMLStorageInput;
import org.jboss.tools.ws.ui.utils.WSTestUtils;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* View for testing web services (JAX-WS & JAX-RS)
@@ -62,6 +77,7 @@
@SuppressWarnings("restriction")
public class JAXRSWSTestView extends ViewPart {
+ private static final String XML_EDITOR_ID = "org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"; //$NON-NLS-1$
private static final String TCPIP_VIEW_ID = "org.eclipse.wst.internet.monitor.view";//$NON-NLS-1$
private static final String DELETE = "DELETE";//$NON-NLS-1$
private static final String PUT = "PUT";//$NON-NLS-1$
@@ -100,6 +116,11 @@
private Button openTCPIPMonitorButton;
private Button addTCPIPMonitorButton;
+ private SOAPEnvelope envelope;
+ private MenuItem openInXMLEditorAction;
+ private MenuItem openResponseTagInXMLEditor;
+ private Menu resultsTextMenu;
+
/**
* The constructor.
*/
@@ -268,7 +289,7 @@
Button sampleButton = new Button(buttonBar, SWT.PUSH);
sampleButton.setText(JBossWSUIMessages.JAXRSWSTestView_Set_Sample_Data_Label);
- sampleButton.setVisible(false);
+ sampleButton.setVisible(true);
sampleButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
@@ -291,7 +312,98 @@
resultTab.setText(JBossWSUIMessages.JAXRSWSTestView_Results_Body_Label);
resultsText = new Text(resultTabGroup, SWT.BORDER | SWT.V_SCROLL | SWT.WRAP | SWT.READ_ONLY );
resultsText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ resultsTextMenu = new Menu(resultsText.getShell(), SWT.POP_UP);
+
+ MenuItem copyMenuAction = new MenuItem(resultsTextMenu, SWT.PUSH);
+ copyMenuAction.setText(JBossWSUIMessages.JAXRSWSTestView_CopyResultsMenu);
+ copyMenuAction.setAccelerator(SWT.CTRL + 'C');
+ copyMenuAction.addSelectionListener(new SelectionListener(){
+
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ resultsText.selectAll();
+ resultsText.copy();
+ }
+
+ public void widgetSelected(SelectionEvent arg0) {
+ widgetDefaultSelected(arg0);
+ }
+ });
+ new MenuItem(resultsTextMenu, SWT.SEPARATOR);
+
+ openInXMLEditorAction = new MenuItem(resultsTextMenu, SWT.PUSH);
+ openInXMLEditorAction.setText(JBossWSUIMessages.JAXRSWSTestView_Open_Result_in_XML_Editor);
+ openInXMLEditorAction.setAccelerator(SWT.CTRL + 'O');
+ openInXMLEditorAction.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent arg0) {
+ String string = resultsText.getText();
+ openXMLEditor(string);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ widgetSelected(arg0);
+ }
+ });
+
+ openResponseTagInXMLEditor = new MenuItem(resultsTextMenu, SWT.PUSH);
+ openResponseTagInXMLEditor.setText(JBossWSUIMessages.JAXRSWSTestView_Open_Response_Tag_Contents_in_XML_Editor);
+ openResponseTagInXMLEditor.setAccelerator(SWT.CTRL + 'R');
+ openResponseTagInXMLEditor.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent arg0) {
+ String string = null;
+ if (envelope != null){
+ try {
+ NodeList list = envelope.getBody().getChildNodes();
+ for (int i = 0; i< list.getLength(); i++){
+ Node node = list.item(i);
+ if (node.getNodeName().contains("Response")){ //$NON-NLS-1$
+ NodeList list2 = node.getChildNodes();
+ for (int j = 0; j<list2.getLength(); j++){
+ Node node2 = list2.item(j);
+ if (node2.getNodeName().contains("Result")){ //$NON-NLS-1$
+ Node node3 = node2.getChildNodes().item(0);
+ if (node3.getNodeType() == Node.TEXT_NODE) {
+ string = node3.getNodeValue();
+ break;
+ }
+ }
+ }
+ if (string != null) break;
+ }
+ }
+ if (string != null){
+ openXMLEditor(string);
+ }
+ } catch (SOAPException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ widgetSelected(arg0);
+ }
+ });
+
+ resultsText.setMenu(resultsTextMenu);
+
resultTab.setControl(resultsText);
+
+ resultsText.addFocusListener(new FocusListener() {
+
+ public void focusLost(FocusEvent arg0) {
+ }
+
+ public void focusGained(FocusEvent arg0) {
+ if (resultsText.getText().trim().length() > 0){
+ resultsTextMenu.setVisible(true);
+ } else {
+ resultsTextMenu.setVisible(false);
+ }
+ }
+ });
resultHeadersTab = new TabItem(resultTabGroup, SWT.NONE, 1);
resultHeadersTab.setText(JBossWSUIMessages.JAXRSWSTestView_Results_Header_Label);
@@ -306,6 +418,21 @@
setControlsForMethodType(methodCombo.getText());
setControlsForSelectedURL();
}
+
+ private void openXMLEditor (String text){
+ IWorkbenchWindow window = getSite().getWorkbenchWindow();
+ IStorage storage = new ResultsXMLStorage(text);
+ IStorageEditorInput input = new ResultsXMLStorageInput(storage);
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ try {
+// page.openEditor(input, "org.eclipse.ui.DefaultTextEditor");
+ page.openEditor(input, XML_EDITOR_ID);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+ }
private void setControlsForSelectedURL() {
if (urlCombo.getText().trim().length() > 0) {
@@ -439,6 +566,10 @@
if (bodyText.getText().trim().length() == 0) {
bodyText.setText(emptySOAP);
}
+
+ if (openResponseTagInXMLEditor != null &&
+ !openResponseTagInXMLEditor.isDisposed())
+ openResponseTagInXMLEditor.setEnabled(true);
}
else if (wsType.equalsIgnoreCase(JAX_RS)) {
actionText.setEnabled(false);
@@ -449,6 +580,9 @@
parmsTab.getControl().setEnabled(true);
headerTab.getControl().setEnabled(true);
methodCombo.setText(GET);
+ if (openResponseTagInXMLEditor != null &&
+ !openResponseTagInXMLEditor.isDisposed())
+ openResponseTagInXMLEditor.setEnabled(false);
}
}
@@ -505,7 +639,7 @@
} else {
urlCombo.add(urlCombo.getText());
}
-
+
final String url = urlCombo.getText();
final String action = actionText.getText();
final String body = bodyText.getText();
@@ -531,7 +665,7 @@
aJob.setUser(true);
aJob.schedule();
aJob.addJobChangeListener(new IJobChangeListener() {
-
+
public void sleeping(IJobChangeEvent event) {};
public void scheduled(IJobChangeEvent event) {};
public void running(IJobChangeEvent event) {};
@@ -553,7 +687,7 @@
});
}
}
-
+
public void awake(IJobChangeEvent event) {};
public void aboutToRun(IJobChangeEvent event) {};
});
@@ -565,14 +699,16 @@
*/
private IStatus handleWSTest(final IProgressMonitor monitor, String url, String action, String body) {
try {
-
+
+ envelope = null;
monitor.worked(10);
JAXWSTester tester = new JAXWSTester();
tester.doTest(url, action, body);
monitor.worked(70);
String result = tester.getResultBody();
+ envelope = tester.getResultSOAP();
String cleanedUp = WSTestUtils.addNLsToXML(result);
-
+
WSTestStatus status = new WSTestStatus(IStatus.OK,
JBossWSUIPlugin.PLUGIN_ID,
JBossWSUIMessages.JAXRSWSTestView_JAXWS_Success_Status);
@@ -656,10 +792,10 @@
// now actually call it
try {
-
+
// call the service
tester.doTest(address, parameters, headers, method, body);
-
+
String result = tester.getResultBody();
// put the results in the result text field
@@ -691,7 +827,7 @@
status.setHeadersList(listText);
monitor.worked(10);
return status;
-
+
} catch (Exception e) {
String result = tester.getResultBody();
@@ -724,12 +860,12 @@
status.setHeadersList(listText);
monitor.worked(10);
return status;
-// WSTestStatus status = new WSTestStatus(IStatus.ERROR,
-// JBossWSUIPlugin.PLUGIN_ID,
-// JBossWSUIMessages.JAXRSWSTestView_Exception_Status + e.getLocalizedMessage());
-// status.setResultsText(e.toString());
-// e.printStackTrace();
-// return status;
+ // WSTestStatus status = new WSTestStatus(IStatus.ERROR,
+ // JBossWSUIPlugin.PLUGIN_ID,
+ // JBossWSUIMessages.JAXRSWSTestView_Exception_Status + e.getLocalizedMessage());
+ // status.setResultsText(e.toString());
+ // e.printStackTrace();
+ // return status;
}
}
@@ -740,5 +876,5 @@
// set initial focus to the URL text combo
urlCombo.setFocus();
}
-
+
}
\ No newline at end of file
15 years, 11 months
JBoss Tools SVN: r22247 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core: impl/definition and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-21 11:14:04 -0400 (Fri, 21 May 2010)
New Revision: 22247
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-6310
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2010-05-21 14:59:14 UTC (rev 22246)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2010-05-21 15:14:04 UTC (rev 22247)
@@ -76,4 +76,21 @@
return definition.getAnnotationTypes();
}
+ public String getValue(String annotationTypeName) {
+ String text = definition.getAnnotationText(annotationTypeName);
+ if(text != null) {
+ int i = text.indexOf('(');
+ int j = text.lastIndexOf(')');
+ if(i >= 0 && j > i) {
+ String values = text.substring(i + 1, j).trim();
+ if(values.startsWith("\"") && values.endsWith("\"")) {
+ return values.substring(1, values.length() - 1);
+ }
+ //TODO improve
+ return values;
+ }
+ }
+ return null;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2010-05-21 14:59:14 UTC (rev 22246)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2010-05-21 15:14:04 UTC (rev 22247)
@@ -71,7 +71,9 @@
if(nameRange != null) range = nameRange;
int paramStart = content.indexOf('(', range.getOffset());
if(paramStart < 0) return;
- int paramEnd = content.indexOf(')', paramStart);
+ int declEnd = content.indexOf('{', paramStart);
+ if(declEnd < 0) return;
+ int paramEnd = content.lastIndexOf(')', declEnd);
if(paramEnd < 0) return;
String paramsString = content.substring(paramStart + 1, paramEnd);
if(paramsString.indexOf('@') < 0) return;
@@ -111,6 +113,8 @@
v.setValue(q);
v.valueStartPosition = start + params[i].indexOf(q);
v.valueLength = q.length();
+ int s = q.indexOf('(');
+ if(s >= 0) q = q.substring(0, s).trim();
String annotationType = EclipseJavaUtil.resolveType(contextType, q.substring(1).trim());
if(annotationType != null) pd.annotationsByTypeName.put(annotationType, v);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-05-21 14:59:14 UTC (rev 22246)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java 2010-05-21 15:14:04 UTC (rev 22247)
@@ -75,6 +75,16 @@
cache.put(key, result);
return result;
}
+ String[] ps = context.getTypeParameterSignatures();
+ for (int i = 0; i < ps.length; i++) {
+ String t = ps[i];
+ if(t.endsWith(":")) t = t.substring(0, t.length() - 1);
+ t = "Q" + t + ";";
+ if(t.equals(result.getSignature())) {
+ cache. put(key, result);
+ return result;
+ }
+ }
} else {
int endToken = typeSignature.lastIndexOf('>');
if(endToken < startToken) return null;
@@ -112,4 +122,4 @@
cache.clear();
}
-}
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2010-05-21 14:59:14 UTC (rev 22246)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2010-05-21 15:14:04 UTC (rev 22247)
@@ -62,4 +62,11 @@
public ITextSourceReference getPosition() {
return position;
}
+
+ public String getAnnotationText(String annotationTypeName) {
+ ITextSourceReference pos = getAnnotationPosition(annotationTypeName);
+ if(pos == null) return null;
+ String text = methodDefinition.getTypeDefinition().getContent().substring(pos.getStartPosition(), pos.getStartPosition() + pos.getLength());
+ return text;
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-21 14:59:14 UTC (rev 22246)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-21 15:14:04 UTC (rev 22247)
@@ -49,6 +49,7 @@
import org.jboss.tools.cdi.core.IDecorator;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.core.IInterceptor;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IParameter;
@@ -63,6 +64,7 @@
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.cdi.internal.core.impl.Parameter;
import org.jboss.tools.cdi.internal.core.impl.SessionBean;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.jst.web.kb.IKbProject;
@@ -757,7 +759,19 @@
* other than injected field declares a @Named annotation that does not
* specify the value member
*/
- if (!(injection instanceof IInjectionPointField)) {
+ if(injection instanceof IInjectionPointParameter) {
+ IInjectionPointParameter pinjection = (IInjectionPointParameter)injection;
+ if(pinjection.isAnnotationPresent(CDIConstants.NAMED_QUALIFIER_TYPE_NAME)) {
+ String value = ((Parameter)pinjection).getValue(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if(value == null || value.length() == 0) {
+ addError(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME,
+ CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME,
+ pinjection.getAnnotationPosition(CDIConstants.NAMED_QUALIFIER_TYPE_NAME),
+ injection.getResource());
+ }
+
+ }
+ } else if (!(injection instanceof IInjectionPointField)) {
IAnnotationDeclaration named = injection.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
if (named != null) {
try {
15 years, 11 months
JBoss Tools SVN: r22246 - in trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui: views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-05-21 10:59:14 -0400 (Fri, 21 May 2010)
New Revision: 22246
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
Log:
JBIDE-6281 - putting in better JAX-WS fault handling and JAX-RS parameter handling in URL ("?")
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java 2010-05-21 14:09:56 UTC (rev 22245)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java 2010-05-21 14:59:14 UTC (rev 22246)
@@ -157,8 +157,21 @@
URL url = null;
if (query != null) {
// add the ? if there are parameters
- if (!address.endsWith("?") && methodType.equalsIgnoreCase("GET") ) { //$NON-NLS-1$//$NON-NLS-2$
- address = address + "?"; //$NON-NLS-1$
+ if (!address.endsWith("?")) {//$NON-NLS-1$
+
+ // if we're a "GET" - add the ? by default
+ if (methodType.equalsIgnoreCase("GET")) { //$NON-NLS-1$
+ address = address + "?"; //$NON-NLS-1$
+
+ // if we're a PUT or POST, check if we have parms
+ // and add the ? if we do
+ } else if (methodType.equalsIgnoreCase("POST")//$NON-NLS-1$
+ || methodType.equalsIgnoreCase("PUT") //$NON-NLS-1$
+ || methodType.equalsIgnoreCase("DELETE")) { //$NON-NLS-1$
+ if (query.trim().length() > 0) {
+ address = address + "?"; //$NON-NLS-1$
+ }
+ }
}
// add parms to the url if we have some
url = new URL(address + query);
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java 2010-05-21 14:09:56 UTC (rev 22245)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester.java 2010-05-21 14:59:14 UTC (rev 22246)
@@ -17,6 +17,7 @@
import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
+import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.client.Call;
@@ -89,26 +90,61 @@
call.setProperty(Call.SOAPACTION_URI_PROPERTY,action);
}
Message message = new Message(document);
- SOAPEnvelope envelope = call.invoke( message );
- // Get back the response message
+ SOAPEnvelope envelope = null;
+
this.resultBody = EMPTY_STRING;
- if (envelope != null && envelope.getBody() != null) {
- this.resultBody = envelope.getBody().toString();
- }
-
- // Get back the response HTTP headers and pass back as a Map
- if (call != null && call.getMessageContext() != null) {
- MessageContext mc = call.getMessageContext();
- if (mc.getMessage() != null && mc.getMessage().getMimeHeaders() != null) {
- MimeHeaders mh = mc.getMessage().getMimeHeaders();
- Iterator<?> iter = mh.getAllHeaders();
+
+ try {
+ envelope = call.invoke( message );
+
+ // Get back the response message
+ if (envelope != null && envelope.getBody() != null) {
+ this.resultBody = envelope.getBody().toString();
+ }
+
+ // Get back the response HTTP headers and pass back as a Map
+ if (call != null && call.getMessageContext() != null) {
+ MessageContext mc = call.getMessageContext();
+ if (mc.getMessage() != null && mc.getMessage().getMimeHeaders() != null) {
+ MimeHeaders mh = mc.getMessage().getMimeHeaders();
+ Iterator<?> iter = mh.getAllHeaders();
+ resultHeaders = new HashMap<String, String>();
+ while (iter.hasNext()) {
+ MimeHeader next = (MimeHeader)iter.next();
+ resultHeaders.put(next.getName(), next.getValue());
+ }
+ }
+ }
+ } catch (AxisFault fault){
+
+ // Get back the response message
+ if (fault.getFaultString() != null) {
+ this.resultBody = fault.getFaultString();
+ }
+
+ // Get back the response HTTP headers and pass back as a Map
+ if (fault.getHeaders() != null && !fault.getHeaders().isEmpty()) {
+ Iterator<?> iter = fault.getHeaders().iterator();
resultHeaders = new HashMap<String, String>();
while (iter.hasNext()) {
- MimeHeader next = (MimeHeader)iter.next();
- resultHeaders.put(next.getName(), next.getValue());
+ Object next = iter.next();
+ resultHeaders.put(next.toString(), ""); //$NON-NLS-1$
}
+ } else if (call != null && call.getMessageContext() != null) {
+ MessageContext mc = call.getMessageContext();
+ if (mc.getMessage() != null && mc.getMessage().getMimeHeaders() != null) {
+ MimeHeaders mh = mc.getMessage().getMimeHeaders();
+ Iterator<?> iter = mh.getAllHeaders();
+ resultHeaders = new HashMap<String, String>();
+ while (iter.hasNext()) {
+ MimeHeader next = (MimeHeader)iter.next();
+ resultHeaders.put(next.getName(), next.getValue());
+ }
+ }
}
+
}
+
}
}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2010-05-21 14:09:56 UTC (rev 22245)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2010-05-21 14:59:14 UTC (rev 22246)
@@ -425,7 +425,7 @@
parmsList.setEnabled(false);
dlsList.setEnabled(false);
parmsTab.getControl().setEnabled(false);
- headerTab.getControl().setEnabled(false);
+ headerTab.getControl().setEnabled(true);
methodCombo.setText(POST);
String emptySOAP = "<?xml version=\"1.0\" standalone=\"yes\" ?>" + //$NON-NLS-1$
15 years, 11 months