Examples of BasicServer


Examples of org.jacorb.test.BasicServer

    public void test_reconnect_restarted_server() throws Exception
    {
        org.omg.CORBA.Object obj1 = clientORBTestCase.getORB ().string_to_object(setup.getServerIOR());
        org.omg.CORBA.Object obj2 = clientORBTestCase.getORB ().string_to_object(setup.getServerIOR());

        BasicServer server1 = BasicServerHelper.narrow (obj1);
        BasicServer server2 = BasicServerHelper.narrow (obj2);
        server1.bounce_long(1);
        server2.ping();

        setup.tearDown ();

        try
        {
          server2._non_existent();
        }
        catch (SystemException e)
        {
        }
        setup = new ClientServerSetup(
                "org.jacorb.test.bugs.bugjac330.CustomBasicServerImpl",
                null, serverProps);

        assertTrue (server2._non_existent());
    }
View Full Code Here

Examples of org.jacorb.test.BasicServer

        BasicServerImpl servant = new BasicServerImpl();

        rootPOA.activate_object(servant);

        BasicServer server = BasicServerHelper.narrow(rootPOA.servant_to_reference(servant));

        assertEquals(42, server.bounce_long(42));

        rootPOA.deactivate_object(rootPOA.servant_to_id(servant));

        Thread.sleep(1000);

        try
        {
            server.bounce_long(43);
            fail();
        }
        catch (OBJECT_NOT_EXIST e)
        {
            // expected
View Full Code Here

Examples of org.jacorb.test.BasicServer

        org.omg.CORBA.Object ref = poa.create_reference_with_id(
                "some_oid".getBytes(),
                BasicServerHelper.id());

        BasicServer bs = BasicServerHelper.narrow(ref);

        try
        {
            bs.bounce_string("test-string");
            fail();
        }
        catch (OBJECT_NOT_EXIST ex)
        {
        }
View Full Code Here

Examples of org.jacorb.test.BasicServer

        Properties props = new Properties();
        props.setProperty("ORBInitRef.MyServer", ior);

        ORB orb = setup.getAnotherORB(props);

        BasicServer server = BasicServerHelper.narrow(orb.string_to_object("corbaloc:rir:/MyServer"));
        assertTrue(new HashSet<String>(Arrays.asList(orb.list_initial_services())).contains("MyServer"));

        long now = System.currentTimeMillis();
        assertEquals(now, server.bounce_long_long(now));
    }
View Full Code Here

Examples of org.jacorb.test.BasicServer

    {
        int before = ClientIIOPConnection.openTransports;

        org.omg.CORBA.ORB orb = this.getAnotherORB(props);

        BasicServer server = BasicServerHelper.narrow(orb.string_to_object (ior));

        long now = System.currentTimeMillis();

        assertEquals(now, server.bounce_long_long(now));
        assertTrue(BugJac524TCPConnectionListener.open.isEmpty());
        assertEquals(before + 1, ClientIIOPConnection.openTransports);

        server._release();
        orb.shutdown(true);
    }
View Full Code Here

Examples of org.jacorb.test.BasicServer

        BasicServerImpl servant = new BasicServerImpl();

        rootPOA.activate_object(servant);

        BasicServer server = BasicServerHelper.narrow(rootPOA.servant_to_reference(servant));

        assertEquals(42, server.bounce_long(42));

        rootPOA.deactivate_object(rootPOA.servant_to_id(servant));

        try
        {
            boolean result = server._non_existent();

            assertTrue (result == true);
        }
        catch (OBJECT_NOT_EXIST e)
        {
View Full Code Here

Examples of org.jacorb.test.BasicServer

        BasicServerImpl servant = new BasicServerImpl();

        rootPOA.activate_object(servant);

        BasicServer server = BasicServerHelper.narrow(rootPOA.servant_to_reference(servant));

        System.out.println ("SERVER IOR: " + orb.object_to_string(server));
        System.out.flush();

        orb.run();
View Full Code Here

Examples of org.jacorb.test.BasicServer

        BasicServerImpl servant = new BasicServerImpl();

        rootPOA.activate_object(servant);

        BasicServer server = BasicServerHelper.narrow(rootPOA.servant_to_reference(servant));

        assertEquals(42, server.bounce_long(42));

        rootPOA.deactivate_object(rootPOA.servant_to_id(servant));

        assertFileExists (getLogFilename("jacorb.log"));
        try
        {
            server.bounce_boolean(true);
        }
        catch (OBJECT_NOT_EXIST e)
        {
            StringWriter stringWriter = new StringWriter();
            PrintWriter printWriter = new PrintWriter(stringWriter);
            e.printStackTrace(printWriter);

            assertTrue ( stringWriter.toString().contains("servant_preinvoke"));
        }

        boolean result = server._non_existent();
        assertTrue (result == true);

        assertFileNotContains (getLogFilename("jacorb.log"), ".*OBJECT_NOT_EXIST.*");
    }
View Full Code Here

Examples of org.jacorb.test.BasicServer

    }

    @Test
    public void testAccessTwoServersAtOnceShouldFail() 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();
        }
        catch (NO_RESOURCES e)
        {
            // expected
View Full Code Here

Examples of org.jacorb.test.BasicServer

    }

    @Test
    public void testAccessTwoServersOneByOne() throws Exception
    {
        BasicServer server1 = BasicServerHelper.narrow(orb.string_to_object(server1IOR));
        assertEquals(10, server1.bounce_long(10));
        server1._release();

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

        BasicServer server2 = BasicServerHelper.narrow(orb.string_to_object(server2IOR));
        assertEquals(10, server2.bounce_long(10));
        server2._release();
    }
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.