Examples of AddNumbersHandlerFault_Exception


Examples of org.apache.axis2.jaxws.sample.addnumbershandler.AddNumbersHandlerFault_Exception

        AddNumbersHandlerService service = new AddNumbersHandlerService();
        AddNumbersHandlerPortType proxy = service.getAddNumbersHandlerPort();

        BindingProvider p = (BindingProvider)proxy;
        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
        AddNumbersHandlerFault_Exception expectedException = null;
        Throwable t = null;
        try {
            proxy.addNumbersHandler(Integer.MAX_VALUE, Integer.MAX_VALUE);
           
        } catch (Throwable e) {
            // An exception is expected
            t = e;
           
        }
       
        // Make sure the proper exception is thrown
        if (t == null) {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown");
        }
        if (t instanceof AddNumbersHandlerFault_Exception) {
            expectedException = (AddNumbersHandlerFault_Exception) t;
        } else {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown, " +
                        "but the exception is: " + t);
        }
      
        // also confirm that @PreDestroy method is called.  Since it only makes sense to call it on the managed
        // (server) side and just before the handler instance goes out of scope, we are creating a file in the
        // @PreDestroy method, and will check for its existance here.  If the file does not exist, it means
        // @PreDestroy method was never called.  The file is set to .deleteOnExit(), so no need to delete it.
        File file = new File("AddNumbersProtocolHandler.preDestroy.txt");
        assertTrue("File AddNumbersProtocolHandler.preDestroy.txt does not exist, meaning the @PreDestroy method was not called.", file.exists());

        String log = readLogFile();
        String expected_calls =
            "AddNumbersLogicalHandler2 POST_CONSTRUCT\n"
            + "AddNumbersProtocolHandler2 GET_HEADERS\n"
            + "AddNumbersProtocolHandler GET_HEADERS\n"
            + "AddNumbersProtocolHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler CLOSE\n"
            + "AddNumbersLogicalHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler CLOSE\n"
            + "AddNumbersProtocolHandler PRE_DESTROY\n";
       
        assertEquals(expected_calls, log);
       
        TestLogger.logger.debug("Expected Exception is " +
                                expectedException.getMessage());
       
        // The outbound service handler adds the stack trace to the
        // message.  Make sure the stack trace contains the AddNumbersHandlerPortTypeImpl
        assertTrue("A stack trace was not present in the returned exception's message:" +
                   expectedException.getMessage(),
                   expectedException.getMessage().indexOf("AddNumbersHandlerPortTypeImpl") > 0);

        TestLogger.logger.debug("----------------------------------");
       
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbershandler.AddNumbersHandlerFault_Exception

        AddNumbersHandlerService service = new AddNumbersHandlerService();
        AddNumbersHandlerPortType proxy = service.getAddNumbersHandlerPort();

        BindingProvider p = (BindingProvider)proxy;
        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
        AddNumbersHandlerFault_Exception expectedException = null;
        Throwable t = null;
        try {
            proxy.addNumbersHandler(Integer.MAX_VALUE, Integer.MAX_VALUE);
           
        } catch (Throwable e) {
            // An exception is expected
            t = e;
           
        }
       
        // Make sure the proper exception is thrown
        if (t == null) {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown");
        }
        if (t instanceof AddNumbersHandlerFault_Exception) {
            expectedException = (AddNumbersHandlerFault_Exception) t;
        } else {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown, " +
                        "but the exception is: " + t);
        }
      
        // also confirm that @PreDestroy method is called.  Since it only makes sense to call it on the managed
        // (server) side and just before the handler instance goes out of scope, we are creating a file in the
        // @PreDestroy method, and will check for its existance here.  If the file does not exist, it means
        // @PreDestroy method was never called.  The file is set to .deleteOnExit(), so no need to delete it.
        File file = new File("AddNumbersProtocolHandler.preDestroy.txt");
        assertTrue("File AddNumbersProtocolHandler.preDestroy.txt does not exist, meaning the @PreDestroy method was not called.", file.exists());

        String log = readLogFile();
        String expected_calls =
            "AddNumbersLogicalHandler2 POST_CONSTRUCT\n"
            + "AddNumbersProtocolHandler2 GET_HEADERS\n"
            + "AddNumbersProtocolHandler GET_HEADERS\n"
            + "AddNumbersProtocolHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler CLOSE\n"
            + "AddNumbersLogicalHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler CLOSE\n"
            + "AddNumbersProtocolHandler PRE_DESTROY\n";
       
        assertEquals(expected_calls, log);
       
        TestLogger.logger.debug("Expected Exception is " +
                                expectedException.getMessage());
       
        // The outbound service handler adds the stack trace to the
        // message.  Make sure the stack trace contains the AddNumbersHandlerPortTypeImpl
        assertTrue("A stack trace was not present in the returned exception's message:" +
                   expectedException.getMessage(),
                   expectedException.getMessage().indexOf("AddNumbersHandlerPortTypeImpl") > 0);

        TestLogger.logger.debug("----------------------------------");
       
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbershandler.AddNumbersHandlerFault_Exception

        AddNumbersHandlerService service = new AddNumbersHandlerService();
        AddNumbersHandlerPortType proxy = service.getAddNumbersHandlerPort();

        BindingProvider p = (BindingProvider)proxy;
        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
        AddNumbersHandlerFault_Exception expectedException = null;
        Throwable t = null;
        try {
            proxy.addNumbersHandler(Integer.MAX_VALUE, Integer.MAX_VALUE);
           
        } catch (Throwable e) {
            // An exception is expected
            t = e;
           
        }
       
        // Make sure the proper exception is thrown
        if (t == null) {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown");
        }
        if (t instanceof AddNumbersHandlerFault_Exception) {
            expectedException = (AddNumbersHandlerFault_Exception) t;
        } else {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown, " +
                        "but the exception is: " + t);
        }
      
        // also confirm that @PreDestroy method is called.  Since it only makes sense to call it on the managed
        // (server) side and just before the handler instance goes out of scope, we are creating a file in the
        // @PreDestroy method, and will check for its existance here.  If the file does not exist, it means
        // @PreDestroy method was never called.  The file is set to .deleteOnExit(), so no need to delete it.
        File file = new File("AddNumbersProtocolHandler.preDestroy.txt");
        assertTrue("File AddNumbersProtocolHandler.preDestroy.txt does not exist, meaning the @PreDestroy method was not called.", file.exists());

        String log = readLogFile();
        String expected_calls =
            "AddNumbersLogicalHandler2 POST_CONSTRUCT\n"
            + "AddNumbersProtocolHandler2 GET_HEADERS\n"
            + "AddNumbersProtocolHandler GET_HEADERS\n"
            + "AddNumbersProtocolHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler CLOSE\n"
            + "AddNumbersLogicalHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler CLOSE\n"
            + "AddNumbersProtocolHandler PRE_DESTROY\n";
       
        assertEquals(expected_calls, log);
       
        TestLogger.logger.debug("Expected Exception is " +
                                expectedException.getMessage());
       
        // The outbound service handler adds the stack trace to the
        // message.  Make sure the stack trace contains the AddNumbersHandlerPortTypeImpl
        assertTrue("A stack trace was not present in the returned exception's message:" +
                   expectedException.getMessage(),
                   expectedException.getMessage().indexOf("AddNumbersHandlerPortTypeImpl") > 0);

        TestLogger.logger.debug("----------------------------------");
       
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.addnumbershandler.AddNumbersHandlerFault_Exception

        AddNumbersHandlerService service = new AddNumbersHandlerService();
        AddNumbersHandlerPortType proxy = service.getAddNumbersHandlerPort();

        BindingProvider p = (BindingProvider)proxy;
        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
        AddNumbersHandlerFault_Exception expectedException = null;
        Throwable t = null;
        try {
            proxy.addNumbersHandler(Integer.MAX_VALUE, Integer.MAX_VALUE);
           
        } catch (Throwable e) {
            // An exception is expected
            t = e;
           
        }
       
        // Make sure the proper exception is thrown
        if (t == null) {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown");
        }
        if (t instanceof AddNumbersHandlerFault_Exception) {
            expectedException = (AddNumbersHandlerFault_Exception) t;
        } else {
            fail("Expected AddNumbersHandlerFault_Exception to be thrown, " +
                        "but the exception is: " + t);
        }
      
        // also confirm that @PreDestroy method is called.  Since it only makes sense to call it on the managed
        // (server) side and just before the handler instance goes out of scope, we are creating a file in the
        // @PreDestroy method, and will check for its existance here.  If the file does not exist, it means
        // @PreDestroy method was never called.  The file is set to .deleteOnExit(), so no need to delete it.
        File file = new File("AddNumbersProtocolHandler.preDestroy.txt");
        assertTrue("File AddNumbersProtocolHandler.preDestroy.txt does not exist, meaning the @PreDestroy method was not called.", file.exists());

        String log = readLogFile();
        String expected_calls =
            "AddNumbersLogicalHandler2 POST_CONSTRUCT\n"
            + "AddNumbersProtocolHandler2 GET_HEADERS\n"
            + "AddNumbersProtocolHandler GET_HEADERS\n"
            + "AddNumbersProtocolHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_MESSAGE_INBOUND\n"
            + "AddNumbersLogicalHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler2 HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersProtocolHandler HANDLE_FAULT_OUTBOUND\n"
            + "AddNumbersLogicalHandler CLOSE\n"
            + "AddNumbersLogicalHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler2 CLOSE\n"
            + "AddNumbersProtocolHandler CLOSE\n"
            + "AddNumbersProtocolHandler PRE_DESTROY\n";
       
        assertEquals(expected_calls, log);
       
        TestLogger.logger.debug("Expected Exception is " +
                                expectedException.getMessage());
       
        // The outbound service handler adds the stack trace to the
        // message.  Make sure the stack trace contains the AddNumbersHandlerPortTypeImpl
        assertTrue("A stack trace was not present in the returned exception's message:" +
                   expectedException.getMessage(),
                   expectedException.getMessage().indexOf("AddNumbersHandlerPortTypeImpl") > 0);

        TestLogger.logger.debug("----------------------------------");
       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.