Examples of AuthenticatorService


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

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

    }

    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

Examples of org.modeshape.jboss.service.AuthenticatorService

            } else {
                props.put(key, node.asString());
            }
        }

        AuthenticatorService authenticatorService = new AuthenticatorService(repositoryName, props);

        ServiceName serviceName = ModeShapeServiceNames.authenticatorServiceName(repositoryName, authenticatorName);
        ServiceBuilder<JcrRepository> authenticatorBuilder = target.addService(serviceName, authenticatorService);
        authenticatorBuilder.addDependency(ModeShapeServiceNames.ENGINE,
                                           ModeShapeEngine.class,
                                           authenticatorService.getModeShapeEngineInjector());
        authenticatorBuilder.addDependency(ModeShapeServiceNames.repositoryServiceName(repositoryName),
                                           JcrRepository.class,
                                           authenticatorService.getJcrRepositoryInjector());
        authenticatorBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
        ServiceController<JcrRepository> controller = authenticatorBuilder.install();
        newControllers.add(controller);
    }
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.