예제 #1
0
        static void Main(string[] args)
        {
            Console.Title = "Test Executive";
            Console.WriteLine("\n  Format of command line arguments are mentioned in the Readme.txt file in the root directory.");
            Console.WriteLine("  ***************** REQUIREMENT #2 ************************\n");
            Console.WriteLine("  My solution developed for project#2 is added to project #4 as a Class library(DatabaseLib).");
            Console.WriteLine("\n  ***************** REQUIREMENT #3 ************************\n");
            Console.WriteLine("  The clients and the server communicate using WCF");
            Console.WriteLine("\n  ***************** REQUIREMENT #4 ************************\n");
            Console.WriteLine("  The demo client sends requests for write,read and persist operations.\n  Database contents are displayed on server console window only in case of Demo client to show to user the successful operations performed on DB.");

            TestExecutive tst = new TestExecutive();

            tst.launch_WPF();
            Thread.Sleep(500);
            tst.launch_Server();
            Thread.Sleep(500);
            tst.launch_DemoClient();

            Console.WriteLine("  Presently only Demo client and server are launched to demonstarte that all the operations supported in project2 can be done remotely.");
            Console.WriteLine("  Enter any key to launch all the writers and readers.");
            Console.ReadKey();
            tst.launch_Writers(args);
            tst.launch_Readers(args);
            Console.WriteLine("\n  ***************** REQUIREMENT # 5 ************************\n");
            Console.WriteLine("  Write clients read from Write_Client_XML.xml file and is provided in the SavedXMLFiles folder of the root directory.");
            Console.WriteLine(" The number of messages is mentioned in the XML file with the \"Count\" tag. All request messages are sent to the server in XML format,which is processed by the server.");
            Console.WriteLine("  Latency time for each request message is displayed on the console window.");
            Console.WriteLine("\n  ***************** REQUIREMENT #6 ************************\n");
            Console.WriteLine("  A log option is provided, which when enabled displays messages on console as they are sent to server. Also response result is displayed if log option is enabled.");
            Console.WriteLine("  If log option is not enabled only latency time for each message is displayed on the console window and WPF GUI.");
            Console.WriteLine("  Once all response messages are received fom server, the write client will display the average latency time for each type of request on the WPF GUI.");
            Console.WriteLine("\n  ***************** REQUIREMENT #7 ************************");
            Console.Write("\n  The read client sends all requests mentioned in XML file which is read at startup.");
            Console.WriteLine("\n\n  ***************** REQUIREMENT #8 ************************");
            Console.WriteLine("  A partial log option is provided. If it is enabled a partial part of response message is displayed on the console window.");
            Console.WriteLine("  In case of DBElement-payload is displayed, in case of list of keys, the number of elements in list is displayed.");
            Console.WriteLine("  If partial log option is disabled, entire result is displayed on the console window.");
            Console.WriteLine("  Based on the count present in the XML file, once all response for requests are received, the average latency time for each request is displayed on the WPF GUI.");
            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            TestExecutive testExecutive = new TestExecutive();

            Client.Client             client       = new Client.Client();
            buildRequest.buildRequest buildRequest = new buildRequest.buildRequest();

            RepoMock      repoMock    = new RepoMock();
            buildServer   buildServer = new buildServer();
            List <string> list;
            TestRequest   TestRequest = new TestRequest();
            TestHarness   TestHarness = new TestHarness();
            Dictionary <string, string> dictionary;


            Console.WriteLine("\n\n-------------------------Project 2: Demosntrating a Build Server------------------------------------- \n\n");
            Console.WriteLine("***********************************************************************************************************\n\n");

            //-------------------------------------------<Requirment 1>---------------------------------------------------------------------------------
            Console.WriteLine("\n\tRequirment 1: \n\n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\tProject Prepared using C# .Net Framework and Visual Studio 2017" + Environment.Version.ToString() + "\n\n");
            Console.WriteLine("-----------------------------------------------------------------------------------\n\n");

            //----------------------------------------------<Requirment 2>------------------------------------------------------------------------------
            Console.WriteLine("\n\t Requirment 2: \n\n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\tInclude a package for\n" + nameof(buildRequest) + "\n\n" + nameof(client) + "\n\n" + nameof(repoMock) + "\n\n" + nameof(buildServer) + "\n\n" + nameof(TestRequest) + "\n\n" + nameof(TestHarness) + "\n\n" + nameof(testExecutive) + "\n\n");
            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");

            //------------------------------------------------<Requirment 3>----------------------------------------------------------------------------------
            Console.WriteLine("\n\n\t Requirment 3: \n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\tConstructed a fixed sequence of operations of the mock repository, mock test harness, and core builder\n\n");

            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");
            Console.WriteLine("The BuiltRequest Data structure generated by the client is \n");
            buildRequest = client.buildrequest();

            string sendXml = client.Xml;

            repoMock.getFiles("*.*");
            repoMock.parseRequest(buildRequest, repoMock.files);
            Console.WriteLine("\nBuiltRequest Sent to MockRepository");

            string buildrequestLocation = "../../../repoMock/repoStorage/buildRequest/buildRequest.xml";

            repoMock.savecontent(buildrequestLocation, sendXml);
            Console.WriteLine("\n\n Demonstrated the requirment of the builddriver xmlfile being saved in the repository\n\n");

            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");

            //----------------------------------------------<Requirment 4>------------------------------------------------------------------------------------------

            Console.WriteLine("\n\n\t Requirmrnt 4: \n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\tRepopsitory on demand copies a set of test source files, test drivers and test request with a test for each test driver\n\n");
            Console.WriteLine("Enter command for copying a set of test source files, test drivers and test request( Enter :send)");
            string command = Console.ReadLine();

            repoMock.sendFile(command, buildrequestLocation, "../../../buildServer/builderStorage");
            Console.WriteLine("\n\nThe Demonstrated the requirment of sending the builtRequest on command to the buildserver build storage  \n");
            Console.WriteLine("-----------------------------------------------------------------------------");
            dictionary = buildServer.processBuild("../../../buildServer/builderStorage/buildRequest.xml", repoMock);
            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");

            //--------------------------------------------<Requirment 5>--------------------------------------------------------------------------------------------
            Console.WriteLine("\n\n\t Requirment 5:\n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\t The build server builds each visual studio project delivered by the mock repository\n\n");
            list = buildServer.getBuilderFiles();
            list = buildServer.processdirectory(list);
            buildServer.buildFile(list, dictionary);
            Console.WriteLine("\n\nDemonstarted the requirment of successfully building the test files which have been sent to the build server repository\n\n");
            Console.WriteLine("-----------------------------------------------------------------------------------------------------------------------------\n\n");
            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");



            //----------------------------------------------<Requirment 6>-----------------------------------------------------------------------------------------
            Console.WriteLine("\n\n\t Requirment 6: \n");
            Console.WriteLine("=========================================================================\n");

            Console.WriteLine("\t\t The builder reported to the console the success or the failure of the build, and any warning emitted\n\n");
            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");



            //----------------------------------------------<Requirment 7>------------------------------------------------------------------------------------------
            Console.WriteLine("\n\n\t Requirment 7: \n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\t The Builder on success delivered the built library path known by mock test harness \n\n ");
            TestRequest = buildServer.generateTestRequest();

            string xml = buildServer.xml;

            repoMock.getFiles("*.*");
            //     buildServer.parseTestRequest(TestRequest,buildServer.files);
            //buildServer.parseTestRequest(TestRequest, buildServer.files);
            string testRequestLocation = "../../../BuildServer/BuilderStorage/TestRequest.xml";

            repoMock.sendFile("send", testRequestLocation, "../../../DllLoaderDemo/testHarnessStorage");

            Console.WriteLine("Demonstarted the requirment of saving the testRequest in the build server");

            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");

            //-----------------------------------------------<Requirment 8>-------------------------------------------------------------------------------------------
            Console.WriteLine("\n\n\t Requirment 8: \n");
            Console.WriteLine("=========================================================================\n");
            Console.WriteLine("\t\t The test harness attempt to load and execute each test library \n\n");
            repoMock.savecontent(testRequestLocation, xml);
            // repoMock.sendFile("sendFile", testRequestLocation, "../../../DllLoaderDemo/testHarnessStorage");
            Console.WriteLine("Demonstrated the requirment of sending the testDriver to the testHarness");
            TestHarness.processTestRequest("../../../DllLoaderDemo/testHarnessStorage/TestRequest.xml", buildServer);
            Console.WriteLine("------------------------------------------------------------------------------------------------------------------------\n\n\n");
            Console.Write("\n\n The test driver and the test file dll have been successfully sent to the test harness\n\n");
            Console.WriteLine("-----------------------------------------------------------------------------------------\n");
            //string loadandexecute = TestHarness.loadAndExerciseTesters();

            //------------------------<For loading and executing the test libraries absolute path is required>------------------------------

            TestHarness.testersLocation = Path.GetFullPath("../../../DllLoaderDemo/testHarnessStorage");
            Console.Write("\n  Loading Test Modules from:\n    {0}\n", TestHarness.testersLocation);

            // run load and tests

            string result = TestHarness.loadAndExerciseTesters();

            Console.Write("\n\n  {0}", result);
            Console.Write("\n\n");
            Console.WriteLine("\n\nDemonstrated the requirment of Simulated testing\n\n ");
            Console.WriteLine("--------------------------------------------------------------------------------------------------------\n\n");
            Console.WriteLine("\n\n=======================================================================================================================\n\n");
        }