Package org.jacorb.test

Examples of org.jacorb.test.BasicServer


    }

    @Test
    public void testAccessTwoServersAtOnceReleaseTryAgain() throws Exception
    {
        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


    }

    @Test
    public void testNoIdleThreads() throws Exception
    {
        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


    @Test
    public void testDisconnectAfterSystemException() throws Exception
    {
        BasicServer server1 = BasicServerHelper.narrow(orb.string_to_object(server1IOR));
        server1.ping();
        Thread.sleep(10000);

        final String threadName = "ClientMessageReceptor";

        dumpThread(threadName);

        assertFalse(isThereAThreadNamed(threadName));

        server1._release();
    }
View Full Code Here

    }


    public void testDisconnectAfterSystemExceptionNoTimeout() throws Exception
    {
        BasicServer server1 = BasicServerHelper.narrow(orb.string_to_object(server1IOR));
        try
        {
            server1.pass_in_long(0);
        }
        catch (Throwable e)
        {
            Field fconnmgr = Delegate.class.getDeclaredField("conn_mg");
            fconnmgr.setAccessible(true);
View Full Code Here

    }

    @Test
    public void testConnectClient() throws Exception
    {
        final BasicServer server = BasicServerHelper.narrow(setup.getServerObject());
        final Exception[] exception = new Exception[1];
        final boolean[] success = new boolean[1];
        final int timeout = 60000;

        Runnable pingCommand = new Runnable()
        {
            public void run()
            {
                try
                {
                    server.ping();
                    success[0] = true;
                }
                catch (Exception e)
                {
                    exception[0] = e;
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

    }

    private void runTest(String corbaLoc)
    {
        org.omg.CORBA.Object object = setup.getClientOrb().string_to_object(corbaLoc);
        BasicServer server = BasicServerHelper.narrow(object);
        assertEquals("BugJac486Test", server.bounce_string("BugJac486Test"));
    }
View Full Code Here

    @Test
    public void test_reconnect_restarted_server() throws Exception
    {
        org.omg.CORBA.Object obj = clientORBTestCase.getORB ().string_to_object
            ("corbaloc:iiop:localhost:54321/MyImpl/MyPOA/MyObject");
        BasicServer server = BasicServerHelper.narrow (obj);
        server.ping();

        // Server should now exit (CustomBasicImpl has a wait of 5000).
        setup.tearDown ();

        setup = new ClientServerSetup(
                                   "org.jacorb.test.bugs.bugjac330.CustomBasicServerImpl",
                                   null, serverProps);

        server.bounce_long (10);
    }
View Full Code Here

    @Test
    public void testPingWithTwoConnections() throws Exception
    {
        server.ping();

        final BasicServer server2 = BasicServerHelper.narrow(setup.getAnotherORB(null).string_to_object(setup.getServerIOR()));
        final boolean[] sucess = new boolean[1];
        final Exception[] exception = new Exception[1];

        Thread thread = new Thread()
        {
            @Override
            public void run()
            {
                try
                {
                    server2.ping();
                    sucess[0] = true;
                }
                catch (Exception e)
                {
                    exception[0] = e;
View Full Code Here

    protected abstract String getGIOPMinorVersionString();

    @Test
    public void testServerWorks() throws Exception
    {
        BasicServer server = BasicServerHelper.narrow(rootPOA.servant_to_reference(new BasicServerImpl()));

        long now = System.currentTimeMillis();

        assertEquals(now, server.bounce_long_long(now));
    }
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.