OPEN - issue BATCH-113: Mouldy xml class names still in infrastructure
http://opensource.atlassian.com/projects/spring/browse/BATCH-113
This commit is contained in:
@@ -1,88 +0,0 @@
|
||||
<purchase-orders xmlns="http://adsj.accenture.com/purchaseorders"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://adsj.accenture.com/purchaseorders purchaseorders.xsd">
|
||||
<order>
|
||||
<customer>
|
||||
<name>Gladys Kravitz</name>
|
||||
<address>Anytown, PA</address>
|
||||
<age>34</age>
|
||||
<moo>0</moo>
|
||||
<poo>0</poo>
|
||||
</customer>
|
||||
<date>2003-01-07 14:16:00 GMT</date>
|
||||
<lineItems>
|
||||
<lineItem>
|
||||
<description>Burnham's Celestial Handbook, Vol 1</description>
|
||||
<perUnitOunces>5</perUnitOunces>
|
||||
<price>21.79</price>
|
||||
<quantity>2</quantity>
|
||||
</lineItem>
|
||||
<lineItem>
|
||||
<description>Burnham's Celestial Handbook, Vol 2</description>
|
||||
<perUnitOunces>5</perUnitOunces>
|
||||
<price>19.89</price>
|
||||
<quantity>2</quantity>
|
||||
</lineItem>
|
||||
</lineItems>
|
||||
<shipper>
|
||||
<name>ZipShip</name>
|
||||
<perOunceRate>0.74</perOunceRate>
|
||||
</shipper>
|
||||
</order>
|
||||
<order>
|
||||
<customer>
|
||||
<name>John Smith</name>
|
||||
<address>Chicago, IL</address>
|
||||
<age>46</age>
|
||||
<moo>0</moo>
|
||||
<poo>0</poo>
|
||||
</customer>
|
||||
<date>2003-01-07 14:16:02 GMT</date>
|
||||
<lineItems>
|
||||
<lineItem>
|
||||
<description>XmlBeans in Action</description>
|
||||
<perUnitOunces>3</perUnitOunces>
|
||||
<price>41.29</price>
|
||||
<quantity>1</quantity>
|
||||
</lineItem>
|
||||
<lineItem>
|
||||
<description>JSR-173</description>
|
||||
<perUnitOunces>1</perUnitOunces>
|
||||
<price>11.99</price>
|
||||
<quantity>5</quantity>
|
||||
</lineItem>
|
||||
<lineItem>
|
||||
<description>Teach Yourself XML in 21 days</description>
|
||||
<perUnitOunces>1</perUnitOunces>
|
||||
<price>35.49</price>
|
||||
<quantity>1</quantity>
|
||||
</lineItem>
|
||||
</lineItems>
|
||||
<shipper>
|
||||
<name>ZipShip</name>
|
||||
<perOunceRate>0.74</perOunceRate>
|
||||
</shipper>
|
||||
</order>
|
||||
<order>
|
||||
<customer>
|
||||
<name>Peter Newman</name>
|
||||
<address>Cleveland, OH</address>
|
||||
<age>23</age>
|
||||
<moo>0</moo>
|
||||
<poo>0</poo>
|
||||
</customer>
|
||||
<date>2003-01-07 14:16:35 GMT</date>
|
||||
<lineItems>
|
||||
<lineItem>
|
||||
<description>Java 6</description>
|
||||
<perUnitOunces>2</perUnitOunces>
|
||||
<price>12.79</price>
|
||||
<quantity>3</quantity>
|
||||
</lineItem>
|
||||
</lineItems>
|
||||
<shipper>
|
||||
<name>UPS</name>
|
||||
<perOunceRate>0.69</perOunceRate>
|
||||
</shipper>
|
||||
</order>
|
||||
</purchase-orders>
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<xs:schema
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:po="http://adsj.accenture.com/purchaseorders"
|
||||
targetNamespace="http://adsj.accenture.com/purchaseorders"
|
||||
elementFormDefault="qualified">
|
||||
<xs:element name="purchase-orders">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="order" type="po:order" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:complexType name="order">
|
||||
<xs:sequence>
|
||||
<xs:element name="customer" type="po:customer"/>
|
||||
<xs:element name="date" type="xs:string"/>
|
||||
<xs:element name="lineItems" type="po:lineItems"/>
|
||||
<xs:element name="shipper" type="po:shipper" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="customer">
|
||||
<xs:sequence>
|
||||
<xs:element name="name" type="xs:string"/>
|
||||
<xs:element name="address" type="xs:string"/>
|
||||
<xs:element name="age" type="xs:int"/>
|
||||
<xs:element name="moo" type="xs:int" default="100"/>
|
||||
<xs:element name="poo" type="xs:int" default="200"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="lineItems">
|
||||
<xs:sequence>
|
||||
<xs:element name="lineItem" type="po:lineItem" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="lineItem">
|
||||
<xs:sequence>
|
||||
<xs:element name="description" type="xs:string"/>
|
||||
<xs:element name="perUnitOunces" type="xs:decimal"/>
|
||||
<xs:element name="price" type="xs:decimal"/>
|
||||
<xs:element name="quantity" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="shipper">
|
||||
<xs:sequence>
|
||||
<xs:element name="name" type="xs:string"/>
|
||||
<xs:element name="perOunceRate" type="xs:decimal"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
@@ -1 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?><purchaseOrders xsi:schemaLocation="http://adsj.accenture.com/purchaseorders purchaseorders.xsd" xmlns="http://adsj.accenture.com/purchaseorders" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><order><customer><name>Gladys Kravitz</name><address>Anytown, PA</address><age>34</age><moo>0</moo><poo>0</poo></customer><date>2003-01-07 14:16:00.0 GMT</date><lineItems><lineItem><description>Burnham's Celestial Handbook, Vol 1</description><perUnitOunces>5.0</perUnitOunces><price>21.79</price><quantity>2</quantity></lineItem><lineItem><description>Burnham's Celestial Handbook, Vol 2</description><perUnitOunces>5.0</perUnitOunces><price>19.89</price><quantity>2</quantity></lineItem></lineItems></order><order><customer><name>John Smith</name><address>Chicago, IL</address><age>46</age><moo>0</moo><poo>0</poo></customer><date>2003-01-07 14:16:02.0 GMT</date><lineItems><lineItem><description>XmlBeans in Action</description><perUnitOunces>3.0</perUnitOunces><price>41.29</price><quantity>1</quantity></lineItem><lineItem><description>JSR-173</description><perUnitOunces>1.0</perUnitOunces><price>11.99</price><quantity>5</quantity></lineItem><lineItem><description>Teach Yourself XML in 21 days</description><perUnitOunces>1.0</perUnitOunces><price>35.49</price><quantity>1</quantity></lineItem></lineItems></order><order><customer><name>Peter Newman</name><address>Cleveland, OH</address><age>23</age><moo>0</moo><poo>0</poo></customer><date>2003-01-07 14:16:35.0 GMT</date><lineItems><lineItem><description>Java 6</description><perUnitOunces>2.0</perUnitOunces><price>12.79</price><quantity>3</quantity></lineItem></lineItems></order></purchaseOrders>
|
||||
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
|
||||
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-2.0.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
|
||||
|
||||
<bean class="org.springframework.batch.execution.configuration.JobConfigurationRegistryBeanPostProcessor">
|
||||
<property name="jobConfigurationRegistry" ref="jobConfigurationRegistry"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jobConfiguration" parent="simpleJob">
|
||||
<property name="name" value="xmlJob" />
|
||||
<property name="steps">
|
||||
<bean id="step1" parent="simpleStep">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="org.springframework.batch.execution.tasklet.RestartableItemProviderTasklet">
|
||||
<property name="itemProvider">
|
||||
<bean
|
||||
class="org.springframework.batch.item.provider.InputSourceItemProvider">
|
||||
<property name="inputSource">
|
||||
<bean class="org.springframework.batch.io.xml.XmlInputSource" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="name" value="XmlFileInputSource" />
|
||||
<property name="resource"
|
||||
value="data/xmlJob/input/20070122.testStream.xmlFileStep.xml" />
|
||||
<property name="validating" value="true" />
|
||||
<property name="inputFactory">
|
||||
<bean class="org.springframework.batch.io.xml.xstream.XStreamFactory">
|
||||
<property name="config" ref="streamConfig2" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="itemProcessor">
|
||||
<bean class="org.springframework.batch.item.processor.OutputSourceItemProcessor">
|
||||
<property name="outputSource">
|
||||
<bean class="org.springframework.batch.io.xml.XmlOutputSource" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="name" value="XmlFileOutputSource" />
|
||||
<property name="resource" value="file:20070122.testStream.xmlFileStep.xml" />
|
||||
<property name="outputFactory">
|
||||
<bean class="org.springframework.batch.io.xml.xstream.XStreamFactory">
|
||||
<property name="config" ref="streamConfig" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="streamConfig" class="org.springframework.batch.io.xml.xstream.XStreamConfigurationFactoryBean">
|
||||
<property name="configFile" value="xstream-config.xml" />
|
||||
</bean>
|
||||
|
||||
<bean id="streamConfig2" class="org.springframework.batch.io.xml.xstream.XStreamConfiguration">
|
||||
<property name="rootElementName" value="purchaseOrders" />
|
||||
<property name="rootElementAttributes">
|
||||
<map>
|
||||
<entry key="xmlns" value="http://adsj.accenture.com/purchaseorders" />
|
||||
<entry key="xmlns:xsi" value="http://www.w3.org/2001/XMLSchema-instance" />
|
||||
<entry key="xsi:schemaLocation" value="http://adsj.accenture.com/purchaseorders purchaseorders.xsd" />
|
||||
</map>
|
||||
</property>
|
||||
<property name="fieldAliases">
|
||||
<list>
|
||||
<bean class="org.springframework.batch.io.xml.xstream.FieldAlias">
|
||||
<property name="aliasName" value="org.springframework.batch.sample.domain.xml.Customer" />
|
||||
<property name="type" value="org.springframework.batch.sample.domain.xml.Order" />
|
||||
<property name="fieldName" value="customer" />
|
||||
</bean>
|
||||
<bean class="org.springframework.batch.io.xml.xstream.FieldAlias">
|
||||
<property name="aliasName" value="org.springframework.batch.sample.domain.xml.Shipper" />
|
||||
<property name="type" value="org.springframework.batch.sample.domain.xml.Order" />
|
||||
<property name="fieldName" value="shiper" />
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
<property name="mappings">
|
||||
<list>
|
||||
<bean class="org.springframework.batch.io.xml.xstream.Mapping">
|
||||
<property name="namespaceURI" value="http://adsj.accenture.com/purchaseorders" />
|
||||
<property name="localPart" value="order" />
|
||||
<property name="prefix" value="" />
|
||||
<property name="className" value="org.springframework.batch.sample.domain.xml.Order" />
|
||||
</bean>
|
||||
<bean class="org.springframework.batch.io.xml.xstream.Mapping">
|
||||
<property name="namespaceURI" value="http://adsj.accenture.com/purchaseorders" />
|
||||
<property name="localPart" value="customer" />
|
||||
<property name="prefix" value="" />
|
||||
<property name="className" value="org.springframework.batch.sample.domain.xml.Customer" />
|
||||
</bean>
|
||||
<bean class="org.springframework.batch.io.xml.xstream.Mapping">
|
||||
<property name="namespaceURI" value="http://adsj.accenture.com/purchaseorders" />
|
||||
<property name="localPart" value="shipper" />
|
||||
<property name="prefix" value="" />
|
||||
<property name="className" value="org.springframework.batch.sample.domain.xml.Shipper" />
|
||||
</bean>
|
||||
<bean class="org.springframework.batch.io.xml.xstream.Mapping">
|
||||
<property name="namespaceURI" value="http://adsj.accenture.com/purchaseorders" />
|
||||
<property name="localPart" value="lineItem" />
|
||||
<property name="prefix" value="" />
|
||||
<property name="className" value="org.springframework.batch.sample.domain.xml.LineItem" />
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
<!-- register the step scope with the application context -->
|
||||
<bean class="org.springframework.batch.execution.scope.StepScope" />
|
||||
|
||||
</beans>
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.sample;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
public class XmlJobFunctionalTests extends AbstractLifecycleSpringContextTests {
|
||||
//private static final Log log = LogFactory.getLog(XmlJobFunctionalTests.class);
|
||||
|
||||
private Resource fileInputLocator = new ClassPathResource("data/xmlJob/output/20070122.testStream.xmlFileStep.xml");
|
||||
private Resource fileOutputLocator = new FileSystemResource("20070122.testStream.xmlFileStep.xml");
|
||||
|
||||
// @Override
|
||||
protected String[] getConfigLocations() {
|
||||
return new String[]{"jobs/xmlJob.xml"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Output should be the same as input
|
||||
*/
|
||||
protected void validatePostConditions() throws Exception {
|
||||
//TODO String comparison is inadequate, compare DOMs instead
|
||||
|
||||
String input = IOUtils.toString(fileInputLocator.getInputStream());
|
||||
String output = IOUtils.toString(fileOutputLocator.getInputStream());
|
||||
|
||||
//assertEquals(input, output);
|
||||
assertTrue(input.length() > 0);
|
||||
assertTrue(output.length() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user