Package org.apache.openejb.server.cxf.fault

Examples of org.apache.openejb.server.cxf.fault.AuthenticatorService


    }
    //END SNIPPET: setup

    public void test00_runCheckedException() {
        try {
            AuthenticatorService withHandler = Service.create(
                new URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBean?wsdl"),
                new QName("http://superbiz.org/wsdl", "AuthenticatorServiceBeanService"))
                .getPort(AuthenticatorService.class);
            assertNotNull(withHandler);

            AuthenticatorService noHandler = Service.create(
                new URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBeanNoHandler?wsdl"),
                new QName("http://superbiz.org/wsdl", "AuthenticatorServiceBeanNoHandlerService"))
                .getPort(AuthenticatorService.class);
            assertNotNull(noHandler);

            try {
                withHandler.authenticate("John", "Doe");
            } catch (WrongPasswordException e) {
                System.out.println("My lovely checked exception...");
            } catch (Throwable e) {
                e.printStackTrace();
                fail("A throwable instead of a checked exception...");
            }

            try {
                noHandler.authenticate("John", "Doe");
            } catch (WrongPasswordException e) {
                System.out.println("My lovely checked exception...");
            } catch (Throwable e) {
                e.printStackTrace();
                fail("A throwable instead of a checked exception...");
View Full Code Here


    }

    public void test01_runRuntimeException() {
        try {
            AuthenticatorService withHandler = Service.create(
                new URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBean?wsdl"),
                new QName("http://superbiz.org/wsdl", "AuthenticatorServiceBeanService"))
                .getPort(AuthenticatorService.class);
            assertNotNull(withHandler);

            AuthenticatorService noHandler = Service.create(
                new URL("http://localhost:4204/openejb-cxf/AuthenticatorServiceBeanNoHandler?wsdl"),
                new QName("http://superbiz.org/wsdl", "AuthenticatorServiceBeanNoHandlerService"))
                .getPort(AuthenticatorService.class);
            assertNotNull(noHandler);

            try {
                withHandler.authenticateRuntime("John", "Doe");
            } catch (WrongPasswordRuntimeException e) {
                e.printStackTrace();
                fail("My checked exception instead of a throwableS...");
            } catch (Throwable e) {
                System.out.println("A throwable exception...");
            }


            try {
                noHandler.authenticateRuntime("John", "Doe");
            } catch (WrongPasswordRuntimeException e) {
                e.printStackTrace();
                fail("My checked exception instead of a throwableS...");
            } catch (Throwable e) {
                System.out.println("A throwable exception...");
View Full Code Here

TOP

Related Classes of org.apache.openejb.server.cxf.fault.AuthenticatorService

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.