Added @Override annotations.

This commit is contained in:
Arjen Poutsma
2010-02-01 10:56:11 +00:00
parent fdcad3a135
commit 9bc9786a0a
363 changed files with 1551 additions and 351 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2010 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.
@@ -47,10 +47,12 @@ import org.springframework.util.StringUtils;
*/
public class QNameEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
setValue(QNameUtils.parseQNameString(text));
}
@Override
public String getAsText() {
Object value = getValue();
if (value == null || !(value instanceof QName)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -53,6 +53,7 @@ public abstract class AbstractStaxXmlReader extends AbstractXmlReader {
private Boolean isStandalone;
@Override
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
if (NAMESPACES_FEATURE_NAME.equals(name)) {
return namespacesFeature;
@@ -73,6 +74,7 @@ public abstract class AbstractStaxXmlReader extends AbstractXmlReader {
}
}
@Override
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
if (NAMESPACES_FEATURE_NAME.equals(name)) {
this.namespacesFeature = value;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -77,14 +77,17 @@ public class StaxEventContentHandler extends AbstractStaxContentHandler {
this.locator = locator;
}
@Override
protected void startDocumentInternal() throws XMLStreamException {
consumeEvent(eventFactory.createStartDocument());
}
@Override
protected void endDocumentInternal() throws XMLStreamException {
consumeEvent(eventFactory.createEndDocument());
}
@Override
protected void startElementInternal(QName name, Attributes atts, SimpleNamespaceContext namespaceContext)
throws XMLStreamException {
List attributes = getAttributes(atts);
@@ -92,19 +95,23 @@ public class StaxEventContentHandler extends AbstractStaxContentHandler {
consumeEvent(eventFactory.createStartElement(name, attributes.iterator(), namespaces.iterator()));
}
@Override
protected void endElementInternal(QName name, SimpleNamespaceContext namespaceContext) throws XMLStreamException {
List namespaces = createNamespaces(namespaceContext);
consumeEvent(eventFactory.createEndElement(name, namespaces.iterator()));
}
@Override
protected void charactersInternal(char[] ch, int start, int length) throws XMLStreamException {
consumeEvent(eventFactory.createCharacters(new String(ch, start, length)));
}
@Override
protected void ignorableWhitespaceInternal(char[] ch, int start, int length) throws XMLStreamException {
consumeEvent(eventFactory.createIgnorableSpace(new String(ch, start, length)));
}
@Override
protected void processingInstructionInternal(String target, String data) throws XMLStreamException {
consumeEvent(eventFactory.createProcessingInstruction(target, data));
}
@@ -146,6 +153,7 @@ public class StaxEventContentHandler extends AbstractStaxContentHandler {
// No operation
//
@Override
protected void skippedEntityInternal(String name) throws XMLStreamException {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -79,6 +79,7 @@ public class StaxEventXmlReader extends AbstractStaxXmlReader {
this.reader = reader;
}
@Override
protected void parseInternal() throws SAXException, XMLStreamException {
boolean documentStarted = false;
boolean documentEnded = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -51,33 +51,41 @@ public class StaxStreamContentHandler extends AbstractStaxContentHandler {
public void setDocumentLocator(Locator locator) {
}
@Override
protected void charactersInternal(char[] ch, int start, int length) throws XMLStreamException {
streamWriter.writeCharacters(ch, start, length);
}
@Override
protected void endDocumentInternal() throws XMLStreamException {
streamWriter.writeEndDocument();
}
@Override
protected void endElementInternal(QName name, SimpleNamespaceContext namespaceContext) throws XMLStreamException {
streamWriter.writeEndElement();
}
@Override
protected void ignorableWhitespaceInternal(char[] ch, int start, int length) throws XMLStreamException {
streamWriter.writeCharacters(ch, start, length);
}
@Override
protected void processingInstructionInternal(String target, String data) throws XMLStreamException {
streamWriter.writeProcessingInstruction(target, data);
}
@Override
protected void skippedEntityInternal(String name) {
}
@Override
protected void startDocumentInternal() throws XMLStreamException {
streamWriter.writeStartDocument();
}
@Override
protected void startElementInternal(QName name, Attributes attributes, SimpleNamespaceContext namespaceContext)
throws XMLStreamException {
streamWriter.writeStartElement(QNameUtils.getPrefix(name), name.getLocalPart(), name.getNamespaceURI());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2005-2010 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.
@@ -63,6 +63,7 @@ public class StaxStreamXmlReader extends AbstractStaxXmlReader {
this.reader = reader;
}
@Override
protected void parseInternal() throws SAXException, XMLStreamException {
boolean documentStarted = false;
boolean documentEnded = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -111,6 +111,7 @@ public class StaxResult extends SAXResult {
*
* @throws UnsupportedOperationException always
*/
@Override
public void setHandler(ContentHandler handler) {
throw new UnsupportedOperationException("setHandler is not supported");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -105,6 +105,7 @@ public class StaxSource extends SAXSource {
*
* @throws UnsupportedOperationException always
*/
@Override
public void setInputSource(InputSource inputSource) {
throw new UnsupportedOperationException("setInputSource is not supported");
}
@@ -114,6 +115,7 @@ public class StaxSource extends SAXSource {
*
* @throws UnsupportedOperationException always
*/
@Override
public void setXMLReader(XMLReader reader) {
throw new UnsupportedOperationException("setXMLReader is not supported");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -164,13 +164,16 @@ abstract class Jaxp10ValidatorFactory {
return (SAXParseException[]) errors.toArray(new SAXParseException[errors.size()]);
}
@Override
public void warning(SAXParseException ex) throws SAXException {
}
@Override
public void error(SAXParseException ex) throws SAXException {
errors.add(ex);
}
@Override
public void fatalError(SAXParseException ex) throws SAXException {
errors.add(ex);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008 the original author or authors.
* Copyright 2005-2010 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.
@@ -241,6 +241,7 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali
private class ClasspathUriResolver extends DefaultURIResolver {
@Override
public InputSource resolveEntity(String namespace, String schemaLocation, String baseUri) {
if (resourceLoader != null) {
Resource resource = resourceLoader.getResource(schemaLocation);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -50,6 +50,7 @@ public class DomContentHandlerTest extends XMLTestCase {
private DocumentBuilder documentBuilder;
@Override
protected void setUp() throws Exception {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2010 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.
@@ -24,6 +24,7 @@ public class QNameEditorTest extends TestCase {
private QNameEditor editor;
@Override
protected void setUp() throws Exception {
editor = new QNameEditor();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2010 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.
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.xml.namespace;
import java.util.Collections;
@@ -26,6 +27,7 @@ public class SimpleNamespaceContextTest extends TestCase {
private SimpleNamespaceContext context;
@Override
protected void setUp() throws Exception {
context = new SimpleNamespaceContext();
context.bindNamespaceUri("prefix", "namespaceURI");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -33,6 +33,7 @@ public abstract class AbstractStaxContentHandlerTestCase extends XMLTestCase {
private XMLReader xmlReader;
@Override
protected void setUp() throws Exception {
xmlReader = XMLReaderFactory.createXMLReader();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -51,6 +51,7 @@ public abstract class AbstractStaxXmlReaderTestCase extends TestCase {
private ContentHandler contentHandler;
@Override
protected void setUp() throws Exception {
inputFactory = XMLInputFactory.newInstance();
standardReader = XMLReaderFactory.createXMLReader();
@@ -142,6 +143,7 @@ public abstract class AbstractStaxXmlReaderTestCase extends TestCase {
/** Easymock <code>ArgumentMatcher</code> implementation that matches SAX arguments. */
protected static class SaxArgumentMatcher extends AbstractMatcher {
@Override
public boolean matches(Object[] expected, Object[] actual) {
if (expected == actual) {
return true;
@@ -169,6 +171,7 @@ public abstract class AbstractStaxXmlReaderTestCase extends TestCase {
}
}
@Override
protected boolean argumentMatches(Object expected, Object actual) {
if (expected instanceof char[]) {
return Arrays.equals((char[]) expected, (char[]) actual);
@@ -201,6 +204,7 @@ public abstract class AbstractStaxXmlReaderTestCase extends TestCase {
}
}
@Override
public String toString(Object[] arguments) {
if (arguments != null && arguments.length == 3 && arguments[0] instanceof char[] &&
arguments[1] instanceof Integer && arguments[2] instanceof Integer) {
@@ -212,6 +216,7 @@ public abstract class AbstractStaxXmlReaderTestCase extends TestCase {
}
}
@Override
protected String argumentToString(Object argument) {
if (argument instanceof char[]) {
char[] array = (char[]) argument;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -22,6 +22,7 @@ import javax.xml.stream.XMLStreamException;
public class StaxEventContentHandlerTest extends AbstractStaxContentHandlerTestCase {
@Override
protected AbstractStaxContentHandler createStaxContentHandler(Writer writer) throws XMLStreamException {
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
return new StaxEventContentHandler(outputFactory.createXMLEventWriter(writer));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -31,6 +31,7 @@ public class StaxEventXmlReaderTest extends AbstractStaxXmlReaderTestCase {
public static final String CONTENT = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";
@Override
protected AbstractStaxXmlReader createStaxXmlReader(InputStream inputStream) throws XMLStreamException {
return new StaxEventXmlReader(inputFactory.createXMLEventReader(inputStream));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -22,6 +22,7 @@ import javax.xml.stream.XMLStreamException;
public class StaxStreamContentHandlerTest extends AbstractStaxContentHandlerTestCase {
@Override
protected AbstractStaxContentHandler createStaxContentHandler(Writer writer) throws XMLStreamException {
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
return new StaxStreamContentHandler(outputFactory.createXMLStreamWriter(writer));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -32,6 +32,7 @@ public class StaxStreamXmlReaderTest extends AbstractStaxXmlReaderTestCase {
public static final String CONTENT = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";
@Override
protected AbstractStaxXmlReader createStaxXmlReader(InputStream inputStream) throws XMLStreamException {
return new StaxStreamXmlReader(inputFactory.createXMLStreamReader(inputStream));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -33,6 +33,7 @@ public class XmlEventStreamReaderTest extends XMLTestCase {
private XmlEventStreamReader streamReader;
@Override
protected void setUp() throws Exception {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLEventReader eventReader = inputFactory.createXMLEventReader(new StringReader(XML));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -34,6 +34,7 @@ public class StaxResultTest extends XMLTestCase {
private XMLOutputFactory inputFactory;
@Override
protected void setUp() throws Exception {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformer = transformerFactory.newTransformer();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -34,6 +34,7 @@ public class StaxSourceTest extends XMLTestCase {
private XMLInputFactory inputFactory;
@Override
protected void setUp() throws Exception {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformer = transformerFactory.newTransformer();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -39,6 +39,7 @@ public abstract class AbstractValidatorFactoryTestCase extends TestCase {
private InputStream invalidInputStream;
@Override
protected void setUp() throws Exception {
Resource[] schemaResource =
new Resource[]{new ClassPathResource("schema.xsd", AbstractValidatorFactoryTestCase.class)};
@@ -47,6 +48,7 @@ public abstract class AbstractValidatorFactoryTestCase extends TestCase {
invalidInputStream = AbstractValidatorFactoryTestCase.class.getResourceAsStream("invalidDocument.xml");
}
@Override
protected void tearDown() throws Exception {
validInputStream.close();
invalidInputStream.close();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -22,6 +22,7 @@ import org.springframework.core.io.Resource;
public class Jaxp10ValidatorFactoryTest extends AbstractValidatorFactoryTestCase {
@Override
protected XmlValidator createValidator(Resource[] schemaResources, String schemaLanguage) throws IOException {
return Jaxp10ValidatorFactory.createValidator(schemaResources, schemaLanguage);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -22,6 +22,7 @@ import org.springframework.core.io.Resource;
public class Jaxp13ValidatorFactoryTest extends AbstractValidatorFactoryTestCase {
@Override
protected XmlValidator createValidator(Resource[] schemaResources, String schemaLanguage) throws IOException {
return Jaxp13ValidatorFactory.createValidator(schemaResources, schemaLanguage);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -60,10 +60,12 @@ public class XmlValidatorFactoryTest extends TestCase {
private static class NonExistentResource extends AbstractResource {
@Override
public Resource createRelative(String relativePath) throws IOException {
throw new IOException();
}
@Override
public boolean exists() {
return false;
}
@@ -72,22 +74,27 @@ public class XmlValidatorFactoryTest extends TestCase {
return null;
}
@Override
public File getFile() throws IOException {
throw new IOException();
}
@Override
public String getFilename() {
return null;
}
@Override
public URL getURL() throws IOException {
throw new IOException();
}
@Override
public URI getURI() throws IOException {
throw new IOException();
}
@Override
public boolean isOpen() {
return false;
}
@@ -96,6 +103,7 @@ public class XmlValidatorFactoryTest extends TestCase {
throw new IOException();
}
@Override
public boolean isReadable() {
return false;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -39,6 +39,7 @@ public abstract class AbstractXPathExpressionFactoryTestCase extends TestCase {
private Map namespaces = new HashMap();
@Override
protected void setUp() throws Exception {
namespaces.put("prefix1", "namespace1");
namespaces.put("prefix2", "namespace2");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2010 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.
@@ -43,6 +43,7 @@ public abstract class AbstractXPathTemplateTestCase extends TestCase {
private Source nonamespaces;
@Override
protected final void setUp() throws Exception {
template = createTemplate();
namespaces = new ResourceSource(new ClassPathResource("namespaces.xml", AbstractXPathTemplateTestCase.class));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -23,18 +23,22 @@ import org.xml.sax.SAXException;
public class JaxenXPathExpressionFactoryTest extends AbstractXPathExpressionFactoryTestCase {
@Override
protected XPathExpression createXPathExpression(String expression) {
return JaxenXPathExpressionFactory.createXPathExpression(expression);
}
@Override
protected XPathExpression createXPathExpression(String expression, Map namespaces) {
return JaxenXPathExpressionFactory.createXPathExpression(expression, namespaces);
}
@Override
public void testEvaluateAsDoubleNoNamespaces() throws IOException, SAXException {
// Currently not working on Jaxen 1.1 beta 8, hence the override here
}
@Override
public void testEvaluateAsDoubleNamespaces() throws IOException, SAXException {
// Currently not working on Jaxen 1.1 beta 8, hence the override here
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2010 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.
@@ -20,6 +20,7 @@ import java.util.Properties;
public class JaxenXPathTemplateTest extends AbstractXPathTemplateTestCase {
@Override
protected XPathOperations createTemplate() throws Exception {
JaxenXPathTemplate template = new JaxenXPathTemplate();
Properties namespaces = new Properties();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2010 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.
@@ -20,10 +20,12 @@ import java.util.Map;
public class Jaxp13XPathExpressionFactoryTest extends AbstractXPathExpressionFactoryTestCase {
@Override
protected XPathExpression createXPathExpression(String expression) {
return Jaxp13XPathExpressionFactory.createXPathExpression(expression);
}
@Override
protected XPathExpression createXPathExpression(String expression, Map namespaces) {
return Jaxp13XPathExpressionFactory.createXPathExpression(expression, namespaces);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2010 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.
@@ -20,6 +20,7 @@ import java.util.Properties;
public class Jaxp13XPathTemplateTest extends AbstractXPathTemplateTestCase {
@Override
protected XPathOperations createTemplate() throws Exception {
Jaxp13XPathTemplate template = new Jaxp13XPathTemplate();
Properties namespaces = new Properties();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2010 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.
@@ -22,6 +22,7 @@ public class XPathExpressionFactoryBeanTest extends TestCase {
private XPathExpressionFactoryBean factoryBean;
@Override
protected void setUp() throws Exception {
factoryBean = new XPathExpressionFactoryBean();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008 the original author or authors.
* Copyright 2005-2010 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.
@@ -37,6 +37,7 @@ public abstract class AbstractXsdSchemaTestCase extends XMLTestCase {
protected Transformer transformer;
@Override
protected final void setUp() throws Exception {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);

View File

@@ -1,5 +1,5 @@
/*
* Copyright ${YEAR} the original author or authors.
* Copyright 2005-2010 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.
@@ -20,6 +20,7 @@ import org.springframework.core.io.Resource;
public class SimpleXsdSchemaTest extends AbstractXsdSchemaTestCase {
@Override
protected XsdSchema createSchema(Resource resource) throws Exception {
SimpleXsdSchema schema = new SimpleXsdSchema(resource);
schema.afterPropertiesSet();

View File

@@ -1,5 +1,5 @@
/*
* Copyright ${YEAR} the original author or authors.
* Copyright 2005-2010 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.
@@ -41,6 +41,7 @@ public class CommonsXsdSchemaCollectionTest extends XMLTestCase {
private DocumentBuilder documentBuilder;
@Override
protected void setUp() throws Exception {
collection = new CommonsXsdSchemaCollection();
TransformerFactory transformerFactory = TransformerFactory.newInstance();

View File

@@ -1,5 +1,5 @@
/*
* Copyright ${YEAR} the original author or authors.
* Copyright 2005-2010 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.
@@ -31,6 +31,7 @@ import org.springframework.xml.xsd.XsdSchema;
public class CommonsXsdSchemaTest extends AbstractXsdSchemaTestCase {
@Override
protected XsdSchema createSchema(Resource resource) throws Exception {
XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
XmlSchema schema = schemaCollection.read(SaxUtils.createInputSource(resource), null);