JBossWS SVN: r17546 - in stack/native/tags/jbossws-native-3.1.2.SP15: modules/core and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-05-10 16:25:52 -0400 (Fri, 10 May 2013)
New Revision: 17546
Modified:
stack/native/tags/jbossws-native-3.1.2.SP15/
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java
stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java
stack/native/tags/jbossws-native-3.1.2.SP15/modules/testsuite/native-tests/
stack/native/tags/jbossws-native-3.1.2.SP15/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
stack/native/tags/jbossws-native-3.1.2.SP15/pom.xml
Log:
[JBPAPP-10740] using patch04 for xalan version and backporting security fix
Property changes on: stack/native/tags/jbossws-native-3.1.2.SP15
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP-8128:15667
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP6864:14776-14778,14786,14894,14905,14907-14908
/stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-6365:14192
/stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-8007:15579
/stack/native/branches/jbossws-native-3.4.0.SP1:13928,13933,13936,13946
/stack/native/trunk:12502,13992,14157,14160,14181,14183,14842
+ /stack/native/branches/jbossws-native-3.1.2:17030
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP-8128:15667
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP6864:14776-14778,14786,14894,14905,14907-14908
/stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-6365:14192
/stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-8007:15579
/stack/native/branches/jbossws-native-3.4.0.SP1:13928,13933,13936,13946
/stack/native/trunk:12502,13992,14157,14160,14181,14183,14842
Property changes on: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP-8128/modules/core:15667
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP6864/modules/core:14776-14778,14786,14894,14905,14907-14908
/stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-6365/modules/core:14192
/stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-8007/modules/core:15579
/stack/native/branches/jbossws-native-3.4.0.SP1/modules/core:13928,13933,13936,13946
/stack/native/trunk/modules/core:12502,13992,14011,14157,14160,14181,14183,14842
+ /stack/native/branches/jbossws-native-3.1.2/modules/core:17030
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP-8128/modules/core:15667
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP6864/modules/core:14776-14778,14786,14894,14905,14907-14908
/stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-6365/modules/core:14192
/stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-8007/modules/core:15579
/stack/native/branches/jbossws-native-3.4.0.SP1/modules/core:13928,13933,13936,13946
/stack/native/trunk/modules/core:12502,13992,14011,14157,14160,14181,14183,14842
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -76,6 +76,8 @@
{
// provide logging
private static Logger log = Logger.getLogger(WSSecurityDispatcher.class);
+
+ private static boolean VERBOSE_EXCEPTION_REPORTING = Boolean.getBoolean("org.jboss.ws.native.security.verbose_exception_reporting");
public void decodeMessage(WSSecurityConfiguration configuration, SOAPMessage message, Config operationConfig) throws SOAPException
{
@@ -88,7 +90,7 @@
if (secHeaderElement == null)
{
if (hasRequirements(config, fault))
- throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
+ throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."), true);
}
try
@@ -263,8 +265,18 @@
private CommonSOAPFaultException convertToFault(WSSecurityException e)
{
- return new CommonSOAPFaultException(e.getFaultCode(), e.getFaultString());
+ return convertToFault(e, VERBOSE_EXCEPTION_REPORTING);
}
+
+ private CommonSOAPFaultException convertToFault(WSSecurityException e, boolean verbose)
+ {
+ if (verbose) {
+ return new CommonSOAPFaultException(e.getFaultCode(), e.getFaultString());
+ } else {
+ QName faultCode = new QName(Constants.JBOSS_WSSE_NS, "GenericError", Constants.JBOSS_WSSE_PREFIX);
+ return new CommonSOAPFaultException(faultCode, "A WS-Security error occurred.");
+ }
+ }
private List<RequireOperation> buildRequireOperations(Config operationConfig, boolean fault)
{
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -32,8 +32,10 @@
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.KeyResolver;
import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.exception.FailedCheckException;
import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.extensions.security.operation.EncryptionOperation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -128,7 +130,16 @@
}
catch (XMLSecurityException e)
{
- throw new WSSecurityException("Could not parse encrypted key: " + e.getMessage(), e);
+ try
+ {
+ this.secretKey = EncryptionOperation.generateSecretKey(alg);
+ }
+ catch (Exception ex)
+ {
+ WSSecurityException exception = new FailedCheckException(e);
+ exception.setInternal(true);
+ throw exception;
+ }
}
this.document = element.getOwnerDocument();
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/FailedCheckException.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -32,7 +32,7 @@
{
public static final QName faultCode = new QName(Constants.WSSE_NS, "FailedCheck", Constants.WSSE_PREFIX);
- public static final String faultString = "The signature or decryption was invlaid.";
+ public static final String faultString = "The signature or decryption was invalid.";
public FailedCheckException()
{
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/exception/WSSecurityException.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -72,4 +72,9 @@
{
return faultString;
}
+
+ public void setInternal(boolean internal)
+ {
+ this.internal = internal;
+ }
}
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/DecryptionOperation.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -107,7 +107,7 @@
}
catch (XMLEncryptionException e)
{
- throw new FailedCheckException("Decryption was invalid.");
+ throw new FailedCheckException(e);
}
catch (Exception e)
{
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/EncryptionOperation.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -75,6 +75,7 @@
}
private static HashMap<String, Algorithm> algorithms;
+ private static HashMap<String, String> algorithmsID;
private static final String DEFAULT_ALGORITHM = "aes-128";
@@ -88,6 +89,12 @@
algorithms.put("aes-192-gcm", new Algorithm("AES", XMLCipher.AES_192_GCM, 192));
algorithms.put("aes-256-gcm", new Algorithm("AES", XMLCipher.AES_256_GCM, 256));
algorithms.put("tripledes", new Algorithm("TripleDes", XMLCipher.TRIPLEDES, 168));
+
+ algorithmsID = new HashMap<String, String>(4);
+ algorithmsID.put(XMLCipher.AES_128, "aes-128");
+ algorithmsID.put(XMLCipher.AES_192, "aes-192");
+ algorithmsID.put(XMLCipher.AES_256, "aes-256");
+ algorithmsID.put(XMLCipher.TRIPLEDES, "tripledes");
}
public EncryptionOperation(List<Target> targets, String alias, String algorithm, String wrap, String tokenRefType, String securityDomainAliasLabel)
@@ -130,7 +137,7 @@
}
}
- public SecretKey getSecretKey(String algorithm) throws WSSecurityException
+ private static SecretKey getSecretKey(String algorithm) throws WSSecurityException
{
Algorithm alg = algorithms.get(algorithm);
@@ -146,6 +153,11 @@
}
}
+ public static SecretKey generateSecretKey(String alg) throws WSSecurityException
+ {
+ return getSecretKey(algorithmsID.get(alg));
+ }
+
public void process(Document message, SecurityHeader header, SecurityStore store) throws WSSecurityException
{
if (! algorithms.containsKey(algorithm))
Property changes on: stack/native/tags/jbossws-native-3.1.2.SP15/modules/testsuite/native-tests
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP-8128/modules/testsuite/native-tests:15667
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP6864/modules/testsuite/native-tests:14776-14778,14786,14894,14905,14907-14908
/stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-6365/modules/testsuite/native-tests:14192
/stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-8007/modules/testsuite/native-tests:15579
/stack/native/branches/jbossws-native-3.4.0.SP1/modules/testsuite/native-tests:13928,13933,13936,13946
/stack/native/trunk/modules/testsuite/native-tests:12502,13992,14013,14157,14160,14181,14183,14842
+ /stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests:17030
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP-8128/modules/testsuite/native-tests:15667
/stack/native/branches/jbossws-native-3.1.2.SP10_JBPAPP6864/modules/testsuite/native-tests:14776-14778,14786,14894,14905,14907-14908
/stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-6365/modules/testsuite/native-tests:14192
/stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-8007/modules/testsuite/native-tests:15579
/stack/native/branches/jbossws-native-3.4.0.SP1/modules/testsuite/native-tests:13928,13933,13936,13946
/stack/native/trunk/modules/testsuite/native-tests:12502,13992,14013,14157,14160,14181,14183,14842
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2013-05-10 20:25:52 UTC (rev 17546)
@@ -33,7 +33,6 @@
import junit.framework.Test;
import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -50,10 +49,8 @@
private final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws1999";
- private static final String FAULT_CODE = "wsse:FailedAuthentication";
+ private static final String FAULT_CODE = "jboss-wsse:GenericError";
- private static final String FAULT_STRING = FailedAuthenticationException.faultString;
-
public static Test suite() throws Exception
{
return new JBossWSTestSetup(JBWS1999TestCase.class, "jaxws-jbws1999.war");
@@ -111,8 +108,6 @@
SOAPFault fault = sfe.getFault();
String faultCode = fault.getFaultCode();
assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault String", FAULT_STRING, faultString);
}
}
@@ -149,8 +144,6 @@
SOAPFault fault = sfe.getFault();
String faultCode = fault.getFaultCode();
assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault Message", FAULT_STRING, faultString);
}
}
@@ -173,8 +166,6 @@
SOAPFault fault = sfe.getFault();
String faultCode = fault.getFaultCode();
assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault Message", FAULT_STRING, faultString);
}
}
Modified: stack/native/tags/jbossws-native-3.1.2.SP15/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.2.SP15/pom.xml 2013-05-10 20:10:24 UTC (rev 17545)
+++ stack/native/tags/jbossws-native-3.1.2.SP15/pom.xml 2013-05-10 20:25:52 UTC (rev 17546)
@@ -74,7 +74,7 @@
<woodstox.version>3.2.9</woodstox.version>
<wsdl4j.version>1.6.2</wsdl4j.version>
<xmlsec.version>1.5.1</xmlsec.version>
- <xalan.version>2.7.1-patch-05</xalan.version>
+ <xalan.version>2.7.1-patch-04</xalan.version>
<xerces.version>2.9.1</xerces.version>
</properties>
11 years, 4 months
JBossWS SVN: r17545 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-05-10 16:10:24 -0400 (Fri, 10 May 2013)
New Revision: 17545
Added:
stack/native/branches/jbossws-native-3.1.2.SP15_JBPAPP-10740/
Log:
[JBPAPP-10740] Creating one off branch
11 years, 4 months
JBossWS SVN: r17544 - in thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-05-10 14:34:51 -0400 (Fri, 10 May 2013)
New Revision: 17544
Modified:
thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/Messages.properties
thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
Log:
Changes for BZ 961561 to allow mutiple subcodes in a SOAP 1.2 fault
Modified: thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java 2013-05-10 00:25:30 UTC (rev 17543)
+++ thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java 2013-05-10 18:34:51 UTC (rev 17544)
@@ -19,7 +19,9 @@
package org.apache.cxf.binding.soap;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -46,7 +48,7 @@
* FaultHandler) be mapped to "Sender" instead.
*/
- private QName subCode;
+ private List<QName> subCodes;
private String role;
private String node;
private Map<String, String> namespaces = new HashMap<String, String>();
@@ -81,9 +83,13 @@
return getFaultCodeString(prefix, defaultPrefix, getFaultCode());
}
- public String getSubCodeString(String prefix, String defaultPrefix) {
+ public String getSubCodeString(String prefix, String defaultPrefix, QName subCode) {
return getFaultCodeString(prefix, defaultPrefix, subCode);
}
+
+ public String getSubCodeString(String prefix, String defaultPrefix) {
+ return getFaultCodeString(prefix, defaultPrefix, subCodes.get(0));
+ }
private String getFaultCodeString(String prefix, String defaultPrefix, QName fCode) {
String codePrefix = null;
@@ -135,18 +141,34 @@
* @return The SubCode element as detailed by the SOAP 1.2 spec.
*/
public QName getSubCode() {
- return subCode;
+ if (subCodes != null && subCodes.size() > 0) {
+ return subCodes.get(0);
+ } else {
+ return null;
+ }
}
/**
- * Sets the SubCode for the Fault Code.
+ * Sets the set of sub codes to the one passed in
*
* @param subCode The SubCode element as detailed by the SOAP 1.2 spec.
*/
public void setSubCode(QName subCode) {
- this.subCode = subCode;
+ this.subCodes = new ArrayList<QName>();
+ subCodes.add(subCode);
}
+ public void addSubCode(QName subCode) {
+ if (subCodes == null) {
+ subCodes = new ArrayList<QName>();
+ }
+ subCodes.add(subCode);
+ }
+
+ public List<QName> getSubCodes() {
+ return subCodes;
+ }
+
public Map<String, String> getNamespaces() {
return namespaces;
}
Modified: thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java 2013-05-10 00:25:30 UTC (rev 17543)
+++ thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java 2013-05-10 18:34:51 UTC (rev 17544)
@@ -19,15 +19,18 @@
package org.apache.cxf.binding.soap.interceptor;
+import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamWriter;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.apache.cxf.binding.soap.Soap11;
import org.apache.cxf.binding.soap.SoapFault;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor.Soap11FaultOutInterceptorInternal;
@@ -46,7 +49,7 @@
public void handleMessage(SoapMessage message) throws Fault {
Fault f = (Fault) message.getContent(Exception.class);
message.put(org.apache.cxf.message.Message.RESPONSE_CODE, f.getStatusCode());
- if (message.getVersion().getVersion() == 1.1) {
+ if (message.getVersion() == Soap11.getInstance()) {
message.getInterceptorChain().add(Soap11FaultOutInterceptorInternal.INSTANCE);
} else {
message.getInterceptorChain().add(Soap12FaultOutInterceptorInternal.INSTANCE);
@@ -91,14 +94,9 @@
defaultPrefix));
writer.writeEndElement();
- if (fault.getSubCode() != null) {
- writer.writeStartElement(defaultPrefix, "Subcode", ns);
- writer.writeStartElement(defaultPrefix, "Value", ns);
- writer.writeCharacters(fault.getSubCodeString(getFaultCodePrefix(writer,
- fault.getSubCode()),
- defaultPrefix));
- writer.writeEndElement();
- writer.writeEndElement();
+ if (fault.getSubCodes() != null) {
+ Iterator<QName> subCodes = fault.getSubCodes().iterator();
+ writeSubCodes(writer, fault, subCodes, ns, defaultPrefix);
}
writer.writeEndElement();
@@ -143,6 +141,22 @@
}
}
+ private void writeSubCodes(XMLStreamWriter writer, SoapFault fault,
+ Iterator<QName> subCodes, String ns, String defaultPrefix) throws Exception {
+ QName subCode = subCodes.next();
+ writer.writeStartElement(defaultPrefix, "Subcode", ns);
+ writer.writeStartElement(defaultPrefix, "Value", ns);
+ writer.writeCharacters(fault.getSubCodeString(getFaultCodePrefix(writer,
+ fault.getSubCode()),
+ defaultPrefix,
+ subCode));
+ writer.writeEndElement();
+ if (subCodes.hasNext()) {
+ writeSubCodes(writer, fault, subCodes, ns, defaultPrefix);
+ }
+ writer.writeEndElement();
+ }
+
private String getLangCode() {
String code = LOG.getResourceBundle().getLocale().getLanguage();
if (StringUtils.isEmpty(code)) {
Modified: thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/Messages.properties
===================================================================
--- thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/Messages.properties 2013-05-10 00:25:30 UTC (rev 17543)
+++ thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/Messages.properties 2013-05-10 18:34:51 UTC (rev 17544)
@@ -26,5 +26,6 @@
ATTACHMENT_NOT_SUPPORTED = Attachments of type {0} are not supported.
DISPATCH_OBJECT_NOT_SUPPORTED_SOAPBINDING = {0} is not valid in {1} mode with SOAP/HTTP binding.
DISPATCH_OBJECT_NOT_SUPPORTED_XMLBINDING = {0} is not valid in {1} mode with XML/HTTP binding.
+EXCEPTION_WHILE_ADDING_SUBCODES = There was a problem when adding subcodes.
EXCEPTION_WHILE_WRITING_FAULT = Exception occurred while writing fault.
-CANNOT_SET_HOLDER_OBJECTS = The message content list of the in message and out message are same, CXF can't set the holder object into the message content list of the out message.
\ No newline at end of file
+CANNOT_SET_HOLDER_OBJECTS = The message content list of the in message and out message are same, CXF can't set the holder object into the message content list of the out message.
Modified: thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java 2013-05-10 00:25:30 UTC (rev 17543)
+++ thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java 2013-05-10 18:34:51 UTC (rev 17544)
@@ -21,6 +21,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Iterator;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -28,7 +29,9 @@
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.ws.WebFault;
+import javax.xml.ws.soap.SOAPFaultException;
+import org.apache.cxf.binding.soap.SoapFault;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.common.logging.LogUtils;
@@ -83,6 +86,23 @@
return;
}
+ try {
+ if (f.getCause().getClass().equals(SOAPFaultException.class)) {
+ SOAPFaultException sfe = (SOAPFaultException) (f.getCause());
+ if (f.getClass().equals(SoapFault.class)) {
+ SoapFault sf = (SoapFault) f;
+ Iterator iterator = sfe.getFault().getFaultSubcodes();
+ while (iterator.hasNext()) {
+ sf.addSubCode((QName) iterator.next());
+ }
+ }
+ message.setContent(Exception.class, f);
+ }
+ } catch (Exception e) {
+ LOG.log(Level.WARNING, "EXCEPTION_WHILE_ADDING_SUBCODES");
+ LOG.log(Level.FINE, "EXCEPTION_WHILE_ADDING_SUBCODES", e);
+ }
+
Throwable cause = f.getCause();
WebFault fault = null;
if (cause != null) {
11 years, 4 months
JBossWS SVN: r17543 - thirdparty/cxf/branches.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-05-09 20:25:30 -0400 (Thu, 09 May 2013)
New Revision: 17543
Added:
thirdparty/cxf/branches/cxf-2.4.9.jbossorg-1_BZ961561/
Log:
Creating one off branch for bz 961561
11 years, 4 months
JBossWS SVN: r17542 - shared-testsuite/trunk/testsuite/src/test/ant-import.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-05-09 03:32:24 -0400 (Thu, 09 May 2013)
New Revision: 17542
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml
Log:
Fixing binary distro to use new WildFly jar names
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml 2013-05-09 07:15:51 UTC (rev 17541)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml 2013-05-09 07:32:24 UTC (rev 17542)
@@ -513,19 +513,19 @@
<include name="jboss-logging-*.jar"/>
</fileset>
<fileset dir="${jboss.home}/modules/system/layers/base/org/jboss/as/controller/main/">
- <include name="jboss-as-controller-*.jar"/>
+ <include name="wildfly-controller-*.jar"/>
</fileset>
<fileset dir="${jboss.home}/modules/system/layers/base/org/jboss/as/controller-client/main/">
- <include name="jboss-as-controller-client-*.jar"/>
+ <include name="wildfly-controller-client-*.jar"/>
</fileset>
<fileset dir="${jboss.home}/modules/system/layers/base/org/jboss/as/security-util/main/">
- <include name="jboss-as-security-util-*.jar"/>
+ <include name="wildfly-security-util-*.jar"/>
</fileset>
<fileset dir="${jboss.home}/modules/system/layers/base/org/jboss/as/server/main/">
- <include name="jboss-as-server-*.jar"/>
+ <include name="wildfly-server-*.jar"/>
</fileset>
<fileset dir="${jboss.home}/modules/system/layers/base/org/jboss/as/protocol/main/">
- <include name="jboss-as-protocol-*.jar"/>
+ <include name="wildfly-protocol-*.jar"/>
</fileset>
<fileset dir="${jboss.home}/modules/system/layers/base/org/jboss/dmr/main/">
<include name="jboss-dmr-*.jar"/>
11 years, 4 months
JBossWS SVN: r17541 - shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-05-09 03:15:51 -0400 (Thu, 09 May 2013)
New Revision: 17541
Modified:
shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/src/main/java/org/jboss/wsf/test/JBossWSTest.java
Log:
[BZ927884]:Add more timeout value for the thread join
Modified: shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2013-05-09 07:07:22 UTC (rev 17540)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2013-05-09 07:15:51 UTC (rev 17541)
@@ -178,9 +178,9 @@
try
{
inputJob.start();
- inputJob.join(5000);
+ inputJob.join(60000);
outputJob.start();
- outputJob.join(5000);
+ outputJob.join(60000);
int statusCode = p.waitFor();
String fallbackMessage = "Process did exit with status " + statusCode;
assertTrue(message != null ? message : fallbackMessage, statusCode == 0);
11 years, 4 months
JBossWS SVN: r17540 - shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-05-09 03:07:22 -0400 (Thu, 09 May 2013)
New Revision: 17540
Modified:
shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java
Log:
[BZ927558]:Workaround to fix the test failure only happens with IBM JDK6
Modified: shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java 2013-05-08 15:53:16 UTC (rev 17539)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.1.x/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java 2013-05-09 07:07:22 UTC (rev 17540)
@@ -72,6 +72,54 @@
return Service.create(wsdlURL, serviceName).getPort(SecureEndpoint.class);
}
+
+ public void testUnauthenticated() throws Exception
+ {
+ SecureEndpoint port1 = getAuthzPort();
+
+ try {
+ port1.echoForAll("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+
+ try {
+ port1.echo("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+
+ try {
+ port1.restrictedEcho("Hello");
+ fail("Authentication exception expected!");
+ } catch (Exception e) {
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+ }
+
+ public void testUnauthorized() throws Exception
+ {
+ SecureEndpoint port2 = getAuthzPort();
+ ((BindingProvider)port2).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
+ ((BindingProvider)port2).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
+ try {
+ port2.restrictedEcho("Hello");
+ fail("Authorization exception expected!");
+ } catch (Exception e) {
+ //expected EJB3 layer authorization exception
+ assertTrue("Exception message: " + e.getMessage(), e.getMessage().contains("not allowed"));
+ }
+ }
+
+
public void testAuthorizedAccess() throws Exception
{
SecureEndpoint port = getAuthzPort();
@@ -119,51 +167,4 @@
}
}
- public void testUnauthenticated() throws Exception
- {
- SecureEndpoint port = getAuthzPort();
-
- try {
- port.echoForAll("Hello");
- fail("Authentication exception expected!");
- } catch (Exception e) {
- //expected web layer exception
- assertTrue(e.getMessage().contains("Could not send Message"));
- assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
- }
-
- try {
- port.echo("Hello");
- fail("Authentication exception expected!");
- } catch (Exception e) {
- //expected web layer exception
- e.printStackTrace();
- assertTrue(e.getMessage().contains("Could not send Message"));
- assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
- }
-
- try {
- port.restrictedEcho("Hello");
- fail("Authentication exception expected!");
- } catch (Exception e) {
- //expected web layer exception
- assertTrue(e.getMessage().contains("Could not send Message"));
- assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
- }
- }
-
- public void testUnauthorized() throws Exception
- {
- SecureEndpoint port = getAuthzPort();
- ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
- ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
- try {
- port.restrictedEcho("Hello");
- fail("Authorization exception expected!");
- } catch (Exception e) {
- //expected EJB3 layer authorization exception
- assertTrue("Exception message: " + e.getMessage(), e.getMessage().contains("not allowed"));
- }
- }
-
}
11 years, 4 months
JBossWS SVN: r17539 - in stack/cxf/trunk/modules/testsuite/cxf-spring-tests: src/test/java/org/jboss/test/ws/jaxws/cxf and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-05-08 11:53:16 -0400 (Wed, 08 May 2013)
New Revision: 17539
Added:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorld.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorldImpl.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/WEB-INF/jboss-deployment-structure.xml
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml
Log:
[JBWS-3607] Adding testcase
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml 2013-05-08 15:51:40 UTC (rev 17538)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml 2013-05-08 15:53:16 UTC (rev 17539)
@@ -102,6 +102,27 @@
</manifest>
</war>
+ <!-- jaxws-cxf-in_container_client -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-in_container_client.war" needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorld*.class"/>
+ </classes>
+ </war>
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-in_container_client-client.war" needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorld.class"/>
+ <include name="org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.class"/>
+ <include name="org/jboss/wsf/test/TestServlet.class"/>
+ <include name="org/jboss/wsf/test/ClientHelper.class"/>
+ </classes>
+ <classes dir="${tests.output.dir}/test-resources/jaxws/cxf/in_container_client/">
+ <include name="cxf.xml"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/cxf/in_container_client/WEB-INF">
+ <include name="jboss-deployment-structure.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-cxf-mixtype-->
<war warfile="${tests.output.dir}/test-libs/jaxws-cxf-mixtype.war" webxml="${tests.output.dir}/test-resources/jaxws/cxf/mixtype/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorld.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorld.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorld.java 2013-05-08 15:53:16 UTC (rev 17539)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.in_container_client;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/in_container_client")
+public interface HelloWorld
+{
+ String echo(String input);
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorldImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorldImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/HelloWorldImpl.java 2013-05-08 15:53:16 UTC (rev 17539)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.in_container_client;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ serviceName = "HelloWorldService",
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.in_container_client.HelloWorld",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/in_container_client"
+)
+public class HelloWorldImpl implements HelloWorld
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java 2013-05-08 15:53:16 UTC (rev 17539)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.in_container_client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
+import org.jboss.wsf.test.ClientHelper;
+
+public class Helper implements ClientHelper
+{
+ private String targetEndpointURL;
+ private Logger log = Logger.getLogger(Helper.class);
+
+ public Helper()
+ {
+
+ }
+
+ public Helper(String endpointURL)
+ {
+ setTargetEndpoint(endpointURL);
+ }
+
+ public boolean test() throws Exception
+ {
+ BusFactory factory = BusFactory.newInstance();
+ if (!(factory instanceof JBossWSBusFactory)) { //check jbossws-cxf integration is on
+ log.error("Expected instance of " + JBossWSBusFactory.class + " but got: " + factory.getClass());
+ return false;
+ }
+ Bus bus = ((JBossWSBusFactory)factory).createBus("cxf.xml"); //force Spring bus construction
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ HelloWorld port = getPort();
+ return ("foo".equals(port.echo("foo")));
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+
+ }
+
+ private HelloWorld getPort() throws MalformedURLException
+ {
+ URL wsdlURL = new URL(targetEndpointURL + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/in_container_client", "HelloWorldService");
+ Service service = Service.create(wsdlURL, serviceName);
+ QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/in_container_client", "HelloWorldImplPort");
+ return (HelloWorld) service.getPort(portQName, HelloWorld.class);
+ }
+
+ @Override
+ public void setTargetEndpoint(String address)
+ {
+ this.targetEndpointURL = address;
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/ServletTestCase.java 2013-05-08 15:53:16 UTC (rev 17539)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.in_container_client;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * A testcase for verifying a cxf.xml Spring descriptor based Bus can
+ * successfully be created and used in a in-container client.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 08-May-2013
+ *
+ */
+public class ServletTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(ServletTestCase.class, "jaxws-cxf-in_container_client.war, jaxws-cxf-in_container_client-client.war");
+ }
+
+ public void test() throws Exception
+ {
+ assertEquals("1", runTestInContainer("test"));
+ }
+
+ private String runTestInContainer(String test) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost()
+ + ":8080/jaxws-cxf-in_container_client-client?path=/jaxws-cxf-in_container_client/HelloWorldService&method=" + test
+ + "&helper=" + Helper.class.getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/WEB-INF/jboss-deployment-structure.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/WEB-INF/jboss-deployment-structure.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/WEB-INF/jboss-deployment-structure.xml 2013-05-08 15:53:16 UTC (rev 17539)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
+ <deployment>
+ <dependencies>
+ <module name="org.jboss.ws.cxf.jbossws-cxf-client" services="import" />
+ <module name="org.apache.cxf.impl">
+ <imports>
+ <include path="META-INF"/>
+ <include path="META-INF/cxf"/>
+ </imports>
+ </module>
+ <module name="org.springframework.spring">
+ <imports>
+ <include path="META-INF"/>
+ </imports>
+ </module>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
\ No newline at end of file
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/in_container_client/cxf.xml 2013-05-08 15:53:16 UTC (rev 17539)
@@ -0,0 +1,10 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="cxf.default.workqueue" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
+ <property name="name" value="cxf.default.workqueue"/>
+ <property name="queueSize" value="10"/>
+ </bean>
+
+</beans>
\ No newline at end of file
11 years, 4 months
JBossWS SVN: r17538 - stack/cxf/trunk/modules/addons/transports/udp/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/udp.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-05-08 11:51:40 -0400 (Wed, 08 May 2013)
New Revision: 17538
Modified:
stack/cxf/trunk/modules/addons/transports/udp/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/udp/UDPTransportTest.java
Log:
[JBWS-3595] Improve testcase to avoid verifying broadcast when ipv6 only interfaces are available
Modified: stack/cxf/trunk/modules/addons/transports/udp/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/udp/UDPTransportTest.java
===================================================================
--- stack/cxf/trunk/modules/addons/transports/udp/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/udp/UDPTransportTest.java 2013-05-07 17:39:36 UTC (rev 17537)
+++ stack/cxf/trunk/modules/addons/transports/udp/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/udp/UDPTransportTest.java 2013-05-08 15:51:40 UTC (rev 17538)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.stack.cxf.addons.transports.udp;
+import java.net.InetAddress;
+import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
@@ -86,7 +88,7 @@
while (interfaces.hasMoreElements())
{
NetworkInterface networkInterface = interfaces.nextElement();
- if (!networkInterface.isUp() || networkInterface.isLoopback())
+ if (!networkInterface.isUp() || networkInterface.isLoopback() || !isBroadcastAddressAvailable(networkInterface))
{
continue;
}
@@ -95,7 +97,7 @@
if (count == 0)
{
//no non-loopbacks, cannot do broadcasts
- System.out.println("Skipping broadcast test");
+ System.out.println("Skipping broadcast test: no non-loopback IPv4 interface available");
return;
}
@@ -121,4 +123,14 @@
((java.io.Closeable) g).close();
}
+
+ private boolean isBroadcastAddressAvailable(NetworkInterface networkInterface) {
+ for (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses()) {
+ InetAddress broadcast = interfaceAddress.getBroadcast();
+ if (broadcast != null) {
+ return true;
+ }
+ }
+ return false;
+ }
}
11 years, 4 months
JBossWS SVN: r17537 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-05-07 13:39:36 -0400 (Tue, 07 May 2013)
New Revision: 17537
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
Log:
[JBWS-3596] Close client
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2013-05-07 17:27:56 UTC (rev 17536)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2013-05-07 17:39:36 UTC (rev 17537)
@@ -75,6 +75,7 @@
checkResolveMatches(rmts, "http://" + getServerHost() + ":8080/jaxws-samples-wsdd/WSDDService", typeName);
checkResolveMatches(rmts, "http://" + getServerHost() + ":8080/jaxws-samples-wsdd2/WSDDService", typeName);
checkResolveMatches(rmts, "http://" + getServerHost() + ":8080/jaxws-samples-wsdd2/AnotherWSDDService", typeName);
+ client.close();
} finally {
bus.shutdown(true);
}
@@ -107,6 +108,7 @@
String expected = address.contains("AnotherWSDDService") ? "Hi " : "Greetings ";
assertEquals(expected + "Alice" + i, port.greet("Alice" + i));
}
+ client.close();
} finally {
bus.shutdown(true);
}
11 years, 4 months