Search in sources :

Example 1 with TestApplicationContext

use of org.apache.cxf.test.TestApplicationContext 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 TestApplicationContext

use of org.apache.cxf.test.TestApplicationContext in project cxf by apache.

the class ApplicationContextTest method testContextWithProperties.

@Test
public void testContextWithProperties() throws Exception {
    String s4 = getClass().getResource("/org/apache/cxf/transport/http_jetty/spring/beans-props.xml").toString();
    TestApplicationContext ctx = new TestApplicationContext(new String[] { S1, s4 });
    checkContext(ctx);
    ctx.close();
    ctx.destroy();
}
Also used : TestApplicationContext(org.apache.cxf.test.TestApplicationContext) Test(org.junit.Test)

Example 3 with TestApplicationContext

use of org.apache.cxf.test.TestApplicationContext in project cxf by apache.

the class ApplicationContextTest method testContextWithProperties.

@Test
public void testContextWithProperties() throws Exception {
    String s4 = getClass().getResource("/org/apache/cxf/transport/http/netty/server/spring/beans-props.xml").toString();
    TestApplicationContext ctx = new TestApplicationContext(new String[] { S1, s4 });
    checkContext(ctx);
    ctx.close();
    ctx.destroy();
}
Also used : TestApplicationContext(org.apache.cxf.test.TestApplicationContext) Test(org.junit.Test)

Example 4 with TestApplicationContext

use of org.apache.cxf.test.TestApplicationContext 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 5 with TestApplicationContext

use of org.apache.cxf.test.TestApplicationContext in project cxf by apache.

the class ApplicationContextTest method testContextWithProperties.

@Test
public void testContextWithProperties() throws Exception {
    String s4 = getClass().getResource("/org/apache/cxf/transport/http_undertow/spring/beans-props.xml").toString();
    TestApplicationContext ctx = new TestApplicationContext(new String[] { S1, s4 });
    checkContext(ctx);
    ctx.close();
    ctx.destroy();
}
Also used : TestApplicationContext(org.apache.cxf.test.TestApplicationContext) Test(org.junit.Test)

Aggregations

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