Examples of EchoService


Examples of org.apache.commons.httpclient.EchoService

        UsernamePasswordCredentials creds =
            new UsernamePasswordCredentials("testuser", "testpass");
       
        HttpRequestHandlerChain handlerchain = new HttpRequestHandlerChain();
        handlerchain.appendHandler(new AuthRequestHandler(creds));
        handlerchain.appendHandler(new HttpServiceHandler(new EchoService()));

        HttpState state = new HttpState();
        AuthScope authscope = new AuthScope(
            this.server.getLocalAddress(),
            this.server.getLocalPort(),
View Full Code Here

Examples of org.apache.commons.httpclient.EchoService

        UsernamePasswordCredentials creds =
            new UsernamePasswordCredentials("testuser", "testpass");
       
        HttpRequestHandlerChain handlerchain = new HttpRequestHandlerChain();
        handlerchain.appendHandler(new AuthRequestHandler(creds));
        handlerchain.appendHandler(new HttpServiceHandler(new EchoService()));

        HttpState state = new HttpState();
        AuthScope authscope = new AuthScope(
            this.server.getLocalAddress(),
            this.server.getLocalPort(),
View Full Code Here

Examples of org.apache.deltaspike.example.echo.EchoService

            LOG.info(echoService.echo("Hello non dependent CDI scoped bean!"));
        }

        LOG.info("---");

        EchoService defaultEchoService = BeanProvider.getContextualReference(DefaultEchoService.class, false);

        LOG.info(defaultEchoService.echo("Hello explicitly resolved CDI bean!"));

        defaultEchoService = BeanProvider.getContextualReference("defaultEchoService", false, EchoService.class);

        LOG.info(defaultEchoService.echo("Hello CDI bean resolved by name!"));

        OptionalService optionalService = BeanProvider.getContextualReference(OptionalService.class, true);

        if (optionalService == null)
        {
View Full Code Here

Examples of org.exolab.jms.net.EchoService

        BasicPrincipal principal = new BasicPrincipal("user", "password");
        Authenticator authenticator = new TestAuthenticator(principal);
        ORB orb = createORB(authenticator);

        // set up the echo service
        EchoService service = new EchoServiceImpl();
        _service = orb.exportObject(service);
        assertTrue(_service instanceof EchoService);
        orb.getRegistry().bind(ECHO_SERVICE, _service);

        // make sure a valid user can perform a lookup
View Full Code Here

Examples of org.exolab.jms.net.EchoService

     */
    protected void setUp() throws Exception {
        super.setUp();
        // export the service
        ORB orb = getORB();
        EchoService service = new EchoServiceImpl();
        _service = orb.exportObject(service);
        assertTrue(_service instanceof EchoService);

        // make sure registry is available
        orb.getRegistry();
View Full Code Here

Examples of org.exolab.jms.net.EchoService

     *
     * @throws Exception for any error
     */
    public void testPrimitives() throws Exception {
        Registry registry = _orb.getRegistry(getConnectionProperties());
        EchoService echo = (EchoService) registry.lookup(ECHO_SERVICE);

        assertEquals(true, echo.echoBoolean(true));
        assertEquals(false, echo.echoBoolean(false));

        assertEquals(Byte.MIN_VALUE, echo.echoByte(Byte.MIN_VALUE));
        assertEquals(Byte.MAX_VALUE, echo.echoByte(Byte.MAX_VALUE));

        assertEquals(Character.MIN_VALUE, echo.echoChar(Character.MIN_VALUE));
        assertEquals(Character.MAX_VALUE, echo.echoChar(Character.MAX_VALUE));

        assertEquals(Short.MIN_VALUE, echo.echoShort(Short.MIN_VALUE));
        assertEquals(Short.MAX_VALUE, echo.echoShort(Short.MAX_VALUE));

        assertEquals(Integer.MIN_VALUE, echo.echoInt(Integer.MIN_VALUE));
        assertEquals(Integer.MAX_VALUE, echo.echoInt(Integer.MAX_VALUE));

        assertEquals(Long.MIN_VALUE, echo.echoLong(Long.MIN_VALUE));
        assertEquals(Long.MAX_VALUE, echo.echoLong(Long.MAX_VALUE));

        assertEquals(Float.MIN_VALUE, echo.echoFloat(Float.MIN_VALUE), 0.0f);
        assertEquals(Float.MAX_VALUE, echo.echoFloat(Float.MAX_VALUE), 0.0f);

        assertEquals(Double.MIN_VALUE, echo.echoDouble(Double.MIN_VALUE), 0.0);
        assertEquals(Double.MAX_VALUE, echo.echoDouble(Double.MAX_VALUE), 0.0);
    }
View Full Code Here

Examples of org.exolab.jms.net.EchoService

     */
    public void testPrimitiveArrays() throws Exception {
        final int size = 4096;

        Registry registry = _orb.getRegistry(getConnectionProperties());
        EchoService echo = (EchoService) registry.lookup(ECHO_SERVICE);

        // byte arrays
        byte[] bytes = new byte[size];
        for (int i = 0; i < bytes.length; ++i) {
            bytes[i] = (byte) i;
        }
        byte[] bytesResult = (byte[]) echo.echoObject(bytes);
        assertTrue(Arrays.equals(bytes, bytesResult));

        // int arrays
        int[] ints = new int[size];
        for (int i = 0; i < ints.length; ++i) {
            ints[i] = (int) i;
        }
        int[] intsResult = (int[]) echo.echoObject(ints);
        assertTrue(Arrays.equals(ints, intsResult));

        // float arrays
        float[] floats = new float[size];
        for (int i = 0; i < floats.length; ++i) {
            floats[i] = i;
        }
        float[] floatsResult = (float[]) echo.echoObject(floats);
        assertTrue(Arrays.equals(floats, floatsResult));
    }
View Full Code Here

Examples of org.exolab.jms.net.EchoService

     */
    public void testConcurrency() throws Exception {
        Thread[] threads = new Thread[10];

        Registry registry = _orb.getRegistry(getConnectionProperties());
        EchoService echo = (EchoService) registry.lookup(ECHO_SERVICE);

        for (int i = 0; i < threads.length; ++i) {
            threads[i] = new Thread(new IntInvoker(echo, i, 1000));
        }

View Full Code Here

Examples of org.exolab.jms.net.EchoService

        EchoServiceImpl impl = new EchoServiceImpl();
        Proxy proxy = orb.exportObject(impl);
        orb.getRegistry().bind("service", proxy);

        Registry registry = getRegistry(principal);
        EchoService service = (EchoService) registry.lookup("service");

        assertTrue(service.echoBoolean(true));

        checkUnexportObject(orb, impl, service);
    }
View Full Code Here

Examples of org.exolab.jms.net.EchoService

        EchoServiceImpl impl = new EchoServiceImpl();
        Proxy proxy = orb.exportObject(impl, getExportURI());
        orb.getRegistry().bind("service", proxy);

        Registry registry = getRegistry(principal);
        EchoService service = (EchoService) registry.lookup("service");

        assertTrue(service.echoBoolean(true));

        checkUnexportObject(orb, impl, service);
    }
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.