Version updates

This commit is contained in:
Michael Minella
2017-10-23 12:11:39 -05:00
parent b2f8f7f9cd
commit 52d2c257c5
18 changed files with 103 additions and 104 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 the original author or authors.
* Copyright 2010-2017 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.
@@ -16,20 +16,19 @@
package org.springframework.batch.item.xml;
import java.io.File;
import java.io.FileReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.xmlunit.builder.Input;
import org.xmlunit.matchers.CompareMatcher;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.xml.StaxEventItemWriter;
import org.springframework.batch.item.xml.domain.Trade;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.core.io.ClassPathResource;
@@ -42,6 +41,8 @@ import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.util.ClassUtils;
import org.springframework.util.StopWatch;
import static org.junit.Assert.assertThat;
public abstract class AbstractStaxEventWriterItemWriterTests {
private Log logger = LogFactory.getLog(getClass());
@@ -93,11 +94,10 @@ public abstract class AbstractStaxEventWriterItemWriterTests {
writer.close();
stopWatch.stop();
logger.info("Timing for XML writer: " + stopWatch);
XMLUnit.setIgnoreWhitespace(true);
// String content = FileUtils.readFileToString(resource.getFile());
// System.err.println(content);
XMLAssert.assertXMLEqual(new FileReader(expected.getFile()), new FileReader(resource.getFile()));
assertThat(
Input.from(expected.getFile()),
CompareMatcher.isSimilarTo(Input.from(resource.getFile())));
}
@Before

View File

@@ -15,26 +15,22 @@
*/
package org.springframework.batch.item.xml;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileReader;
import java.io.StringWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.stream.StreamResult;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.xmlunit.builder.Input;
import org.xmlunit.matchers.CompareMatcher;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.xml.StaxEventItemWriter;
import org.springframework.batch.item.xml.domain.QualifiedTrade;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.core.io.ClassPathResource;
@@ -48,6 +44,9 @@ import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.util.ClassUtils;
import org.springframework.util.StopWatch;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public class Jaxb2NamespaceMarshallingTests {
private Log logger = LogFactory.getLog(getClass());
@@ -99,11 +98,10 @@ public class Jaxb2NamespaceMarshallingTests {
writer.close();
stopWatch.stop();
logger.info("Timing for XML writer: " + stopWatch);
XMLUnit.setIgnoreWhitespace(true);
// String content = FileUtils.readFileToString(resource.getFile());
// System.err.println(content);
XMLAssert.assertXMLEqual(new FileReader(expected.getFile()), new FileReader(resource.getFile()));
assertThat(
Input.from(expected.getFile()),
CompareMatcher.isSimilarTo(Input.from(resource.getFile())));
}
@Before

View File

@@ -13,7 +13,7 @@
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${batch.jdbc.driver}" />
<property name="url" value="${batch.jdbc.url}" />
<property name="username" value="${batch.jdbc.user}" />