Author: rfeng
Date: Fri Dec 1 10:22:03 2006
New Revision: 481331
URL: http://svn.apache.org/viewvc?view=rev&rev=481331
Log:
Move to castor 1.0.5
Modified:
incubator/tuscany/java/sca/services/databinding/databinding-castor/pom.xml
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/java/org/apache/tuscany/databinding/castor/Castor2NodeTestCase.java
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/resources/org/exolab/castor/builder/castorbuilder.properties
Modified:
incubator/tuscany/java/sca/services/databinding/databinding-castor/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-castor/pom.xml?view=diff&rev=481331&r1=481330&r2=481331
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-castor/pom.xml
(original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-castor/pom.xml
Fri Dec 1 10:22:03 2006
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
-->
<project>
<parent>
@@ -37,27 +37,38 @@
</dependency>
<dependency>
- <groupId>castor</groupId>
+ <groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
- <version>1.0</version>
+ <version>1.0.5</version>
<scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>adaptx</groupId>
+ <artifactId>adaptx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- <scope>runtime</scope>
+ <groupId>org.codehaus.castor</groupId>
+ <artifactId>adaptx</artifactId>
+ <version>0.9.14</version>
+ <scope>compile</scope>
</dependency>
<!-- Adding Apache xerces to workaround the castor references for SAX
parser -->
- <dependency>
+ <!--
+ <dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.0</version>
<scope>runtime</scope>
- </dependency>
-
+ </dependency>
+ -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -99,9 +110,10 @@
<mkdir
dir="${project.build.directory}/castor-source"></mkdir>
<castor-srcgen
file="${basedir}/src/test/resources/ipo.xsd"
todir="${project.build.directory}/castor-source"
package="com.example.ipo.castor" types="j2"
- warnings="false"
bindingfile="${basedir}/src/test/resources/binding.xml" />
+ warnings="false"
+
properties="${basedir}/src/test/resources/org/exolab/castor/builder/castorbuilder.properties"
+
bindingfile="${basedir}/src/test/resources/binding.xml" />
</tasks>
-
<testSourceRoot>${project.build.directory}/castor-source</testSourceRoot>
</configuration>
<goals>
<goal>run</goal>
Modified:
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/java/org/apache/tuscany/databinding/castor/Castor2NodeTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/java/org/apache/tuscany/databinding/castor/Castor2NodeTestCase.java?view=diff&rev=481331&r1=481330&r2=481331
==============================================================================
---
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/java/org/apache/tuscany/databinding/castor/Castor2NodeTestCase.java
(original)
+++
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/java/org/apache/tuscany/databinding/castor/Castor2NodeTestCase.java
Fri Dec 1 10:22:03 2006
@@ -18,29 +18,52 @@
*/
package org.apache.tuscany.databinding.castor;
+import java.io.StringReader;
+
+import junit.framework.Assert;
import junit.framework.TestCase;
+import org.w3c.dom.Node;
+
+import com.example.ipo.castor.PurchaseOrderType;
+
public class Castor2NodeTestCase extends TestCase {
- private static final String IPO_XML = "<?xml version=\"1.0\"?>" +
"<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + "
xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\"" +
" orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">" + "
<name>Helen Zoe</name>" + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>" + " <postcode>CB1
1JR</postcode>" + " </shipTo>" + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>" + " <street>8 Oak
Avenue</street>" + " <city>Old Town</city>" + " <state>PA</state>"
- + " <zip>95819</zip>" + " </billTo>" + " <items>" + "
<item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>" + "
<quantity>1</quantity>" + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>" +
" <shipDate>1999-12-05</shipDate>" + " </item>" + " </items>"
+ private static final String IPO_XML =
+ "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
+ + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+ + " xmlns:ipo=\"http://www.example.com/IPO\""
+ + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
+ + " orderDate=\"1999-12-01\">"
+ + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
+ + " <name>Helen Zoe</name>"
+ + " <street>47 Eden Street</street>"
+ + " <city>Cambridge</city>"
+ + " <postcode>CB1 1JR</postcode>"
+ + " </shipTo>"
+ + " <billTo xsi:type=\"ipo:USAddress\">"
+ + " <name>Robert Smith</name>"
+ + " <street>8 Oak Avenue</street>"
+ + " <city>Old Town</city>"
+ + " <state>PA</state>"
+ + " <zip>95819</zip>"
+ + " </billTo>"
+ + " <items>"
+ + " <item partNum=\"833-AA\">"
+ + " <productName>Lapis necklace</productName>"
+ + " <quantity>1</quantity>"
+ + " <USPrice>99.95</USPrice>"
+ + " <ipo:comment>Want this for the holidays</ipo:comment>"
+ + " <shipDate>1999-12-05</shipDate>"
+ + " </item>"
+ + " </items>"
+ "</ipo:purchaseOrder>";
public void testTransform() throws Exception {
- // FIXME: There's a bug in the castor-generated code which cannot
handle subutype correctly
- // http://jira.codehaus.org/browse/CASTOR-1475
- // shipTo should be able to accept UKAddress
-// Reader2Castor<PurchaseOrder> t1 = new
Reader2Castor<PurchaseOrder>(PurchaseOrder.class);
-// PurchaseOrder po = t1.transform(new StringReader(IPO_XML), null);
- /*
- * Castor2Node t2 = new Castor2Node(); Node node = t2.transform(po,
null); Assert.assertNotNull(node);
- */
+ Reader2Castor<PurchaseOrderType> t1 = new
Reader2Castor<PurchaseOrderType>(PurchaseOrderType.class);
+ PurchaseOrderType po = t1.transform(new StringReader(IPO_XML), null);
+ Castor2Node t2 = new Castor2Node(PurchaseOrderType.class);
+ Node node = t2.transform(po, null);
+ Assert.assertNotNull(node);
}
}
Modified:
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/resources/org/exolab/castor/builder/castorbuilder.properties
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/resources/org/exolab/castor/builder/castorbuilder.properties?view=diff&rev=481331&r1=481330&r2=481331
==============================================================================
---
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/resources/org/exolab/castor/builder/castorbuilder.properties
(original)
+++
incubator/tuscany/java/sca/services/databinding/databinding-castor/src/test/resources/org/exolab/castor/builder/castorbuilder.properties
Fri Dec 1 10:22:03 2006
@@ -12,7 +12,11 @@
# Java class mapping of <xsd:element>'s and <xsd:complexType>'s
#
+# FIXME: There's a bug in the castor-generated code which cannot handle
subutype correctly
+# http://jira.codehaus.org/browse/CASTOR-1475
org.exolab.castor.builder.javaclassmapping=type
+org.exolab.castor.builder.javaVersion=5.0
+
# This property allows one to specify the super class of *all*
# generated classes
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]