Package org.jacorb.test

Examples of org.jacorb.test.BasicServer


        props.put("jacorb.connection.client.max_receptor_threads", "1");

        ORB orb = newORB(props);

        BasicServer server1 = BasicServerHelper.narrow(orb.string_to_object(server1IOR));
        assertEquals(10, server1.bounce_long(10));

        BasicServer server2 = BasicServerHelper.narrow(orb.string_to_object(server2IOR));

        try
        {
            server2.bounce_long(10);
            fail("should fail as there may not be more than 1 ClientReceptorThreads");
        }
        catch (NO_RESOURCES e)
        {
            // expected
        }

        server1._release();

        // give the ConsumerReceptorThread some time to finish its work
        Thread.sleep(1000);

        // retry bind
        assertEquals(10, server2.bounce_long(10));
    }
View Full Code Here


        props.put("jacorb.connection.client.max_receptor_threads", "1");
        props.put("jacorb.connection.client.max_idle_receptor_threads", "0");

        ORB orb = newORB(props);

        BasicServer server1 = BasicServerHelper.narrow(orb.string_to_object(server1IOR));
        assertEquals(10, server1.bounce_long(10));

        final String threadName = "ClientMessageReceptor";
        assertTrue(isThereAThreadNamed(threadName));

        server1._release();

        int retry = 0;
        final int maxRetry = 30;

        while( (retry++ < maxRetry) && isThereAThreadNamed(threadName))
View Full Code Here

        props.put("jacorb.connection.client.max_idle_receptor_threads", "0");
        props.put("jacorb.connection.client.eager_close", "true");

        ORB orb = newORB(props);

        BasicServer server1 = BasicServerHelper.narrow(orb.string_to_object(server1IOR));
        server1.ping();
        System.err.println ("### Waiting for server shutdown");
        Thread.sleep(10000);

        final String threadName = "ClientMessageReceptor";

        dumpThread(threadName);

        assertFalse(isThereAThreadNamed(threadName));

        server1._release();
    }
View Full Code Here

        // need to go via a string here to ensure that a delegate is
        // created that has the poa NOT set. this is to ensure
        // that the call between outerServer and innerServer executes
        // the Delegate.resolvePOA code.
        String innerIOR = orb.object_to_string(innerServer);
        BasicServer newDelegate = BasicServerHelper.narrow(orb.string_to_object(innerIOR));
        outerServer = BasicServerHelper.narrow(rootPOA.servant_to_reference(new BasicServerPOATie(newDelegate)));
    }
View Full Code Here

    public void testAccessIFR() throws Exception
    {
        // we're registering a BasicServer in the client ORB/POA here. the client ORB is properly configured
        // so that it knows how to contact the running IR.
        BasicServer server = BasicServerHelper.narrow(getClientRootPOA().servant_to_reference(new BasicServerImpl()));

        InterfaceDef interfaceDef = InterfaceDefHelper.narrow(server._get_interface_def());

        assertNotNull(interfaceDef);
    }
View Full Code Here

        POA system = rootPOA.create_POA("system_id_deactivate_2", rootPOA.the_POAManager(), policies);
        system.the_POAManager().activate();
        system.set_servant_manager(new PoaServantActivator());

        org.omg.CORBA.Object objectRef = system.create_reference(BasicServerHelper.id());
        BasicServer ref = BasicServerHelper.narrow(objectRef);
        // Local op; will incarnate the object.
        ref.ping();

        // Now try deactivating it.
        system.deactivate_object (system.reference_to_id(ref));
    }
View Full Code Here

    private ORB clientORB;

    public void doSetUp() throws Exception
    {
        BasicServerImpl servant = new BasicServerImpl();
        BasicServer tmpServer = BasicServerHelper.narrow(rootPOA.servant_to_reference(servant));

        clientORB = ORB.init(new String[0], null);

        server = BasicServerHelper.narrow(clientORB.string_to_object(orb.object_to_string(tmpServer)));
    }
View Full Code Here

    }

    public void testInvokeSafeOperationAfterShutdown() throws Exception
    {
        clientORB.shutdown(true);
        BasicServer server2 = BasicServerHelper.narrow(server._duplicate());
        server2._release();
    }
View Full Code Here

    @Test
    public void testAccessIFR() throws Exception
    {
        // we're registering a BasicServer in the client ORB/POA here. the client ORB is properly configured
        // so that it knows how to contact the running IR.
        BasicServer server = BasicServerHelper.narrow(setup.clientServerSetup.getClientRootPOA().servant_to_reference(new BasicServerImpl()));

        InterfaceDef interfaceDef = InterfaceDefHelper.narrow(server._get_interface_def());

        assertNotNull(interfaceDef);
    }
View Full Code Here

        POA system = rootPOA.create_POA("system_id_deactivate_2", rootPOA.the_POAManager(), policies);
        system.the_POAManager().activate();
        system.set_servant_manager(new PoaServantActivator());

        org.omg.CORBA.Object objectRef = system.create_reference(BasicServerHelper.id());
        BasicServer ref = BasicServerHelper.narrow(objectRef);
        // Local op; will incarnate the object.
        ref.ping();

        // Now try deactivating it.
        system.deactivate_object (system.reference_to_id(ref));
    }
View Full Code Here

TOP

Related Classes of org.jacorb.test.BasicServer

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.