Esempio n. 1
0
        //----< message creator >----------------------------------------

        /*
         * - creating MessageBody class for each message body type.
         * - using serializer, as demoed in TestDeserializer, to generate the
         *   body XML.
         * - On the other end deserialize, using the MessageBody type.
         */
        public string makeTestRequest()
        {
            TestElement te1 = new TestElement("test1");

            te1.addDriver("td1.dll");
            te1.addCode("t1.dll");
            te1.addCode("t2.dll");
            TestElement te2 = new TestElement("test2");

            te2.addDriver("td2.dll");
            te2.addCode("tc3.dll");
            te2.addCode("tc4.dll");
            TestRequest tr = new TestRequest();

            tr.author = "Jim Fawcett";
            tr.tests.Add(te1);
            tr.tests.Add(te2);
            return(tr.ToXml());
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Message msg = new Message();

            msg.to     = "http://localhost:8080/ICommunicator";
            msg.from   = "http://localhost:8081/ICommunicator";
            msg.author = "Manjunath";

            testElement te1 = new testElement("test1");
            testElement te2 = new testElement("test2");
            testElement te3 = new testElement("test3");
            testElement tlg = new testElement("loggerTest");

            te2.addDriver("td1.dll");
            te2.addCode("tc1.dll");
            te1.addDriver("testdriver.dll");
            te1.addCode("testedcode.dll");
            te3.addDriver("anothertestdriver.dll");
            te3.addCode("anothertestedcode.dll");
            tlg.addDriver("logger.dll");
            testRequest tr = new testRequest();

            tr.author = "Manjunath";
            tr.tests.Add(te1);
            tr.tests.Add(te2);
            tr.tests.Add(te3);
            tr.tests.Add(tlg);
            msg.body = tr.ToString();

            Console.Write("\n  Serialized TestRequest:");
            Console.Write("\n -------------------------\n");
            Console.Write(msg.body.shift());

            Console.Write("\n  TestRequest Message:");
            Console.Write("\n ----------------------");
            msg.showMsg();

            Console.Write("\n  Testing Deserialized TestRequest");
            Console.Write("\n ----------------------------------\n");
            TestRequest trDS = msg.body.FromXml <TestRequest>();

            Console.Write(trDS.showThis());
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Message msg = new Message();

            msg.to     = "http://localhost:8080/ICommunicator";
            msg.from   = "http://localhost:8081/ICommunicator";
            msg.author = "Fawcett";
            //msg.type = "TestRequest";

            Console.Write("\n  Testing Message with Serialized TestRequest");
            Console.Write("\n ---------------------------------------------\n");
            TestElement te1 = new TestElement("test1");

            te1.addDriver("td1.dll");
            te1.addCode("tc1.dll");
            te1.addCode("tc2.dll");
            TestElement te2 = new TestElement("test2");

            te2.addDriver("td2.dll");
            te2.addCode("tc3.dll");
            te2.addCode("tc4.dll");
            TestRequest tr = new TestRequest();

            tr.author = "Jim Fawcett";
            tr.tests.Add(te1);
            tr.tests.Add(te2);
            msg.body = tr.ToXml();

            Console.Write("\n  Serialized TestRequest:");
            Console.Write("\n -------------------------\n");
            Console.Write(msg.body.shift());

            Console.Write("\n  TestRequest Message:");
            Console.Write("\n ----------------------");
            msg.showMsg();

            Console.Write("\n  Testing Deserialized TestRequest");
            Console.Write("\n ----------------------------------\n");
            TestRequest trDS = msg.body.FromXml <TestRequest>();
            //Console.Write(trDS.showThis());
        }
Esempio n. 4
0
        //----< run demonstration >--------------------------------------------
        void runTestHarness(TestRequest testReq)
        {
            Console.Write("\n\n Test Harness");
            Console.Write("\n\n ==================================\n\n");

            // convert testers relative path to absolute path

            TestHarness.testersLocation = Path.GetFullPath(TestHarness.testersLocation);

            List <string> library = new List <string>();

            foreach (Test test in testReq.test)
            {
                library.AddRange(test.testedFiles);
            }
            // run load and tests
            string result = loadAndExerciseTesters(library);

            logger.log(result);
            Console.Write("\n\n  {0}", result);
            Console.Write("\n\n");
        }