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 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);