private void FireTestCase(TestCase te) { try { LOG.Info("Strating test case : " + te.ToString()); te.Status = TestState.Processing; IClientAgent client = CreateClient(te.Description.ClientType, te.Description.StartPosition); te.WorkingGroup = new WorkingGroup(); te.WorkingGroup.Client = client; _resourceManager.initTestCase(te); _driverList.Add(client.GetDriver()); foreach (IRobotAgent scaut in te.WorkingGroup.Scouts) { _driverList.Add(scaut.GetDriver()); } _clientThreadPool.RunAgentThread(client); IMapManagment leaderMap = _mapManager.GetMainMap().CreateChildMap(); foreach (IScoutAgent scout in te.WorkingGroup.Scouts) { IMapManagment scoutMap = leaderMap.CreateChildMap(); AgentContainer container = new AgentContainer(scout, scoutMap); scout.SetMap(scoutMap); scout.GetDriver().SetMap(scoutMap); _clientThreadPool.RunAgentThread(container); } te.WorkingGroup.Leader.SetMap(leaderMap); AgentContainer leaderContainer = new AgentContainer(te.WorkingGroup.Leader, leaderMap); _clientThreadPool.RunAgentThread(leaderContainer); LOG.Info("Strating test case : " + te.ToString() + " DONE"); } catch (Exception ex) { te.Status = TestState.Fail; LOG.Error("Cannot run test " + te.ToString(), ex); } }
public void SetTestCases(List<TestCaseDescription> testCasesDescription) { LOG.Info("Setting TestCases"); foreach (TestCaseDescription testDescription in testCasesDescription) { TestCase testCase = new TestCase(testDescription); TestCasesList.Add(testCase); LOG.Info("Add test case: " + testCase.ToString()); } UpdateUI(); }