parent
c782075a13
commit
85984f3b72
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -16,15 +16,10 @@
|
||||||
|
|
||||||
package org.springframework.oxm.castor;
|
package org.springframework.oxm.castor;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import static org.mockito.Mockito.*;
|
|
||||||
import static org.xmlunit.matchers.CompareMatcher.*;
|
|
||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.xml.transform.Source;
|
import javax.xml.transform.Source;
|
||||||
import javax.xml.transform.sax.SAXResult;
|
import javax.xml.transform.sax.SAXResult;
|
||||||
import javax.xml.transform.stream.StreamResult;
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
@ -42,6 +37,10 @@ import org.xmlunit.xpath.JAXPXPathEngine;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.oxm.AbstractMarshallerTests;
|
import org.springframework.oxm.AbstractMarshallerTests;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
import static org.mockito.Mockito.*;
|
||||||
|
import static org.xmlunit.matchers.CompareMatcher.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the {@link CastorMarshaller} class.
|
* Tests the {@link CastorMarshaller} class.
|
||||||
*
|
*
|
||||||
|
@ -49,6 +48,7 @@ import org.springframework.oxm.AbstractMarshallerTests;
|
||||||
* @author Jakub Narloch
|
* @author Jakub Narloch
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class CastorMarshallerTests extends AbstractMarshallerTests<CastorMarshaller> {
|
public class CastorMarshallerTests extends AbstractMarshallerTests<CastorMarshaller> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,14 +25,13 @@ import javax.xml.transform.stream.StreamSource;
|
||||||
|
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.xml.sax.InputSource;
|
||||||
|
import org.xml.sax.XMLReader;
|
||||||
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.oxm.AbstractUnmarshallerTests;
|
import org.springframework.oxm.AbstractUnmarshallerTests;
|
||||||
import org.springframework.oxm.MarshallingException;
|
import org.springframework.oxm.MarshallingException;
|
||||||
|
|
||||||
import org.xml.sax.InputSource;
|
|
||||||
import org.xml.sax.XMLReader;
|
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
@ -41,6 +40,7 @@ import static org.junit.Assert.*;
|
||||||
* @author Jakub Narloch
|
* @author Jakub Narloch
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class CastorUnmarshallerTests extends AbstractUnmarshallerTests<CastorMarshaller> {
|
public class CastorUnmarshallerTests extends AbstractUnmarshallerTests<CastorMarshaller> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2017 the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -20,7 +20,6 @@ import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
import org.springframework.oxm.castor.CastorMarshaller;
|
|
||||||
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
|
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
@ -39,39 +38,15 @@ public class OxmNamespaceHandlerTests {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void jaxb2ContextPathMarshaller() throws Exception {
|
public void jaxb2ContextPathMarshaller() {
|
||||||
Jaxb2Marshaller jaxb2Marshaller = applicationContext.getBean("jaxb2ContextPathMarshaller", Jaxb2Marshaller.class);
|
Jaxb2Marshaller jaxb2Marshaller = applicationContext.getBean("jaxb2ContextPathMarshaller", Jaxb2Marshaller.class);
|
||||||
assertNotNull(jaxb2Marshaller);
|
assertNotNull(jaxb2Marshaller);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void jaxb2ClassesToBeBoundMarshaller() throws Exception {
|
public void jaxb2ClassesToBeBoundMarshaller() {
|
||||||
Jaxb2Marshaller jaxb2Marshaller = applicationContext.getBean("jaxb2ClassesMarshaller", Jaxb2Marshaller.class);
|
Jaxb2Marshaller jaxb2Marshaller = applicationContext.getBean("jaxb2ClassesMarshaller", Jaxb2Marshaller.class);
|
||||||
assertNotNull(jaxb2Marshaller);
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue