Harmonize suffix of test classes

Closes gh-1528
This commit is contained in:
Stéphane Nicoll
2025-04-18 11:31:38 +02:00
parent 62f1685999
commit 772549084e
253 changed files with 441 additions and 440 deletions

View File

@@ -33,7 +33,7 @@ import org.springframework.xml.sax.SaxUtils;
import static org.xmlunit.assertj.XmlAssert.assertThat;
public class DomContentHandlerTest {
public class DomContentHandlerTests {
private static final String XML_1 = "<?xml version='1.0' encoding='UTF-8'?>" + "<?pi content?>"
+ "<root xmlns='namespace'>"

View File

@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class QNameEditorTest {
public class QNameEditorTests {
private QNameEditor editor;

View File

@@ -28,7 +28,7 @@ import org.springframework.xml.DocumentBuilderFactoryUtils;
import static org.assertj.core.api.Assertions.assertThat;
public class QNameUtilsTest {
public class QNameUtilsTests {
@Test
public void testValidQNames() {

View File

@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
class SimpleNamespaceContextTest {
class SimpleNamespaceContextTests {
private SimpleNamespaceContext context;

View File

@@ -23,7 +23,7 @@ import org.springframework.core.io.Resource;
import static org.assertj.core.api.Assertions.assertThat;
public class SaxUtilsTest {
public class SaxUtilsTests {
@Test
public void testGetSystemId() {

View File

@@ -26,7 +26,7 @@ import org.springframework.core.io.ClassPathResource;
import static org.assertj.core.api.Assertions.assertThat;
public class ResourceSourceTest {
public class ResourceSourceTests {
@Test
public void testStringSource() throws Exception {

View File

@@ -27,7 +27,7 @@ import org.springframework.xml.DocumentBuilderFactoryUtils;
import static org.xmlunit.assertj.XmlAssert.assertThat;
public class StringResultTest {
public class StringResultTests {
@Test
public void testStringResult() throws Exception {

View File

@@ -25,7 +25,7 @@ import org.w3c.dom.Element;
import static org.assertj.core.api.Assertions.assertThat;
public class StringSourceTest {
public class StringSourceTests {
@Test
public void testStringSource() throws TransformerException {

View File

@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
import static org.mockito.Mockito.mock;
import static org.xmlunit.assertj.XmlAssert.assertThat;
public class TransformerHelperTest {
public class TransformerHelperTests {
private TransformerHelper helper;

View File

@@ -64,7 +64,7 @@ import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
public class TraxUtilsTest {
public class TraxUtilsTests {
@Test
public void testGetDocument() throws Exception {

View File

@@ -38,7 +38,7 @@ import org.springframework.xml.transform.ResourceSource;
import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractValidatorFactoryTest {
public abstract class AbstractValidatorFactoryTests {
private XmlValidator validator;
@@ -50,10 +50,10 @@ public abstract class AbstractValidatorFactoryTest {
public void setUp() throws Exception {
Resource[] schemaResource = new Resource[] {
new ClassPathResource("schema.xsd", AbstractValidatorFactoryTest.class) };
new ClassPathResource("schema.xsd", AbstractValidatorFactoryTests.class) };
this.validator = createValidator(schemaResource, XmlValidatorFactory.SCHEMA_W3C_XML);
this.validInputStream = AbstractValidatorFactoryTest.class.getResourceAsStream("validDocument.xml");
this.invalidInputStream = AbstractValidatorFactoryTest.class.getResourceAsStream("invalidDocument.xml");
this.validInputStream = AbstractValidatorFactoryTests.class.getResourceAsStream("validDocument.xml");
this.invalidInputStream = AbstractValidatorFactoryTests.class.getResourceAsStream("invalidDocument.xml");
}
@AfterEach
@@ -77,7 +77,7 @@ public abstract class AbstractValidatorFactoryTest {
public void testValidateTwice() throws Exception {
this.validator.validate(new StreamSource(this.validInputStream));
this.validInputStream = AbstractValidatorFactoryTest.class.getResourceAsStream("validDocument.xml");
this.validInputStream = AbstractValidatorFactoryTests.class.getResourceAsStream("validDocument.xml");
this.validator.validate(new StreamSource(this.validInputStream));
}
@@ -131,19 +131,19 @@ public abstract class AbstractValidatorFactoryTest {
public void testMultipleSchemasValidMessage() throws Exception {
Resource[] schemaResources = new Resource[] {
new ClassPathResource("multipleSchemas1.xsd", AbstractValidatorFactoryTest.class),
new ClassPathResource("multipleSchemas2.xsd", AbstractValidatorFactoryTest.class) };
new ClassPathResource("multipleSchemas1.xsd", AbstractValidatorFactoryTests.class),
new ClassPathResource("multipleSchemas2.xsd", AbstractValidatorFactoryTests.class) };
this.validator = createValidator(schemaResources, XmlValidatorFactory.SCHEMA_W3C_XML);
Source document = new ResourceSource(
new ClassPathResource("multipleSchemas1.xml", AbstractValidatorFactoryTest.class));
new ClassPathResource("multipleSchemas1.xml", AbstractValidatorFactoryTests.class));
SAXParseException[] errors = this.validator.validate(document);
assertThat(errors).isEmpty();
this.validator = createValidator(schemaResources, XmlValidatorFactory.SCHEMA_W3C_XML);
document = new ResourceSource(
new ClassPathResource("multipleSchemas2.xml", AbstractValidatorFactoryTest.class));
new ClassPathResource("multipleSchemas2.xml", AbstractValidatorFactoryTests.class));
errors = this.validator.validate(document);
assertThat(errors).isEmpty();

View File

@@ -20,7 +20,7 @@ import java.io.IOException;
import org.springframework.core.io.Resource;
public class Jaxp13ValidatorFactoryTest extends AbstractValidatorFactoryTest {
public class Jaxp13ValidatorFactoryTests extends AbstractValidatorFactoryTests {
@Override
protected XmlValidator createValidator(Resource[] schemaResources, String schemaLanguage) throws IOException {

View File

@@ -20,7 +20,7 @@ import java.io.IOException;
import org.springframework.core.io.Resource;
public class Jaxp15ValidatorFactoryTest extends AbstractValidatorFactoryTest {
public class Jaxp15ValidatorFactoryTests extends AbstractValidatorFactoryTests {
@Override
protected XmlValidator createValidator(Resource[] schemaResources, String schemaLanguage) throws IOException {

View File

@@ -27,7 +27,7 @@ import org.springframework.core.io.Resource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
public class SchemaLoaderUtilsTest {
public class SchemaLoaderUtilsTests {
@Test
public void testLoadSchema() throws Exception {

View File

@@ -31,12 +31,12 @@ import org.springframework.core.io.Resource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
public class XmlValidatorFactoryTest {
public class XmlValidatorFactoryTests {
@Test
public void testCreateValidator() throws Exception {
Resource resource = new ClassPathResource("schema.xsd", AbstractValidatorFactoryTest.class);
Resource resource = new ClassPathResource("schema.xsd", AbstractValidatorFactoryTests.class);
XmlValidator validator = XmlValidatorFactory.createValidator(resource, XmlValidatorFactory.SCHEMA_W3C_XML);
assertThat(validator).isNotNull();
@@ -53,7 +53,7 @@ public class XmlValidatorFactoryTest {
public void testInvalidSchemaLanguage() {
assertThatIllegalArgumentException().isThrownBy(() -> XmlValidatorFactory
.createValidator(new ClassPathResource("schema.xsd", AbstractValidatorFactoryTest.class), "bla"));
.createValidator(new ClassPathResource("schema.xsd", AbstractValidatorFactoryTests.class), "bla"));
}
private static final class NonExistentResource extends AbstractResource {

View File

@@ -35,7 +35,7 @@ import org.springframework.xml.DocumentBuilderFactoryUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
public abstract class AbstractXPathExpressionFactoryTest {
public abstract class AbstractXPathExpressionFactoryTests {
private Document noNamespacesDocument;

View File

@@ -48,7 +48,7 @@ import org.springframework.xml.transform.ResourceSource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
public abstract class AbstractXPathTemplateTest {
public abstract class AbstractXPathTemplateTests {
XPathOperations template;
@@ -59,9 +59,9 @@ public abstract class AbstractXPathTemplateTest {
@BeforeEach
public final void setUp() throws Exception {
this.template = createTemplate();
this.namespaces = new ResourceSource(new ClassPathResource("namespaces.xml", AbstractXPathTemplateTest.class));
this.namespaces = new ResourceSource(new ClassPathResource("namespaces.xml", AbstractXPathTemplateTests.class));
this.nonamespaces = new ResourceSource(
new ClassPathResource("nonamespaces.xml", AbstractXPathTemplateTest.class));
new ClassPathResource("nonamespaces.xml", AbstractXPathTemplateTests.class));
}
protected abstract XPathOperations createTemplate() throws Exception;
@@ -157,8 +157,8 @@ public abstract class AbstractXPathTemplateTest {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactoryUtils.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.parse(
SaxUtils.createInputSource(new ClassPathResource("nonamespaces.xml", AbstractXPathTemplateTest.class)));
Document document = documentBuilder.parse(SaxUtils
.createInputSource(new ClassPathResource("nonamespaces.xml", AbstractXPathTemplateTests.class)));
String result = this.template.evaluateAsString("/root/child/text", new DOMSource(document));
@@ -168,7 +168,7 @@ public abstract class AbstractXPathTemplateTest {
@Test
public void testEvaluateSAXSource() throws Exception {
InputStream in = AbstractXPathTemplateTest.class.getResourceAsStream("nonamespaces.xml");
InputStream in = AbstractXPathTemplateTests.class.getResourceAsStream("nonamespaces.xml");
SAXSource source = new SAXSource(new InputSource(in));
String result = this.template.evaluateAsString("/root/child/text", source);
@@ -178,7 +178,7 @@ public abstract class AbstractXPathTemplateTest {
@Test
public void testEvaluateStaxSource() throws Exception {
InputStream in = AbstractXPathTemplateTest.class.getResourceAsStream("nonamespaces.xml");
InputStream in = AbstractXPathTemplateTests.class.getResourceAsStream("nonamespaces.xml");
XMLStreamReader streamReader = XMLInputFactory.newFactory().createXMLStreamReader(in);
StAXSource source = new StAXSource(streamReader);
String result = this.template.evaluateAsString("/root/child/text", source);
@@ -189,7 +189,7 @@ public abstract class AbstractXPathTemplateTest {
@Test
public void testEvaluateStreamSourceInputStream() throws IOException, SAXException, ParserConfigurationException {
InputStream in = AbstractXPathTemplateTest.class.getResourceAsStream("nonamespaces.xml");
InputStream in = AbstractXPathTemplateTests.class.getResourceAsStream("nonamespaces.xml");
StreamSource source = new StreamSource(in);
String result = this.template.evaluateAsString("/root/child/text", source);
@@ -199,7 +199,7 @@ public abstract class AbstractXPathTemplateTest {
@Test
public void testEvaluateStreamSourceSystemId() throws IOException, SAXException, ParserConfigurationException {
URL url = AbstractXPathTemplateTest.class.getResource("nonamespaces.xml");
URL url = AbstractXPathTemplateTests.class.getResource("nonamespaces.xml");
String result = this.template.evaluateAsString("/root/child/text", new StreamSource(url.toString()));
assertThat(result).isEqualTo("text");

View File

@@ -18,7 +18,7 @@ package org.springframework.xml.xpath;
import java.util.Map;
public class JaxenXPathExpressionFactoryTest extends AbstractXPathExpressionFactoryTest {
public class JaxenXPathExpressionFactoryTests extends AbstractXPathExpressionFactoryTests {
@Override
protected XPathExpression createXPathExpression(String expression) {

View File

@@ -19,7 +19,7 @@ package org.springframework.xml.xpath;
import java.util.HashMap;
import java.util.Map;
public class JaxenXPathTemplateTest extends AbstractXPathTemplateTest {
public class JaxenXPathTemplateTests extends AbstractXPathTemplateTests {
@Override
protected XPathOperations createTemplate() {

View File

@@ -18,7 +18,7 @@ package org.springframework.xml.xpath;
import java.util.Map;
public class Jaxp13XPathExpressionFactoryTest extends AbstractXPathExpressionFactoryTest {
public class Jaxp13XPathExpressionFactoryTests extends AbstractXPathExpressionFactoryTests {
@Override
protected XPathExpression createXPathExpression(String expression) {

View File

@@ -19,7 +19,7 @@ package org.springframework.xml.xpath;
import java.util.HashMap;
import java.util.Map;
public class Jaxp13XPathTemplateTest extends AbstractXPathTemplateTest {
public class Jaxp13XPathTemplateTests extends AbstractXPathTemplateTests {
@Override
protected XPathOperations createTemplate() {

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class XPathExpressionFactoryBeanTest {
public class XPathExpressionFactoryBeanTests {
private XPathExpressionFactoryBean factoryBean;

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
public class XPathExpressionFactoryTest {
public class XPathExpressionFactoryTests {
@Test
public void testCreateXPathExpression() {

View File

@@ -36,7 +36,7 @@ import org.springframework.xml.validation.XmlValidator;
import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractXsdSchemaTest {
public abstract class AbstractXsdSchemaTests {
private DocumentBuilder documentBuilder;
@@ -55,12 +55,12 @@ public abstract class AbstractXsdSchemaTest {
@Test
public void testSingle() throws Exception {
Resource resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTests.class);
XsdSchema single = createSchema(resource);
assertThat(single.getTargetNamespace()).isEqualTo("http://www.springframework.org/spring-ws/single/schema");
resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTest.class);
resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTests.class);
Document expected = this.documentBuilder.parse(SaxUtils.createInputSource(resource));
DOMResult domResult = new DOMResult();
this.transformer.transform(single.getSource(), domResult);
@@ -72,12 +72,12 @@ public abstract class AbstractXsdSchemaTest {
@Test
public void testIncludes() throws Exception {
Resource resource = new ClassPathResource("including.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("including.xsd", AbstractXsdSchemaTests.class);
XsdSchema including = createSchema(resource);
assertThat(including.getTargetNamespace()).isEqualTo("http://www.springframework.org/spring-ws/include/schema");
resource = new ClassPathResource("including.xsd", AbstractXsdSchemaTest.class);
resource = new ClassPathResource("including.xsd", AbstractXsdSchemaTests.class);
Document expected = this.documentBuilder.parse(SaxUtils.createInputSource(resource));
DOMResult domResult = new DOMResult();
this.transformer.transform(including.getSource(), domResult);
@@ -89,13 +89,13 @@ public abstract class AbstractXsdSchemaTest {
@Test
public void testImports() throws Exception {
Resource resource = new ClassPathResource("importing.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("importing.xsd", AbstractXsdSchemaTests.class);
XsdSchema importing = createSchema(resource);
assertThat(importing.getTargetNamespace())
.isEqualTo("http://www.springframework.org/spring-ws/importing/schema");
resource = new ClassPathResource("importing.xsd", AbstractXsdSchemaTest.class);
resource = new ClassPathResource("importing.xsd", AbstractXsdSchemaTests.class);
Document expected = this.documentBuilder.parse(SaxUtils.createInputSource(resource));
DOMResult domResult = new DOMResult();
this.transformer.transform(importing.getSource(), domResult);
@@ -107,12 +107,12 @@ public abstract class AbstractXsdSchemaTest {
@Test
public void testXmlNamespace() throws Exception {
Resource resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTests.class);
XsdSchema importing = createSchema(resource);
assertThat(importing.getTargetNamespace()).isEqualTo("http://www.springframework.org/spring-ws/xmlNamespace");
resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTest.class);
resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTests.class);
Document expected = this.documentBuilder.parse(SaxUtils.createInputSource(resource));
DOMResult domResult = new DOMResult();
this.transformer.transform(importing.getSource(), domResult);
@@ -124,7 +124,7 @@ public abstract class AbstractXsdSchemaTest {
@Test
public void testCreateValidator() throws Exception {
Resource resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTests.class);
XsdSchema single = createSchema(resource);
XmlValidator validator = single.createValidator();

View File

@@ -22,7 +22,7 @@ import org.springframework.core.io.Resource;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
public class SimpleXsdSchemaTest extends AbstractXsdSchemaTest {
public class SimpleXsdSchemaTests extends AbstractXsdSchemaTests {
@Override
protected XsdSchema createSchema(Resource resource) throws Exception {

View File

@@ -33,13 +33,13 @@ import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.sax.SaxUtils;
import org.springframework.xml.transform.TransformerFactoryUtils;
import org.springframework.xml.validation.XmlValidator;
import org.springframework.xml.xsd.AbstractXsdSchemaTest;
import org.springframework.xml.xsd.AbstractXsdSchemaTests;
import org.springframework.xml.xsd.XsdSchema;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
public class CommonsXsdSchemaCollectionTest {
public class CommonsXsdSchemaCollectionTests {
private CommonsXsdSchemaCollection collection;
@@ -61,7 +61,7 @@ public class CommonsXsdSchemaCollectionTest {
@Test
public void testSingle() throws Exception {
Resource resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("single.xsd", AbstractXsdSchemaTests.class);
this.collection.setXsds(resource);
this.collection.afterPropertiesSet();
@@ -71,7 +71,7 @@ public class CommonsXsdSchemaCollectionTest {
@Test
public void testInlineComplex() throws Exception {
Resource a = new ClassPathResource("A.xsd", AbstractXsdSchemaTest.class);
Resource a = new ClassPathResource("A.xsd", AbstractXsdSchemaTests.class);
this.collection.setXsds(a);
this.collection.setInline(true);
this.collection.afterPropertiesSet();
@@ -80,7 +80,7 @@ public class CommonsXsdSchemaCollectionTest {
assertThat(schemas).hasSize(2);
assertThat(schemas[0].getTargetNamespace()).isEqualTo("urn:1");
Resource abc = new ClassPathResource("ABC.xsd", AbstractXsdSchemaTest.class);
Resource abc = new ClassPathResource("ABC.xsd", AbstractXsdSchemaTests.class);
Document expected = this.documentBuilder.parse(SaxUtils.createInputSource(abc));
DOMResult domResult = new DOMResult();
this.transformer.transform(schemas[0].getSource(), domResult);
@@ -88,7 +88,7 @@ public class CommonsXsdSchemaCollectionTest {
XmlAssert.assertThat(domResult.getNode()).and(expected).ignoreWhitespace().areIdentical();
assertThat(schemas[1].getTargetNamespace()).isEqualTo("urn:2");
Resource cd = new ClassPathResource("CD.xsd", AbstractXsdSchemaTest.class);
Resource cd = new ClassPathResource("CD.xsd", AbstractXsdSchemaTests.class);
expected = this.documentBuilder.parse(SaxUtils.createInputSource(cd));
domResult = new DOMResult();
this.transformer.transform(schemas[1].getSource(), domResult);
@@ -99,7 +99,7 @@ public class CommonsXsdSchemaCollectionTest {
@Test
public void testCircular() throws Exception {
Resource resource = new ClassPathResource("circular-1.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("circular-1.xsd", AbstractXsdSchemaTests.class);
this.collection.setXsds(resource);
this.collection.setInline(true);
this.collection.afterPropertiesSet();
@@ -111,7 +111,7 @@ public class CommonsXsdSchemaCollectionTest {
@Test
public void testXmlNamespace() throws Exception {
Resource resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("xmlNamespace.xsd", AbstractXsdSchemaTests.class);
this.collection.setXsds(resource);
this.collection.setInline(true);
this.collection.afterPropertiesSet();
@@ -123,7 +123,7 @@ public class CommonsXsdSchemaCollectionTest {
@Test
public void testCreateValidator() throws Exception {
Resource a = new ClassPathResource("A.xsd", AbstractXsdSchemaTest.class);
Resource a = new ClassPathResource("A.xsd", AbstractXsdSchemaTests.class);
this.collection.setXsds(a);
this.collection.setInline(true);
this.collection.afterPropertiesSet();
@@ -136,7 +136,7 @@ public class CommonsXsdSchemaCollectionTest {
@Test
public void testInvalidSchema() {
Resource invalid = new ClassPathResource("invalid.xsd", AbstractXsdSchemaTest.class);
Resource invalid = new ClassPathResource("invalid.xsd", AbstractXsdSchemaTests.class);
this.collection.setXsds(invalid);
assertThatExceptionOfType(CommonsXsdSchemaException.class)

View File

@@ -27,12 +27,12 @@ import org.w3c.dom.Element;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.xml.sax.SaxUtils;
import org.springframework.xml.xsd.AbstractXsdSchemaTest;
import org.springframework.xml.xsd.AbstractXsdSchemaTests;
import org.springframework.xml.xsd.XsdSchema;
import static org.assertj.core.api.Assertions.assertThat;
public class CommonsXsdSchemaTest extends AbstractXsdSchemaTest {
public class CommonsXsdSchemaTests extends AbstractXsdSchemaTests {
@Override
protected XsdSchema createSchema(Resource resource) throws Exception {
@@ -46,7 +46,7 @@ public class CommonsXsdSchemaTest extends AbstractXsdSchemaTest {
@Test
public void testXmime() throws Exception {
Resource resource = new ClassPathResource("xmime.xsd", AbstractXsdSchemaTest.class);
Resource resource = new ClassPathResource("xmime.xsd", AbstractXsdSchemaTests.class);
XsdSchema schema = createSchema(resource);
String namespace = "urn:test";