Example #1
0
        public void SetupEnvironment() {
            // register the channel
            IDictionary properties = new Hashtable();
            properties[IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY] = false;
            m_channel = new IiopClientChannel(properties);
            ChannelServices.RegisterChannel(m_channel, false);

            // get the reference to the test-service
            m_testService = (TestService)RemotingServices.Connect(typeof(TestService), "corbaloc:iiop:1.2@localhost:8087/test");
            m_testExService = (TestExceptionService)RemotingServices.Connect(typeof(TestExceptionService), "corbaloc:iiop:1.2@localhost:8087/testExService");

            m_svcSingleCall = 
                (ISimpleTestInterface)RemotingServices.Connect(typeof(ISimpleTestInterface), "corbaloc:iiop:1.2@localhost:8087/testSingleCall");
            m_svcSingletonCall = 
                (ISimpleTestInterface)RemotingServices.Connect(typeof(ISimpleTestInterface), "corbaloc:iiop:1.2@localhost:8087/testSingletonCall");
            m_contextBound = 
                (ISimpleTestInterface)RemotingServices.Connect(typeof(ISimpleTestInterface), "corbaloc:iiop:1.2@localhost:8087/testContextBound");
            m_testBoxedService = (TestBoxedValuetypeService)RemotingServices.Connect(typeof(TestBoxedValuetypeService), "corbaloc:iiop:1.2@localhost:8087/testBoxedService");
        }
Example #2
0
        private void CheckWellKnownService(ISimpleTestInterface svcToCheck, bool stateShouldBeKept) {
            Int32 arg1 = 1;
            Int32 arg2 = 2;
            Assertion.AssertEquals(arg1 + arg2, svcToCheck.Add(arg1, arg2));

            Int32 stateSet = 8;
            Int32 stateSet2 = 10;
            svcToCheck.TestValue = stateSet;
            if (stateShouldBeKept) {
                Assertion.AssertEquals("set 1 failed", stateSet, svcToCheck.TestValue);
                svcToCheck.TestValue = stateSet2;
                Assertion.AssertEquals("set 2 failed", stateSet2, svcToCheck.TestValue);
            } else {
                Assertion.AssertEquals("set 1 failed", svcToCheck.InitialValue, svcToCheck.TestValue);
                svcToCheck.TestValue = stateSet2;
                Assertion.AssertEquals("set 2 failed", svcToCheck.InitialValue, svcToCheck.TestValue);
            }
        }