diff --git a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java index 423fec4de64..b356205ea5d 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2018 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,32 +20,25 @@ import java.io.StringWriter; import java.util.Arrays; import java.util.HashMap; import java.util.Map; - import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamResult; import org.custommonkey.xmlunit.NamespaceContext; import org.custommonkey.xmlunit.SimpleNamespaceContext; +import org.custommonkey.xmlunit.XMLAssert; import org.custommonkey.xmlunit.XMLUnit; import org.custommonkey.xmlunit.XpathEngine; - import org.junit.Test; - import org.mockito.InOrder; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.oxm.AbstractMarshallerTests; - import org.w3c.dom.Document; import org.w3c.dom.NodeList; - import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; -import static org.custommonkey.xmlunit.XMLAssert.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.springframework.core.io.ClassPathResource; +import org.springframework.oxm.AbstractMarshallerTests; + +import static org.junit.Assert.*; import static org.mockito.Mockito.*; /** @@ -55,6 +48,7 @@ import static org.mockito.Mockito.*; * @author Jakub Narloch * @author Sam Brannen */ +@Deprecated public class CastorMarshallerTests extends AbstractMarshallerTests { /** @@ -163,14 +157,14 @@ public class CastorMarshallerTests extends AbstractMarshallerTests")); } @@ -204,7 +198,7 @@ public class CastorMarshallerTests extends AbstractMarshallerTests { /** diff --git a/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java index 4a6a46ba79f..87f8b154ba3 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/config/OxmNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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,13 +16,10 @@ package org.springframework.oxm.config; -import org.apache.xmlbeans.XmlOptions; - import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.oxm.castor.CastorMarshaller; import org.springframework.oxm.jaxb.Jaxb2Marshaller; import static org.junit.Assert.*; @@ -34,7 +31,6 @@ import static org.junit.Assert.*; * @author Jakub Narloch * @author Sam Brannen */ -@SuppressWarnings("deprecation") public class OxmNamespaceHandlerTests { private final ApplicationContext applicationContext = @@ -42,49 +38,15 @@ public class OxmNamespaceHandlerTests { @Test - public void xmlBeansMarshaller() throws Exception { - org.springframework.oxm.xmlbeans.XmlBeansMarshaller marshaller = applicationContext.getBean( - org.springframework.oxm.xmlbeans.XmlBeansMarshaller.class); - XmlOptions options = marshaller.getXmlOptions(); - assertNotNull("Options not set", options); - assertTrue("option not set", options.hasOption("SAVE_PRETTY_PRINT")); - assertEquals("option not set", "true", options.get("SAVE_PRETTY_PRINT")); - } - - @Test - public void jaxb2ContextPathMarshaller() throws Exception { + public void jaxb2ContextPathMarshaller() { Jaxb2Marshaller jaxb2Marshaller = applicationContext.getBean("jaxb2ContextPathMarshaller", Jaxb2Marshaller.class); assertNotNull(jaxb2Marshaller); } @Test - public void jaxb2ClassesToBeBoundMarshaller() throws Exception { + public void jaxb2ClassesToBeBoundMarshaller() { Jaxb2Marshaller jaxb2Marshaller = applicationContext.getBean("jaxb2ClassesMarshaller", Jaxb2Marshaller.class); assertNotNull(jaxb2Marshaller); } - @Test - public void castorEncodingMarshaller() throws Exception { - CastorMarshaller castorMarshaller = applicationContext.getBean("castorEncodingMarshaller", CastorMarshaller.class); - assertNotNull(castorMarshaller); - } - - @Test - public void castorTargetClassMarshaller() throws Exception { - CastorMarshaller castorMarshaller = applicationContext.getBean("castorTargetClassMarshaller", CastorMarshaller.class); - assertNotNull(castorMarshaller); - } - - @Test - public void castorTargetPackageMarshaller() throws Exception { - CastorMarshaller castorMarshaller = applicationContext.getBean("castorTargetPackageMarshaller", CastorMarshaller.class); - assertNotNull(castorMarshaller); - } - - @Test - public void castorMappingLocationMarshaller() throws Exception { - CastorMarshaller castorMarshaller = applicationContext.getBean("castorMappingLocationMarshaller", CastorMarshaller.class); - assertNotNull(castorMarshaller); - } - }