JBossWS SVN: r8235 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-09-25 21:14:04 -0400 (Thu, 25 Sep 2008)
New Revision: 8235
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
Log:
[JBWS-1188]-Relax requirement for wsu:id for UsernameToken
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2008-09-25 15:29:21 UTC (rev 8234)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/Timestamp.java 2008-09-26 01:14:04 UTC (rev 8235)
@@ -61,11 +61,9 @@
{
this.doc = element.getOwnerDocument();
String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- throw new WSSecurityException("Invalid message, Timestamp is missing an id");
+ if (id != null && id.length() > 0)
+ this.id = id;
- this.id = id;
-
Element child = Util.getFirstChildElement(element);
if (child == null || !Constants.WSU_NS.equals(child.getNamespaceURI()) || !"Created".equals(child.getLocalName()))
throw new WSSecurityException("Created child expected in Timestamp element");
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2008-09-25 15:29:21 UTC (rev 8234)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2008-09-26 01:14:04 UTC (rev 8235)
@@ -69,11 +69,9 @@
{
this.doc = element.getOwnerDocument();
String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- throw new WSSecurityException("Invalid message, UsernameToken is missing an id");
+ if (id != null && id.length() > 0)
+ setId(id);
- setId(id);
-
Element child = Util.getFirstChildElement(element);
if (child == null || ! Constants.WSSE_NS.equals(child.getNamespaceURI()) || ! "Username".equals(child.getLocalName()))
throw new WSSecurityException("Username child expected in UsernameToken element");
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2008-09-25 15:29:21 UTC (rev 8234)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/element/X509Token.java 2008-09-26 01:14:04 UTC (rev 8235)
@@ -50,11 +50,9 @@
super(element.getOwnerDocument());
String id = element.getAttributeNS(Constants.WSU_NS, Constants.ID);
- if (id == null || id.length() == 0)
- throw new WSSecurityException("Invalid message, BinarySecurityToken is missing an id");
+ if (id != null && id.length() > 0)
+ setId(id);
- setId(id);
-
if (! Constants.BASE64_ENCODING_TYPE.equals(element.getAttribute("EncodingType")))
throw new WSSecurityException("Invalid encoding type (only base64 is supported) for token:" + id);
15 years, 8 months
JBossWS SVN: r8234 - stack/native/trunk/modules/resources/src/main/resources/bin.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-25 11:29:21 -0400 (Thu, 25 Sep 2008)
New Revision: 8234
Modified:
stack/native/trunk/modules/resources/src/main/resources/bin/wsprovide.bat
Log:
[JBWS-2230] fix typo
Modified: stack/native/trunk/modules/resources/src/main/resources/bin/wsprovide.bat
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/bin/wsprovide.bat 2008-09-25 15:28:11 UTC (rev 8233)
+++ stack/native/trunk/modules/resources/src/main/resources/bin/wsprovide.bat 2008-09-25 15:29:21 UTC (rev 8234)
@@ -23,7 +23,7 @@
REM :endloop
set JAVA=%JAVA_HOME%\bin\java
-if "%JBOSS_HOME%" = "" set JBOSS_HOME=%DIRNAME%\..
+if "%JBOSS_HOME%" == "" set JBOSS_HOME=%DIRNAME%\..
rem Setup the java endorsed dirs
set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
15 years, 8 months
JBossWS SVN: r8233 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-25 11:28:11 -0400 (Thu, 25 Sep 2008)
New Revision: 8233
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java
Log:
[JBWS-2322] fix test case to be cross platform
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java 2008-09-25 15:23:24 UTC (rev 8232)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java 2008-09-25 15:28:11 UTC (rev 8233)
@@ -23,6 +23,7 @@
import java.io.*;
+import org.jboss.wsf.common.concurrent.CopyJob;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -39,6 +40,8 @@
public class ScriptTestCase extends JBossWSTest
{
private static final String FS = System.getProperty("file.separator"); // '/' on unix, '\' on windows
+ private static final String PS = System.getProperty("path.separator"); // ':' on unix, ';' on windows
+ private static final String EXT = ":".equals( PS ) ? ".sh" : ".bat";
private String WSDL_LOCATION = "jaxws" + FS + "smoke" + FS + "tools" + FS + "wsdl" + FS + "TestServiceCatalog.wsdl";
private String ENDPOINT_CLASS = "org.jboss.test.ws.jaxws.smoke.tools.CalculatorBean";
@@ -80,16 +83,11 @@
public void testWSConsumeFromCommandLine() throws Exception
{
- if (isWindowsOS())
- {
- fail("This test has not been verified on windows");
- }
-
// use absolute path for the output to be re-usable
String absWsdlLoc = getResourceFile(WSDL_LOCATION).getAbsolutePath();
String absOutput = new File(TEST_DIR, "wsconsume" + FS + "java").getAbsolutePath();
- String command = JBOSS_HOME + FS + "bin" + FS + "wsconsume.sh -v -k -o " + absOutput + " " + absWsdlLoc;
+ String command = JBOSS_HOME + FS + "bin" + FS + "wsconsume" + EXT + " -v -k -o " + absOutput + " " + absWsdlLoc;
Process p = executeCommand(command);
// check status code
@@ -102,14 +100,9 @@
public void testWSProvideFromCommandLine() throws Exception
{
- if (isWindowsOS())
- {
- fail("This test has not been verified on windows");
- }
-
String absOutput = new File(TEST_DIR, "wsprovide" + FS + "java").getAbsolutePath();
- String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide.sh -k -w -o " + absOutput + " --classpath " + CLASSES_DIR + " " + ENDPOINT_CLASS;
+ String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide" + EXT + " -k -w -o " + absOutput + " --classpath " + CLASSES_DIR + " " + ENDPOINT_CLASS;
Process p = executeCommand(command);
// check status code
@@ -131,11 +124,25 @@
private void assertStatusCode(Process p, String s) throws InterruptedException
{
+ CopyJob job = new CopyJob(p.getInputStream(), System.out);
+ new Thread( job ).start();
+ int status = -1;
+ try
+ {
+ status = p.waitFor();
+ }
+ finally
+ {
+ job.kill();
+ p.destroy();
+ }
+
// check status code
- int status = p.waitFor();
- dumpStream(p.getInputStream());
- dumpStream(p.getErrorStream());
-
+ if (status != 0)
+ {
+ System.out.println("Error stream");
+ dumpStream(p.getErrorStream());
+ }
assertTrue(s + " did exit with status " + status, status == 0);
}
15 years, 8 months
JBossWS SVN: r8232 - common/branches/dlofthouse/JBWS-2323/src/main/java/org/jboss/wsf/common.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-25 11:23:24 -0400 (Thu, 25 Sep 2008)
New Revision: 8232
Modified:
common/branches/dlofthouse/JBWS-2323/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
Added property 'org.jboss.ws.disable_deferred_node_expansion'
Modified: common/branches/dlofthouse/JBWS-2323/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/branches/dlofthouse/JBWS-2323/src/main/java/org/jboss/wsf/common/DOMUtils.java 2008-09-25 15:06:13 UTC (rev 8231)
+++ common/branches/dlofthouse/JBWS-2323/src/main/java/org/jboss/wsf/common/DOMUtils.java 2008-09-25 15:23:24 UTC (rev 8232)
@@ -67,10 +67,11 @@
{
private static Logger log = Logger.getLogger(DOMUtils.class);
+ private static final String DISABLE_DEFERRED_NODE_EXPANSION = "org.jboss.ws.disable_deferred_node_expansion";
+
// All elements created by the same thread are created by the same builder and belong to the same doc
private static ThreadLocal<Document> documentThreadLocal = new ThreadLocal<Document>();
- private static ThreadLocal<DocumentBuilder> builderThreadLocal = new ThreadLocal<DocumentBuilder>()
- {
+ private static ThreadLocal<DocumentBuilder> builderThreadLocal = new ThreadLocal<DocumentBuilder>() {
protected DocumentBuilder initialValue()
{
try
@@ -78,6 +79,13 @@
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
+
+ boolean disableDeferredNodeExpansion = Boolean.getBoolean(DISABLE_DEFERRED_NODE_EXPANSION);
+ if (disableDeferredNodeExpansion == true)
+ {
+ factory.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
+ }
+
DocumentBuilder builder = factory.newDocumentBuilder();
setEntityResolver(builder);
return builder;
@@ -297,7 +305,8 @@
String attr = null;
if ("".equals(attrName.getNamespaceURI()))
attr = el.getAttribute(attrName.getLocalPart());
- else attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart());
+ else
+ attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart());
if ("".equals(attr))
attr = null;
@@ -408,7 +417,7 @@
NodeList nodeList = node.getChildNodes();
if (nodeList.getLength() == 0)
return false;
-
+
for (int i = 0; i < nodeList.getLength(); i++)
{
Node acksToChildNode = nodeList.item(i);
@@ -512,17 +521,17 @@
{
return getChildElementsIntern(node, nodeName);
}
-
+
public static List<Element> getChildElementsAsList(Node node, String nodeName)
{
return getChildElementsAsListIntern(node, new QName(nodeName));
}
-
+
public static List<Element> getChildElementsAsList(Node node, QName nodeName)
{
return getChildElementsAsListIntern(node, nodeName);
}
-
+
private static List<Element> getChildElementsAsListIntern(Node node, QName nodeName)
{
List<Element> list = new LinkedList<Element>();
15 years, 8 months
JBossWS SVN: r8231 - common/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-25 11:06:13 -0400 (Thu, 25 Sep 2008)
New Revision: 8231
Added:
common/branches/dlofthouse/JBWS-2304/
Log:
Branch for POC.
Copied: common/branches/dlofthouse/JBWS-2304 (from rev 8230, common/trunk)
15 years, 8 months
JBossWS SVN: r8230 - common/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-25 11:05:16 -0400 (Thu, 25 Sep 2008)
New Revision: 8230
Added:
common/branches/dlofthouse/JBWS-2323/
Log:
Branch for POC.
Copied: common/branches/dlofthouse/JBWS-2323 (from rev 8229, common/trunk)
15 years, 8 months
JBossWS SVN: r8229 - common/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-25 11:04:24 -0400 (Thu, 25 Sep 2008)
New Revision: 8229
Added:
common/branches/dlofthouse/
Log:
Working area
15 years, 8 months
JBossWS SVN: r8228 - common/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-25 11:01:51 -0400 (Thu, 25 Sep 2008)
New Revision: 8228
Added:
common/branches/jbossws-common-1.0.2.GA_CP/
Removed:
common/branches/jbossws-common-1.0.2.GA.CP/
Log:
Correct the name of the branch.
Copied: common/branches/jbossws-common-1.0.2.GA_CP (from rev 8227, common/branches/jbossws-common-1.0.2.GA.CP)
15 years, 8 months
JBossWS SVN: r8227 - common/trunk/src/main/java/org/jboss/wsf/common/concurrent.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-25 10:35:09 -0400 (Thu, 25 Sep 2008)
New Revision: 8227
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java
Log:
[JBWS-2320] fix IOException
Modified: common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java 2008-09-25 13:42:13 UTC (rev 8226)
+++ common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java 2008-09-25 14:35:09 UTC (rev 8227)
@@ -116,8 +116,8 @@
{
try
{
+ this.wait( 50 ); // guard
if ( this.terminated ) return;
- this.wait( 10 ); // guard
}
catch ( InterruptedException ie )
{
15 years, 8 months
JBossWS SVN: r8226 - in stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws: tools/scripts and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-25 09:42:13 -0400 (Thu, 25 Sep 2008)
New Revision: 8226
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
Log:
[JBWS-2322] fixing tests
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-09-25 13:30:51 UTC (rev 8225)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-09-25 13:42:13 UTC (rev 8226)
@@ -43,6 +43,7 @@
import junit.framework.Test;
+import org.jboss.wsf.common.concurrent.CopyJob;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -57,6 +58,7 @@
private static final String FS = System.getProperty("file.separator"); // '/' on unix, '\' on windows
private static final String PS = System.getProperty("path.separator"); // ':' on unix, ';' on windows
private static final String LS = System.getProperty("line.separator"); // '\n' on unix, '\r\n' on windows
+ private static final String EXT = ":".equals( PS ) ? ".sh" : ".bat";
private static final String TARGET_NAMESPACE = "http://jbws771.jaxws.ws.test.jboss.org/";
private static URL wsdlURL;
@@ -156,7 +158,7 @@
{
// use absolute path for the output to be re-usable
String absOutput = createResourceFile("wsconsume" + FS + "java").getAbsolutePath();
- String command = JBOSS_HOME + FS + "bin" + FS + "wsconsume.sh -k -o " + absOutput + " --extension --binding=" + RESOURCES_DIR + FS + "jaxws" + FS + "jbws771" + FS + "binding.xml " + wsdlURL.toExternalForm();
+ String command = JBOSS_HOME + FS + "bin" + FS + "wsconsume" + EXT + " -k -o " + absOutput + " --extension --binding=" + RESOURCES_DIR + FS + "jaxws" + FS + "jbws771" + FS + "binding.xml " + wsdlURL.toExternalForm();
Process p = executeCommand(command);
// check status code
@@ -187,12 +189,22 @@
private void checkStatusCode(Process p, String s) throws InterruptedException, IOException
{
+ CopyJob job = new CopyJob(p.getInputStream(), System.out);
+ new Thread( job ).start();
+ int status = -1;
+ try
+ {
+ status = p.waitFor();
+ }
+ finally
+ {
+ job.kill();
+ p.destroy();
+ }
+
// check status code
- int status = p.waitFor();
if (status != 0)
{
- System.out.println("Input stream");
- printStream(p.getInputStream());
System.out.println("Error stream");
printStream(p.getErrorStream());
}
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java 2008-09-25 13:30:51 UTC (rev 8225)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java 2008-09-25 13:42:13 UTC (rev 8226)
@@ -21,10 +21,14 @@
*/
package org.jboss.test.ws.tools.scripts;
+import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.common.concurrent.CopyJob;
/**
* JBWS-1793: Provide a test case for the tools scripts that reside under JBOSS_HOME/bin
@@ -37,6 +41,7 @@
private static final String PS = System.getProperty("path.separator"); // ':' on unix, ';' on windows
private static final String LS = System.getProperty("line.separator"); // '\n' on unix, '\r\n' on windows
private String TOOLS_CONFIG = getResourceFile("tools" + FS + "scripts" + FS + "wstools-config.xml").getAbsolutePath();
+ private static final String EXT = ":".equals( PS ) ? ".sh" : ".bat";
private String JBOSS_HOME;
private String JDK_HOME;
@@ -59,7 +64,7 @@
File dest = createResourceFile("wstools" + FS + "java");
dest.mkdirs();
- String command = JBOSS_HOME + FS + "bin" + FS + "wstools.sh -config " + TOOLS_CONFIG + " -dest "+ dest.getAbsolutePath();
+ String command = JBOSS_HOME + FS + "bin" + FS + "wstools" + EXT + " -config " + TOOLS_CONFIG + " -dest "+ dest.getAbsolutePath();
Process p = executeCommand(command);
// check status code
@@ -80,10 +85,42 @@
return p;
}
- private void assertStatusCode(Process p, String s) throws InterruptedException
+ private void assertStatusCode(Process p, String s) throws InterruptedException, IOException
{
+ CopyJob job = new CopyJob(p.getInputStream(), System.out);
+ new Thread( job ).start();
+ int status = -1;
+ try
+ {
+ status = p.waitFor();
+ }
+ finally
+ {
+ job.kill();
+ p.destroy();
+ }
+
// check status code
- int status = p.waitFor();
+ if (status != 0)
+ {
+ System.out.println("Error stream");
+ printStream(p.getErrorStream());
+ }
assertTrue(s + " did exit with status " + status, status == 0);
}
+
+ private void printStream(InputStream is) throws IOException
+ {
+ System.out.println();
+ BufferedReader in = new BufferedReader(new InputStreamReader(is));
+ StringBuffer buffer = new StringBuffer();
+ String line;
+ while ((line = in.readLine()) != null) {
+ buffer.append(line + LS);
+ }
+ System.out.println(buffer.toString());
+ System.out.println();
+ System.out.println();
+ }
+
}
15 years, 8 months