Search in sources :

Example 1 with XmlBeanDefinitionStoreException

use of org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException in project cxf by apache.

the class ApplicationContextTest method testInvalid.

@Test
public void testInvalid() throws Exception {
    String s4 = getClass().getResource("/org/apache/cxf/transport/http_jetty/spring/invalid-beans.xml").toString();
    try {
        new TestApplicationContext(new String[] { S1, s4 }).close();
        fail("Expected XmlBeanDefinitionStoreException not thrown.");
    } catch (XmlBeanDefinitionStoreException ex) {
        assertTrue(ex.getCause() instanceof SAXParseException);
    }
}
Also used : SAXParseException(org.xml.sax.SAXParseException) XmlBeanDefinitionStoreException(org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException) TestApplicationContext(org.apache.cxf.test.TestApplicationContext) Test(org.junit.Test)

Example 2 with XmlBeanDefinitionStoreException

use of org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException in project cxf by apache.

the class ApplicationContextTest method testInvalid.

@Test
public void testInvalid() throws Exception {
    String s4 = getClass().getResource("/org/apache/cxf/transport/http_undertow/spring/invalid-beans.xml").toString();
    try {
        new TestApplicationContext(new String[] { S1, s4 }).close();
        fail("Expected XmlBeanDefinitionStoreException not thrown.");
    } catch (XmlBeanDefinitionStoreException ex) {
        assertTrue(ex.getCause() instanceof SAXParseException);
    }
}
Also used : SAXParseException(org.xml.sax.SAXParseException) XmlBeanDefinitionStoreException(org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException) TestApplicationContext(org.apache.cxf.test.TestApplicationContext) Test(org.junit.Test)

Example 3 with XmlBeanDefinitionStoreException

use of org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException in project cxf by apache.

the class ApplicationContextTest method testInvalid.

@Test
public void testInvalid() throws Exception {
    String s4 = getClass().getResource("/org/apache/cxf/transport/http/netty/server/spring/invalid-beans.xml").toString();
    try {
        new TestApplicationContext(new String[] { S1, s4 }).close();
        fail("Expected XmlBeanDefinitionStoreException not thrown.");
    } catch (XmlBeanDefinitionStoreException ex) {
        assertTrue(ex.getCause() instanceof SAXParseException);
    }
}
Also used : SAXParseException(org.xml.sax.SAXParseException) XmlBeanDefinitionStoreException(org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException) TestApplicationContext(org.apache.cxf.test.TestApplicationContext) Test(org.junit.Test)

Aggregations

TestApplicationContext (org.apache.cxf.test.TestApplicationContext)3 Test (org.junit.Test)3 XmlBeanDefinitionStoreException (org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException)3 SAXParseException (org.xml.sax.SAXParseException)3