示例#1
0
        void runCallbackArgTest2(int callbackArgChange)
        {
            if (callbackArgChange == 1)
            {
                //change now custom type
                m_callbackarg = new Portfolio(1, 1);
                m_client1.Call(SetCallbackArg);
                m_client2.Call(SetCallbackArg);
            }

            m_callbackListener = new CallbackListener();
            m_callbackListener.SetCallbackArg(m_callbackarg);
            CacheHelper.SetupJavaServers(true, "cacheserver_notify_subscription5N.xml");
            CacheHelper.StartJavaLocator(1, "GFELOC");
            Util.Log("Locator started");
            CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
            Util.Log("Cacheserver 1 started.");

            Util.Log("Creating region in client1, no-ack, cache-enabled, with listener and writer");
            m_client1.Call(CreateRegion2, CacheHelper.Locators,
                           true, true, false);
            m_client1.Call(RegisterAllKeys, new string[] { RegionName });

            Util.Log("Creating region in client2 , no-ack, cache-enabled, with listener and writer");
            m_client2.Call(CreateRegion2, CacheHelper.Locators,
                           true, false, false);

            m_client2.Call(TestCreatesAndUpdates);
            m_client1.Call(TestInvalidates);
            m_client2.Call(TestDestroy);
            m_client2.Call(TestCreatesAndUpdates);
            m_client1.Call(TestlocalClear);
            m_client2.Call(TestRemove);
            m_client1.Call(TestValidate);

            m_client1.Call(CacheHelper.Close);
            m_client2.Call(CacheHelper.Close);

            CacheHelper.StopJavaServer(1);
            Util.Log("Cacheserver 1 stopped.");

            CacheHelper.StopJavaLocator(1);
            Util.Log("Locator stopped");

            CacheHelper.ClearLocators();
            CacheHelper.ClearEndpoints();
        }
示例#2
0
        public void CreateRegion2(string locators,
                                  bool caching, bool listener, bool writer)
        {
            CallbackListener callbackLis = null;

            if (listener)
            {
                m_callbackListener = new CallbackListener();
                m_callbackListener.SetCallbackArg(m_callbackarg);
                callbackLis = m_callbackListener;
            }
            else
            {
                m_listener = null;
            }
            GIRegion region = null;

            region = CacheHelper.CreateTCRegion_Pool <int, object>(RegionName, true, caching,
                                                                   callbackLis, locators, "__TESTPOOL1_", true);
        }
示例#3
0
        void runPutAllCallbackArgTest()
        {
            m_callbackListener = new CallbackListener();
            m_callbackListener.SetCallbackArg(m_callbackarg);

            CacheHelper.SetupJavaServers(true, "cacheserver_notify_subscription5N.xml");
            CacheHelper.StartJavaLocator(1, "GFELOC");
            Util.Log("Locator started");
            CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
            Util.Log("Cacheserver 1 started.");

            Util.Log("Creating region in client1, no-ack, cache-enabled, with listener and writer");
            m_client1.Call(CreateRegion2, CacheHelper.Locators,
                           true, true, false);
            m_client1.Call(RegisterAllKeys, new string[] { RegionName });
            Util.Log("RegisterAllKeys completed..");

            Util.Log("Creating region in client2 , no-ack, cache-enabled, with listener and writer");
            m_client2.Call(CreateRegion2, CacheHelper.Locators,
                           true, false, false);
            Util.Log("CreateRegion2 completed..");

            m_client2.Call(TestPutAll);
            Util.Log("TestPutAll completed..");
            m_client1.Call(TestValidatePutAllCallback);
            Util.Log("TestValidatePutAllCallback completed..");
            m_client2.Call(TestGetAll);
            Util.Log("TestGetAll completed..");

            m_client1.Call(CacheHelper.Close);
            m_client2.Call(CacheHelper.Close);

            CacheHelper.StopJavaServer(1);
            Util.Log("Cacheserver 1 stopped.");

            CacheHelper.StopJavaLocator(1);
            Util.Log("Locator stopped");

            CacheHelper.ClearLocators();
            CacheHelper.ClearEndpoints();
        }
示例#4
0
        public void CreateRegion2(string locators,
                                  bool caching, bool listener, bool writer)
        {
            CallbackListener callbackLis = null;

            if (listener)
            {
                m_callbackListener = new CallbackListener();
                m_callbackListener.SetCallbackArg(m_callbackarg);
                callbackLis = m_callbackListener;
            }
            else
            {
                m_listener = null;
            }
            GIRegion region = null;

            region = CacheHelper.CreateTCRegion_Pool <int, object>(RegionName, true, caching,
                                                                   callbackLis, locators, "__TESTPOOL1_", true);
            CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Portfolio.CreateDeserializable);
            CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Position.CreateDeserializable);
        }