You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by pe...@apache.org on 2007/04/24 23:54:08 UTC
svn commit: r532102 - in /incubator/cxf/trunk:
api/src/main/java/org/apache/cxf/ distribution/src/main/release/samples/
rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/
tools/common/src/main/java/org/apache/cxf/tools/common/
Author: peterjones
Date: Tue Apr 24 14:54:07 2007
New Revision: 532102
URL: http://svn.apache.org/viewvc?view=rev&rev=532102
Log:
Couple of ibm jdk fixes.
Some tools tests rely on order of namespace declarations/wsdl message parts
remaining constant, however they can end up ordered differently using the
ibm jdk rather than the sun jdk. Also, a work around for the schema
element's xmlns declaration being incorrectly set to the same value as the
targetNamespace attribute in some cases (needs some further investigation).
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java?view=diff&rev=532102&r1=532101&r2=532102
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java Tue Apr 24 14:54:07 2007
@@ -89,7 +89,7 @@
/**
* Gets the default bus for the thread.
- * @retur the default bus.
+ * @return the default bus.
*/
public static synchronized Bus getThreadDefaultBus() {
if (localBus.get() == null) {
Modified: incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml?view=diff&rev=532102&r1=532101&r2=532102
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/common_build.xml Tue Apr 24 14:54:07 2007
@@ -147,11 +147,11 @@
<attribute name="param3" default=""/>
<attribute name="param4" default=""/>
<attribute name="param5" default=""/>
- <attribute name="jvmarg1" default="-D"/>
- <attribute name="jvmarg2" default="-D"/>
- <attribute name="jvmarg3" default="-D"/>
- <attribute name="jvmarg4" default="-D"/>
- <attribute name="jvmarg5" default="-D"/>
+ <attribute name="jvmarg1" default="-D' '"/>
+ <attribute name="jvmarg2" default="-D' '"/>
+ <attribute name="jvmarg3" default="-D' '"/>
+ <attribute name="jvmarg4" default="-D' '"/>
+ <attribute name="jvmarg5" default="-D' '"/>
<sequential>
<java classname="@{classname}" fork="yes">
<classpath>
Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=532102&r1=532101&r2=532102
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Tue Apr 24 14:54:07 2007
@@ -493,6 +493,15 @@
throw new ServiceConstructionException(e1);
}
Element e = docs[0].getDocumentElement();
+ // XXX A problem can occur with the ibm jdk when the XmlSchema
+ // object is serialized. The xmlns declaration gets incorrectly
+ // set to the same value as the targetNamespace attribute.
+ // The aegis databinding tests demonstrate this particularly.
+ if (e.getPrefix() == null && !WSDLConstants.NU_SCHEMA_XSD.equals(
+ e.getAttributeNS(WSDLConstants.NU_XMLNS, WSDLConstants.NP_XMLNS))) {
+ e.setAttributeNS(WSDLConstants.NU_XMLNS,
+ WSDLConstants.NP_XMLNS, WSDLConstants.NU_SCHEMA_XSD);
+ }
schemaInfo.setElement(e);
}
}
Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java?view=diff&rev=532102&r1=532101&r2=532102
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java Tue Apr 24 14:54:07 2007
@@ -27,6 +27,8 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
import java.util.StringTokenizer;
import org.apache.cxf.helpers.FileUtils;
@@ -88,14 +90,34 @@
StringTokenizer st1 = new StringTokenizer(str1);
StringTokenizer st2 = new StringTokenizer(str2);
- while (st1.hasMoreTokens() && st2.hasMoreTokens()) {
+ // namespace declarations and wsdl message parts can be ordered
+ // differently in the generated wsdl between the ibm and sun jdks.
+ // So, when we encounter a mismatch, put the unmatched token in a
+ // list and check this list when matching subsequent tokens.
+ // It would be much better to do a proper xml comparison.
+ List<String> unmatched = new ArrayList<String>();
+ while (st1.hasMoreTokens()) {
String tok1 = st1.nextToken();
- String tok2 = st2.nextToken();
+ String tok2 = null;
+ if (unmatched.contains(tok1)) {
+ unmatched.remove(tok1);
+ continue;
+ }
+ while (st2.hasMoreTokens()) {
+ tok2 = st2.nextToken();
+ if (tok1.equals(tok2)) {
+ break;
+ } else {
+ unmatched.add(tok2);
+ }
+ }
assertEquals("Compare failed", tok1, tok2);
}
assertTrue(!st1.hasMoreTokens());
+ assertTrue(!st2.hasMoreTokens());
+ assertTrue("Files did not match", unmatched.isEmpty());
}
public String getStringFromFile(File location) {