Package org.apache.axiom.testutils.io

Examples of org.apache.axiom.testutils.io.ExceptionInputStream


        // when the XMLStreamReader is created.
        StringBuffer xml = new StringBuffer("<root>");
        for (int i=0; i<100000; i++) {
            xml.append('x');
        }
        InputStream in = new ExceptionInputStream(new ByteArrayInputStream(xml.toString().getBytes("ASCII")));
       
        XMLStreamReader originalReader = StAXUtils.createXMLStreamReader(in);
        InvocationCounter invocationCounter = new InvocationCounter();
        XMLStreamReader reader = (XMLStreamReader)invocationCounter.createProxy(originalReader);
       
View Full Code Here


    }
   
    public void testIOExceptionInPartHeaders() throws Exception {
        InputStream in = getTestResource(TestConstants.MTOM_MESSAGE.getName());
        try {
            Attachments attachments = new Attachments(new ExceptionInputStream(in, 1050), TestConstants.MTOM_MESSAGE.getContentType());
            // TODO: decide what exception should be thrown exactly here
            try {
                attachments.getDataHandler("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
                fail("Expected exception");
            } catch (OMException ex) {
View Full Code Here

    }
   
    public void testIOExceptionInPartContent() throws Exception {
        InputStream in = getTestResource(TestConstants.MTOM_MESSAGE.getName());
        try {
            Attachments attachments = new Attachments(new ExceptionInputStream(in, 1500), TestConstants.MTOM_MESSAGE.getContentType());
            DataHandler dh = attachments.getDataHandler("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
            // TODO: decide what exception should be thrown exactly here
            try {
                dh.getInputStream();
                fail("Expected exception");
View Full Code Here

        // when the XMLStreamReader is created.
        StringBuffer xml = new StringBuffer("<root>");
        for (int i=0; i<100000; i++) {
            xml.append('x');
        }
        InputStream in = new ExceptionInputStream(new ByteArrayInputStream(xml.toString().getBytes("ASCII")));
       
        XMLStreamReader originalReader = StAXUtils.createXMLStreamReader(in);
        InvocationCounter invocationCounter = new InvocationCounter();
        XMLStreamReader reader = (XMLStreamReader)invocationCounter.createProxy(originalReader);
       
View Full Code Here

TOP

Related Classes of org.apache.axiom.testutils.io.ExceptionInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.