Esempio n. 1
0
        public void DoHessianMethodCallTest()
        {
            CHessianProxyFactory hessianProxyFactory = null;                                  // TODO: Initialize to an appropriate value
            Uri uri = null;                                                                   // TODO: Initialize to an appropriate value
            CHessianMethodCaller target = new CHessianMethodCaller(hessianProxyFactory, uri); // TODO: Initialize to an appropriate value

            object[]   arrMethodArgs = null;                                                  // TODO: Initialize to an appropriate value
            MethodInfo methodInfo    = null;                                                  // TODO: Initialize to an appropriate value
            object     expected      = null;                                                  // TODO: Initialize to an appropriate value
            object     actual;

            actual = target.DoHessianMethodCall(arrMethodArgs, methodInfo);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Esempio n. 2
0
        public static void TestHessainCompact()
        {
            CHessianProxyFactory factory = new CHessianProxyFactory();
            //String url = "http://192.168.0.1:9090/resin-doc/protocols/tutorial/hessian-add/hessian/hessianDotNetTest";
            String url = "http://192.168.1.11:9090/resin-doc/protocols/csharphessian/hessian/hessianDotNetTest";
            CHessianMethodCaller methodCaller = new CHessianMethodCaller(factory, new Uri(url));

            try
            {
                MethodInfo mInfo_1 = typeof(IHessianTest).GetMethod("testConcatString");
                object     result  = methodCaller.DoHessianMethodCall(new object[] { "Hallo ", "Welt" }, mInfo_1);
                Console.WriteLine("Return value of method \"testConcatString\":");
                Console.WriteLine(result);
                MethodInfo            mInfo_2    = typeof(IHessianTest).GetMethod("testHashMap");
                string []             keys       = new string[] { "Bauarbeiter", "Jo!" };
                string []             values     = new string[] { "Koennen wir das schaffen?", "Wir schaffen das!" };
                Hashtable             hashResult = (Hashtable)methodCaller.DoHessianMethodCall(new object[] { keys, values }, mInfo_2);
                IDictionaryEnumerator dict       = hashResult.GetEnumerator();
                Console.WriteLine("Return value of method \"testHashMap\":");
                while (dict.MoveNext())
                {
                    Console.WriteLine(dict.Key.ToString() + " " + dict.Value.ToString());
                }
                ParamObject pobject = (ParamObject)Activator.CreateInstance(typeof(ParamObject));
                pobject.setStringVar("Bauarbeiter, koennen wir das schaffen?");
                Hashtable hashTab = new Hashtable();
                hashTab.Add("Jo", " Wir schaffen das!");
                MethodInfo  mInfo_3    = typeof(IHessianTest).GetMethod("testParamObject");
                ParamObject pObjResult = (ParamObject)methodCaller.DoHessianMethodCall(new object[] { pobject }, mInfo_3);
                Console.WriteLine("Return value of method \"testParamObject\":");
                Console.WriteLine(pObjResult.getStringVar());
                Console.WriteLine(pObjResult.getHashVar()["Message"].ToString());
            } catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadLine();
        }