Ejemplo n.º 1
0
        public void TestJmxConnectionInformation()
        {
            IConfigurableCacheFactory ccf = CacheFactory.ConfigurableCacheFactory;
            IXmlDocument config           = XmlHelper.LoadXml("assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config.xml");

            ccf.Config = config;
            IInvocationService service = (IInvocationService)CacheFactory.GetService("RemoteInvocationService");
            IMember            member  = ((DefaultConfigurableCacheFactory)ccf).OperationalContext.LocalMember;

            MBeanInvocable invocable = new MBeanInvocable();

            IDictionary result = service.Query(invocable, null);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, 1);

            Assert.IsNotNull(result[member]);

            service.Shutdown();
        }
Ejemplo n.º 2
0
        public void TestMemberRemoteInvocation()
        {
            IConfigurableCacheFactory ccf = CacheFactory.ConfigurableCacheFactory;
            IXmlDocument config           = XmlHelper.LoadXml("assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config.xml");

            ccf.Config = config;
            IInvocationService service = (IInvocationService)CacheFactory.GetService("RemoteInvocationService");

            IMember member = new LocalMember();

            member.MachineName = "machine1";
            member.MemberName  = "member1";
            member.ProcessName = "process1";
            member.RackName    = "rack1";
            member.RoleName    = "role1";
            member.SiteName    = "site1";

            POFObjectInvocable invocable = new POFObjectInvocable();

            invocable.PofObject = member;

            IDictionary result = service.Query(invocable, null);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, 1);
            IMember copy = (IMember)result[((DefaultConfigurableCacheFactory)CacheFactory
                                            .ConfigurableCacheFactory).OperationalContext.LocalMember];

            Assert.AreEqual(member.MachineName, copy.MachineName);
            Assert.AreEqual(member.MemberName, copy.MemberName);
            Assert.AreEqual(member.ProcessName, copy.ProcessName);
            Assert.AreEqual(member.RackName, copy.RackName);
            Assert.AreEqual(member.RoleName, copy.RoleName);
            Assert.AreEqual(member.SiteName, copy.SiteName);

            service.Shutdown();
        }
Ejemplo n.º 3
0
        public void TestCompositeKeyRemoteInvocation()
        {
            IConfigurableCacheFactory ccf = CacheFactory.ConfigurableCacheFactory;
            IXmlDocument config           = XmlHelper.LoadXml("assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config.xml");

            ccf.Config = config;
            IInvocationService service = (IInvocationService)CacheFactory.GetService("RemoteInvocationService");

            CompositeKey       key       = new CompositeKey("abc", "xyz");
            POFObjectInvocable invocable = new POFObjectInvocable();

            invocable.PofObject = key;

            IDictionary result = service.Query(invocable, null);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, 1);
            CompositeKey copy = (CompositeKey)result[((DefaultConfigurableCacheFactory)
                                                      CacheFactory.ConfigurableCacheFactory).OperationalContext.LocalMember];

            Assert.AreEqual(key, copy);

            service.Shutdown();
        }