//--------------------------------------------------------------------------- #ifndef TestDirectorImportH #define TestDirectorImportH //--------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include "AdvMemo.hpp" #include #include //--------------------------------------------------------------------------- typedef enum {SUBJECT, TESTCASE, SCENARIO, TESTSTEP} NodeTypes; class TestDirectorNode; typedef std::vector TestDirectorNodeList_t; class TestDirectorNode { public: NodeTypes nodetype; unsigned int parentnode; unsigned int subjectnode; TestDirectorNodeList_t children; TestDirectorNodeList_t test_steps; TestDirectorNode *parent; AnsiString name; AnsiString text1; AnsiString text2; }; typedef std::map TestDirectorNodeMap_t; typedef std::pair TestDirectorNodePair_t; //--------------------------------------------------------------------------- class TTestDirectorImportForm : public TForm { __published: // IDE-managed Components TADOConnection *TestDirectorConnection; TPopupMenu *PopupMenu; TMenuItem *ImportFromTestDirector1; TImageList *TreeImageList; TPanel *Panel1; TPanel *Panel2; TTreeView *TestStepTreeView; TPanel *Panel3; TTreeView *TestCaseTreeView; TSplitter *Splitter1; TAdvMemo *TestCaseMemo; TPanel *Panel4; TTreeView *TestScenarioTreeView; TSplitter *Splitter4; TAdvMemo *TestScenarioMemo; TSplitter *Splitter5; TAdvMemo *TestStepMemo; TSplitter *Splitter6; TAdvMemo *TestStepOutcomeMemo; TPanel *Panel5; TSplitter *Splitter2; TSplitter *Splitter3; TPanel *TestStepPanel; TPanel *TestScenarioPanel; TToolBar *ToolBar1; TToolButton *ToolButton1; TBitBtn *BitBtn1; TToolButton *ToolButton2; TBitBtn *BitBtn2; TToolButton *ToolButton3; TBitBtn *BitBtn3; void __fastcall FormShow(TObject *Sender); void __fastcall FormClose(TObject *Sender, TCloseAction &Action); void __fastcall TestCaseTreeViewChange(TObject *Sender, TTreeNode *Node); void __fastcall ImportFromTestDirector1Click(TObject *Sender); void __fastcall TestScenarioTreeViewChange(TObject *Sender, TTreeNode *Node); void __fastcall TestStepTreeViewChange(TObject *Sender, TTreeNode *Node); private: // User declarations AnsiString m_project; int m_iteration; void ProcessSubtree(TTreeView *treeview, TTreeNode *node, TADOQuery *query, AnsiString current_text_case_level); AnsiString ProcessQuotedString(const AnsiString &source); void ProcessTDNode(TTreeNode *selected_node, TADOQuery *query, AnsiString ¤t_text_case_level); void __fastcall LoadTestDataScenarioData(unsigned int &root_node, AnsiString &root_node_name); void __fastcall LoadTestScenarios(TestDirectorNode *parent_td_node); void __fastcall LoadTestSteps(TestDirectorNode *parent_td_node); void DrawSubTree(TTreeView *tree, TTreeNode *node, int nodetype, int parent_id); void DrawScenarioSteps(TestDirectorNode *scenario_node); static const bool isTestCase( const AnsiString & description ); public: // User declarations __fastcall TTestDirectorImportForm(TComponent* Owner); void ShowForm( const AnsiString &project, int iteration ); }; //--------------------------------------------------------------------------- extern PACKAGE TTestDirectorImportForm *TestDirectorImportForm; //--------------------------------------------------------------------------- #endif