| 2218 |
sbetterm |
1 |
//---------------------------------------------------------------------------
|
|
|
2 |
|
|
|
3 |
#ifndef TestDirectorImportH
|
|
|
4 |
#define TestDirectorImportH
|
|
|
5 |
//---------------------------------------------------------------------------
|
|
|
6 |
#include <Classes.hpp>
|
|
|
7 |
#include <Controls.hpp>
|
|
|
8 |
#include <StdCtrls.hpp>
|
|
|
9 |
#include <Forms.hpp>
|
|
|
10 |
#include <ADODB.hpp>
|
|
|
11 |
#include <DB.hpp>
|
|
|
12 |
#include <ComCtrls.hpp>
|
|
|
13 |
#include <ExtCtrls.hpp>
|
|
|
14 |
#include <Menus.hpp>
|
|
|
15 |
#include <ImgList.hpp>
|
|
|
16 |
#include "AdvMemo.hpp"
|
|
|
17 |
#include <ToolWin.hpp>
|
|
|
18 |
#include <Buttons.hpp>
|
|
|
19 |
|
|
|
20 |
//---------------------------------------------------------------------------
|
|
|
21 |
|
|
|
22 |
typedef enum {SUBJECT, TESTCASE, SCENARIO, TESTSTEP} NodeTypes;
|
|
|
23 |
|
|
|
24 |
class TestDirectorNode;
|
|
|
25 |
|
|
|
26 |
typedef std::vector<TestDirectorNode *> TestDirectorNodeList_t;
|
|
|
27 |
|
|
|
28 |
class TestDirectorNode
|
|
|
29 |
{
|
|
|
30 |
public:
|
|
|
31 |
NodeTypes nodetype;
|
|
|
32 |
unsigned int parentnode;
|
|
|
33 |
unsigned int subjectnode;
|
|
|
34 |
TestDirectorNodeList_t children;
|
|
|
35 |
TestDirectorNodeList_t test_steps;
|
|
|
36 |
TestDirectorNode *parent;
|
|
|
37 |
AnsiString name;
|
|
|
38 |
AnsiString text1;
|
|
|
39 |
AnsiString text2;
|
|
|
40 |
};
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
typedef std::map<unsigned int, TestDirectorNode *> TestDirectorNodeMap_t;
|
|
|
44 |
typedef std::pair<unsigned int, TestDirectorNode *> TestDirectorNodePair_t;
|
|
|
45 |
|
|
|
46 |
//---------------------------------------------------------------------------
|
|
|
47 |
class TTestDirectorImportForm : public TForm
|
|
|
48 |
{
|
|
|
49 |
__published: // IDE-managed Components
|
|
|
50 |
TADOConnection *TestDirectorConnection;
|
|
|
51 |
TPopupMenu *PopupMenu;
|
|
|
52 |
TMenuItem *ImportFromTestDirector1;
|
|
|
53 |
TImageList *TreeImageList;
|
|
|
54 |
TPanel *Panel1;
|
|
|
55 |
TPanel *Panel2;
|
|
|
56 |
TTreeView *TestStepTreeView;
|
|
|
57 |
TPanel *Panel3;
|
|
|
58 |
TTreeView *TestCaseTreeView;
|
|
|
59 |
TSplitter *Splitter1;
|
|
|
60 |
TAdvMemo *TestCaseMemo;
|
|
|
61 |
TPanel *Panel4;
|
|
|
62 |
TTreeView *TestScenarioTreeView;
|
|
|
63 |
TSplitter *Splitter4;
|
|
|
64 |
TAdvMemo *TestScenarioMemo;
|
|
|
65 |
TSplitter *Splitter5;
|
|
|
66 |
TAdvMemo *TestStepMemo;
|
|
|
67 |
TSplitter *Splitter6;
|
|
|
68 |
TAdvMemo *TestStepOutcomeMemo;
|
|
|
69 |
TPanel *Panel5;
|
|
|
70 |
TSplitter *Splitter2;
|
|
|
71 |
TSplitter *Splitter3;
|
|
|
72 |
TPanel *TestStepPanel;
|
|
|
73 |
TPanel *TestScenarioPanel;
|
|
|
74 |
TToolBar *ToolBar1;
|
|
|
75 |
TToolButton *ToolButton1;
|
|
|
76 |
TBitBtn *BitBtn1;
|
|
|
77 |
TToolButton *ToolButton2;
|
|
|
78 |
TBitBtn *BitBtn2;
|
|
|
79 |
TToolButton *ToolButton3;
|
|
|
80 |
TBitBtn *BitBtn3;
|
|
|
81 |
void __fastcall FormShow(TObject *Sender);
|
|
|
82 |
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
|
|
83 |
void __fastcall TestCaseTreeViewChange(TObject *Sender,
|
|
|
84 |
TTreeNode *Node);
|
|
|
85 |
void __fastcall ImportFromTestDirector1Click(TObject *Sender);
|
|
|
86 |
void __fastcall TestScenarioTreeViewChange(TObject *Sender,
|
|
|
87 |
TTreeNode *Node);
|
|
|
88 |
void __fastcall TestStepTreeViewChange(TObject *Sender, TTreeNode *Node);
|
|
|
89 |
|
|
|
90 |
private: // User declarations
|
|
|
91 |
AnsiString m_project;
|
|
|
92 |
int m_iteration;
|
|
|
93 |
|
|
|
94 |
void ProcessSubtree(TTreeView *treeview, TTreeNode *node, TADOQuery *query, AnsiString current_text_case_level);
|
|
|
95 |
AnsiString ProcessQuotedString(const AnsiString &source);
|
|
|
96 |
void ProcessTDNode(TTreeNode *selected_node, TADOQuery *query, AnsiString ¤t_text_case_level);
|
|
|
97 |
|
|
|
98 |
void __fastcall LoadTestDataScenarioData(unsigned int &root_node, AnsiString &root_node_name);
|
|
|
99 |
void __fastcall LoadTestScenarios(TestDirectorNode *parent_td_node);
|
|
|
100 |
void __fastcall LoadTestSteps(TestDirectorNode *parent_td_node);
|
|
|
101 |
|
|
|
102 |
void DrawSubTree(TTreeView *tree, TTreeNode *node, int nodetype, int parent_id);
|
|
|
103 |
void DrawScenarioSteps(TestDirectorNode *scenario_node);
|
|
|
104 |
|
|
|
105 |
static const bool isTestCase( const AnsiString & description );
|
|
|
106 |
|
|
|
107 |
public: // User declarations
|
|
|
108 |
__fastcall TTestDirectorImportForm(TComponent* Owner);
|
|
|
109 |
void ShowForm( const AnsiString &project, int iteration );
|
|
|
110 |
};
|
|
|
111 |
//---------------------------------------------------------------------------
|
|
|
112 |
extern PACKAGE TTestDirectorImportForm *TestDirectorImportForm;
|
|
|
113 |
//---------------------------------------------------------------------------
|
|
|
114 |
#endif
|