Subversion Repositories DevTools

Rev

Rev 2263 | Rev 2267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2263 Rev 2265
Line 8... Line 8...
8
#pragma hdrstop
8
#pragma hdrstop
9
 
9
 
10
#include "time.h"
10
#include "time.h"
11
#include "pcreposix.h"
11
#include "pcreposix.h"
12
 
12
 
13
 
-
 
-
 
13
#include "About.h"
14
#include "DataModule.h"
14
#include "DataModule.h"
15
#include "DefinedVariable.h"
15
#include "DefinedVariable.h"
16
#include "DefinedVariableTable.h"
16
#include "DefinedVariableTable.h"
17
#include "EvaluationContext.h"
17
#include "EvaluationContext.h"
18
#include "FieldExpression.h"
18
#include "FieldExpression.h"
19
#include "FileCtrl.hpp"
19
#include "FileCtrl.hpp"
20
#include "GenerationProperties.h"
20
#include "GenerationProperties.h"
21
#include "ICryptographicServerProxy.h"
21
#include "ICryptographicServerProxy.h"
22
#include "IHash.h"
22
#include "IHash.h"
23
#include "ImportTransactionParameters.h"
-
 
24
#include "InitProgress.h"
23
#include "InitProgress.h"
25
#include "IMessageDigest.h"
24
#include "IMessageDigest.h"
26
#include "ISecurityWrapperFactory.h"
25
#include "ISecurityWrapperFactory.h"
27
#include "Iteration.h"
26
#include "Iteration.h"
28
#include "IXmlSchemaWrapperElement.h"
27
#include "IXmlSchemaWrapperElement.h"
Line 31... Line 30...
31
#include "ParameterScope.h"
30
#include "ParameterScope.h"
32
#include "Registry.hpp"
31
#include "Registry.hpp"
33
#include "ScenarioParameters.h"
32
#include "ScenarioParameters.h"
34
#include "Sequence.h"
33
#include "Sequence.h"
35
#include "SequenceCollection.h"
34
#include "SequenceCollection.h"
36
#include "TestHosts.h"
-
 
37
#include "TestScenario.h"
35
#include "TestScenario.h"
38
#include "TestScenarioProperties.h"
36
#include "TestScenarioProperties.h"
39
#include "TestScenarioTemplate.h"
37
#include "TestScenarioTemplate.h"
40
#include "TimeEstimate.h"
38
#include "TimeEstimate.h"
41
#include "TransactionFieldTemplate.h"
39
#include "TransactionFieldTemplate.h"
Line 43... Line 41...
43
#include "TransactionSpecification.h"
41
#include "TransactionSpecification.h"
44
#include "TransactionSpecificationValue.h"
42
#include "TransactionSpecificationValue.h"
45
#include "TransactionSpecificationValueKey.h"
43
#include "TransactionSpecificationValueKey.h"
46
#include "TransactionStream.h"
44
#include "TransactionStream.h"
47
#include "TransactionTemplateCollection.h"
45
#include "TransactionTemplateCollection.h"
48
#include "UdDrainFile.h"
-
 
49
#include "UdTransferHistory.h"
-
 
50
#include "Utilities.h"
46
#include "Utilities.h"
51
#include <algorithm>
47
#include <algorithm>
52
#include <ctype.h>
48
#include <ctype.h>
53
 
49
 
54
//---------------------------------------------------------------------------
50
//---------------------------------------------------------------------------
Line 73... Line 69...
73
 
69
 
74
const char *TMainForm::g_headerStructure  = "SysHdr_t";
70
const char *TMainForm::g_headerStructure  = "SysHdr_t";
75
const int   TMainForm::g_messagePanel     = 0;
71
const int   TMainForm::g_messagePanel     = 0;
76
 
72
 
77
 
73
 
78
 
-
 
79
/**
74
/**
80
 * Process paint message.
75
 * Process paint message.
81
 */
76
 */
82
void ProcessPaintMessages( HWND Handle )
77
void ProcessPaintMessages( HWND Handle )
83
{
78
{
Line 91... Line 86...
91
 
86
 
92
const bool __fastcall TMainForm::openSecurityFactory( const char * library )
87
const bool __fastcall TMainForm::openSecurityFactory( const char * library )
93
{
88
{
94
 
89
 
95
 
90
 
96
   //ShellExecute(Handle,"open",PChar("command.com /c"),PChar("C:\\afctxn\\ERGsec\\scripts\\exprc_cryptoserver.bat"),0,SW_NORMAL);
-
 
97
   //Sleep(10);
-
 
98
 
91
 
99
    STARTUPINFO si;
92
    STARTUPINFO si;
100
    PROCESS_INFORMATION pi;
93
    PROCESS_INFORMATION pi;
101
 
94
 
102
    memset (&pi, 0, sizeof(pi));
95
    memset (&pi, 0, sizeof(pi));
Line 106... Line 99...
106
    si.dwFlags |=STARTF_USESHOWWINDOW;
99
    si.dwFlags |=STARTF_USESHOWWINDOW;
107
    si.wShowWindow|=SW_SHOWNORMAL;
100
    si.wShowWindow|=SW_SHOWNORMAL;
108
 
101
 
109
    if ( ! CreateProcess(
102
    if ( ! CreateProcess(
110
            "C:\\WINDOWS\\system32\\cmd.exe ",
103
            "C:\\WINDOWS\\system32\\cmd.exe ",
111
            "/c C:\\afctxn\\ERGsec\\scripts\\exprc_cryptoserver.bat" ,
104
            "/c C:..\\..\\ERGsec\\scripts\\exprc_cryptoserver.bat" ,
112
            NULL,
105
            NULL,
113
            NULL,
106
            NULL,
114
            false,
107
            true,
115
            NORMAL_PRIORITY_CLASS,
108
            NORMAL_PRIORITY_CLASS,
116
            NULL,
109
            NULL,
117
            NULL,
110
            NULL,
118
            &si,
111
            &si,
119
            &pi))
112
            &pi))
120
            {
113
    {
121
            MessageBox(0, "Could not execte program \n Please contact software author.", "Error", MB_ICONSTOP);
114
            MessageBox(0, "Could not launch crypto server. \n The UD will not have a proper MAC.", "Error", MB_ICONSTOP);
-
 
115
    }
-
 
116
#if 0
122
            }
117
    else
-
 
118
    {
-
 
119
            AnsiString  message;
-
 
120
            message.sprintf("process id is %d ",  pi.dwProcessId);
-
 
121
            MessageDlg(message, mtError, TMsgDlgButtons() << mbOK, 0) ;
-
 
122
    }
-
 
123
#endif
123
 
124
 
124
 
125
 
125
   m_securityWrapper = ::LoadLibrary( library );
126
   m_securityWrapper = ::LoadLibrary( library );
126
   if ( m_securityWrapper )
127
   if ( m_securityWrapper )
127
   {
128
   {
Line 165... Line 166...
165
:  TForm(Owner),
166
:  TForm(Owner),
166
   m_progressBar( 0 ),
167
   m_progressBar( 0 ),
167
   m_securityWrapper( 0 ),
168
   m_securityWrapper( 0 ),
168
   m_getSecurityWrapperFactory( 0 ),
169
   m_getSecurityWrapperFactory( 0 ),
169
   m_securityWrapperFactory( 0 ),
170
   m_securityWrapperFactory( 0 ),
170
    m_transferManager( 0 ),
171
    //m_transferManager( 0 ),
171
    m_Registry( 0 ),
172
    m_Registry( 0 ),
172
    m_currentiteration (25),
173
    m_currentiteration (25),
173
    m_currentproject("SLS")
174
    m_currentproject("SLS")
174
{
175
{
175
   //TestCasesTabSheet->TabVisible = false;
176
   //TestCasesTabSheet->TabVisible = false;
Line 210... Line 211...
210
   closeSecurityFactory();
211
   closeSecurityFactory();
211
 
212
 
212
   delete m_progressBar;
213
   delete m_progressBar;
213
   m_progressBar = 0;
214
   m_progressBar = 0;
214
 
215
 
215
    delete m_transferManager;
216
    //delete m_transferManager;
216
    m_transferManager = 0;
217
    //m_transferManager = 0;
217
 
218
 
218
    delete m_Registry;
219
    delete m_Registry;
219
    m_Registry = 0;
220
    m_Registry = 0;
-
 
221
 
220
}
222
}
221
//---------------------------------------------------------------------------
223
//---------------------------------------------------------------------------
222
 
224
 
223
 
225
 
224
 
226
 
Line 303... Line 305...
303
                    // use the iteration held in the registry to complete the preparation for the form
305
                    // use the iteration held in the registry to complete the preparation for the form
304
                    LoadIteration(Sender);
306
                    LoadIteration(Sender);
305
                    bool allow;
307
                    bool allow;
306
                    TestCaseGridRowChanging(Sender, 0, 1, allow = true );
308
                    TestCaseGridRowChanging(Sender, 0, 1, allow = true );
307
                    MASSTxnTabSheet->Visible = false;
309
                    MASSTxnTabSheet->Visible = false;
308
                    InitialiseUdTransferManager();
310
                    //InitialiseUdTransferManager();
309
                }
311
                }
310
 
312
 
311
            }
313
            }
312
            catch( EOleException & e )
314
            catch( EOleException & e )
313
            {
315
            {
Line 412... Line 414...
412
                    m_currentproject.c_str(),
414
                    m_currentproject.c_str(),
413
                    m_currentiteration);
415
                    m_currentiteration);
414
   SequenceGeneratorQuery->SQL->Text = sql_statement;
416
   SequenceGeneratorQuery->SQL->Text = sql_statement;
415
   SequenceGeneratorQuery->Open();
417
   SequenceGeneratorQuery->Open();
416
 
418
 
417
 
-
 
-
 
419
#if 0  // TxnHdr not supported in TSB
418
    // Load the Project/Iterations TXNHDR Parameters
420
    // Load the Project/Iterations TXNHDR Parameters
419
    TxnHdrValuesQuery->Close();
421
    TxnHdrValuesQuery->Close();
420
    sql_statement="";
422
    sql_statement="";
421
    sql_statement.sprintf("SELECT * FROM TXNHDR_VALUES "
423
    sql_statement.sprintf("SELECT * FROM TXNHDR_VALUES "
422
                    "WHERE PROJECT_CODE='%s' AND ITERATION=%d",
424
                    "WHERE PROJECT_CODE='%s' AND ITERATION=%d",
423
                    m_currentproject.c_str(),
425
                    m_currentproject.c_str(),
424
                    m_currentiteration);
426
                    m_currentiteration);
425
   TxnHdrValuesQuery->SQL->Text = sql_statement;
427
   TxnHdrValuesQuery->SQL->Text = sql_statement;
426
   TxnHdrValuesQuery->Open();
428
   TxnHdrValuesQuery->Open();
-
 
429
#endif
427
}
430
}
428
//---------------------------------------------------------------------------
431
//---------------------------------------------------------------------------
429
 
432
 
430
void __fastcall TMainForm::LoadTestCaseNodes(TTreeNode *testcase_node)
433
void __fastcall TMainForm::LoadTestCaseNodes(TTreeNode *testcase_node)
431
{
434
{
Line 474... Line 477...
474
         */
477
         */
475
    TestCaseTreeView->Items->EndUpdate();
478
    TestCaseTreeView->Items->EndUpdate();
476
}
479
}
477
//---------------------------------------------------------------------------
480
//---------------------------------------------------------------------------
478
 
481
 
479
void __fastcall TMainForm::InitialiseUdTransferManager()
-
 
480
{
482
 
481
    if( m_transferManager == 0 )
-
 
482
    {
-
 
483
        m_transferManager = new UdTransferManager;
-
 
484
        if( m_transferManager != 0 )
-
 
485
        {
-
 
486
            m_transferManager->LoadPendingTasks();
-
 
487
            UdTransferHistoryForm->SetTransferManager(m_transferManager);                    
-
 
488
        }
-
 
489
    }
-
 
490
}
-
 
491
//---------------------------------------------------------------------------
-
 
492
 
483
 
493
void __fastcall TMainForm::EditTestCaseExecute(TObject *Sender)
484
void __fastcall TMainForm::EditTestCaseExecute(TObject *Sender)
494
{
485
{
495
   //
486
   //
496
   
487
   
Line 526... Line 517...
526
 
517
 
527
void __fastcall TMainForm::TxnStepsQueryAfterPost(TDataSet *DataSet)
518
void __fastcall TMainForm::TxnStepsQueryAfterPost(TDataSet *DataSet)
528
{
519
{
529
 
520
 
530
 /* This routine was added to copy the exisiting TestCaseQuery behaviour but I am not sure if it is needed. */
521
 /* This routine was added to copy the exisiting TestCaseQuery behaviour but I am not sure if it is needed. */
531
   if (TxnStepsQuery->Active)
522
 //  if (TxnStepsQuery->Active)
532
    {
523
 //   {
533
      TxnStepsQuery->Close();
524
 //     TxnStepsQuery->Close();
534
    }
525
 //   }
535
    
526
    
536
    TxnStepsQuery->Open();
527
 //   TxnStepsQuery->Open();
537
//    TxnStepsQuery->Edit();
-
 
-
 
528
 
538
 
529
 
539
         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = "posting txn steps";
530
         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = "posting txn steps";
540
                  Application->ProcessMessages();          
531
                  Application->ProcessMessages();
-
 
532
 
541
}
533
}
542
//---------------------------------------------------------------------------
534
//---------------------------------------------------------------------------
543
 
535
 
544
void __fastcall TMainForm::TxnStepsNewRow(TDataSet *DataSet)
536
void __fastcall TMainForm::TxnStepsNewRow(TDataSet *DataSet)
545
{
537
{
Line 560... Line 552...
560
         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
552
         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
561
                  Application->ProcessMessages();
553
                  Application->ProcessMessages();
562
 
554
 
563
 
555
 
564
 
556
 
565
         
557
 
566
}
558
}
567
//---------------------------------------------------------------------------
559
//---------------------------------------------------------------------------
568
 
560
 
569
void __fastcall TMainForm::StepsGridRowChanging(TObject *Sender,
561
void __fastcall TMainForm::StepsGridRowChanging(TObject *Sender,
570
      int OldRow, int NewRow, bool &Allow)
562
      int OldRow, int NewRow, bool &Allow)
Line 574... Line 566...
574
 
566
 
575
         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
567
         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
576
                  Application->ProcessMessages();
568
                  Application->ProcessMessages();
577
 //Application->MessageBox(message.c_str(),"hello box",NULL);
569
 //Application->MessageBox(message.c_str(),"hello box",NULL);
578
 
570
 
579
    //TestCaseGridRowChanging(Sender, 0, 1, Allow);
571
   // TestCaseGridRowChanging(Sender, 0, 1, Allow);
580
 
572
 
581
}
573
}
582
//---------------------------------------------------------------------------
574
//---------------------------------------------------------------------------
583
 
575
 
584
void __fastcall TMainForm::loadLegacyHeaderValues( TransactionTemplateCollection & templates, const AnsiString & project, const int & iteration )
-
 
585
{
-
 
586
   TADOQuery * query = 0;
-
 
587
   try
-
 
588
   {
-
 
589
      query = new TADOQuery( this );
-
 
590
      query->Connection = Data_Module->IntegrationDBConnection;
-
 
591
 
-
 
592
      AnsiString sqlStatement;
-
 
593
      sqlStatement.sprintf(
-
 
594
         "SELECT "
-
 
595
            "FIELDNAME,"
-
 
596
            "FIELDVALUE "
-
 
597
         "FROM "
-
 
598
            "TXNHDR_VALUES "
-
 
599
         "WHERE "
-
 
600
            "PROJECT_CODE=\'%s\' AND "
-
 
601
            "ITERATION=%d",
-
 
602
         project.c_str(),
-
 
603
         iteration );
-
 
604
      query->SQL->Text = sqlStatement;
-
 
605
      query->Open();
-
 
606
 
-
 
607
      AnsiString xpath;
-
 
608
      AnsiString value;
-
 
609
      while ( !query->Eof )
-
 
610
      {
-
 
611
         value = query->FieldByName( "FIELDVALUE" )->AsString;
-
 
612
         if ( !value.IsEmpty() )
-
 
613
         {
-
 
614
            if ( value[ 1 ] == '=' )
-
 
615
            {
-
 
616
               value.Delete( 1, 1 );
-
 
617
            }
-
 
618
 
576
 
619
            if ( !value.IsEmpty() )
-
 
620
            {
-
 
621
               switch ( value[ 1 ] )
-
 
622
               {
-
 
623
                  case '@':
-
 
624
                     value[ 1 ] = '=';
-
 
625
                     if ( FieldExpression::isFunctor(
-
 
626
                           value.c_str() + 1 ) )
-
 
627
                     {
-
 
628
                        value += "()";
-
 
629
                     }
-
 
630
                     break;
-
 
631
                  default:
-
 
632
                     break;
-
 
633
               }
-
 
634
            }
-
 
635
         }
-
 
636
 
-
 
637
         xpath.sprintf(
-
 
638
            "/%s/%s",
-
 
639
            g_headerStructure,
-
 
640
            query->FieldByName( "FIELDNAME" )->AsString.c_str() );
-
 
641
         templates.getTestScenario( 0 ).getField( xpath.c_str() ).
-
 
642
            setValue( value.c_str() );
-
 
643
         query->Next();
-
 
644
      }
-
 
645
   }
-
 
646
   __finally
-
 
647
   {
-
 
648
      delete query;
-
 
649
      query = 0;
-
 
650
   }
-
 
651
}
-
 
652
//---------------------------------------------------------------------------
577
//---------------------------------------------------------------------------
653
 
578
 
654
void __fastcall TMainForm::loadLegacyParameters( TransactionTemplateCollection & templates, const AnsiString & project, const int & iteration )
579
void __fastcall TMainForm::loadLegacyParameters( TransactionTemplateCollection & templates, const AnsiString & project, const int & iteration )
655
{
580
{
656
   TADOQuery * query = 0;
581
   TADOQuery * query = 0;
Line 740... Line 665...
740
//---------------------------------------------------------------------------
665
//---------------------------------------------------------------------------
741
 
666
 
742
void __fastcall TMainForm::buildTransactionTemplates( TransactionTemplateCollection & templates, const AnsiString & project, const int & iteration )
667
void __fastcall TMainForm::buildTransactionTemplates( TransactionTemplateCollection & templates, const AnsiString & project, const int & iteration )
743
{
668
{
744
   templates.clear();
669
   templates.clear();
745
   loadLegacyHeaderValues( templates, project, iteration );
670
   //loadLegacyHeaderValues( templates, project, iteration );
746
   loadLegacyParameters( templates, project, iteration );
671
   loadLegacyParameters( templates, project, iteration );
747
 
672
 
748
   // Now apply our current templates, which override the legacy templates.
673
   // Now apply our current templates, which override the legacy templates.
749
   /* KI note: it seems that the 'legacy' routines are in fact the real thing
674
   /* KI note: it seems that the 'legacy' routines are in fact the real thing
750
      and the comment above is no longer appropriate.  Only guessing though at this stage.
675
      and the comment above is no longer appropriate.  Only guessing though at this stage.
Line 1689... Line 1614...
1689
         "Cannot get repeat size for schema element \"" \
1614
         "Cannot get repeat size for schema element \"" \
1690
         << attribute \
1615
         << attribute \
1691
         << "\"." );
1616
         << "\"." );
1692
   }
1617
   }
1693
   return ( childCount );
1618
   return ( childCount );
-
 
1619
   
1694
}
1620
}
1695
//---------------------------------------------------------------------------
1621
//---------------------------------------------------------------------------
1696
 
1622
 
1697
void __fastcall TMainForm::clearTransactionSpecificationValueTree( TDBAdvGrid & grid )
1623
void __fastcall TMainForm::clearTransactionSpecificationValueTree( TDBAdvGrid & grid )
1698
{
1624
{
Line 2261... Line 2187...
2261
        case Dbctrls::nbNext:   BtnName = "Next Record"; break;
2187
        case Dbctrls::nbNext:   BtnName = "Next Record"; break;
2262
        case Dbctrls::nbLast:   BtnName = "Last Record"; break;
2188
        case Dbctrls::nbLast:   BtnName = "Last Record"; break;
2263
        case Dbctrls::nbInsert: 
2189
        case Dbctrls::nbInsert: 
2264
        {  
2190
        {  
2265
             BtnName = "Insert Record";
2191
             BtnName = "Insert Record";
-
 
2192
             AddTestCaseNodeClick(Sender);            
-
 
2193
             TTreeNode*    dummyNode;
-
 
2194
             ResequenceTestCases(dummyNode);
-
 
2195
             //TxnStepsQuery->Edit();             
2266
             break;
2196
             break;
2267
        }
2197
        }
2268
        case Dbctrls::nbDelete: BtnName = "Delete Record"; 
2198
        case Dbctrls::nbDelete: BtnName = "Delete Record"; 
2269
        {  
2199
        {  
2270
            BtnName = "Delete Record";
2200
            //BtnName = "Delete Record";
2271
            AnsiString  message;
2201
            //AnsiString  message;
2272
            int myRow = StepsGrid->GetRealRow();
2202
            //int myRow = StepsGrid->GetRealRow();
2273
         message.sprintf( 
2203
        // message.sprintf(
2274
                            "Are you sure you want to delete all transactions from test step ('%s') %s? ",
2204
                            //"Are you sure you want to delete all transactions from test step ('%s') %s? ",
2275
                             StepsGrid->Cells[1][myRow],
2205
                             //StepsGrid->Cells[1][myRow],
2276
                             StepsGrid->Cells[2][myRow] );
2206
                             //StepsGrid->Cells[2][myRow] );
2277
 
2207
 
2278
         if ( MessageDlg( message, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0 ) == mrYes )
2208
         //if ( MessageDlg( message, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0 ) == mrYes )
2279
         {
2209
        // {
2280
                int scenario = TxnStepsQuery->FieldByName( "TESTSCENARIO_NO" )->AsInteger;
2210
                int scenario = TxnStepsQuery->FieldByName( "TESTSCENARIO_NO" )->AsInteger;
2281
                DeleteScenarioChildren(scenario); 
2211
                DeleteScenarioChildren(scenario); 
2282
            }     
2212
           // }     
2283
            break;
2213
            break;
2284
        }        
2214
        }        
2285
        case Dbctrls::nbEdit:   BtnName = "Edit"; break;
2215
        case Dbctrls::nbEdit:   BtnName = "Edit"; break;
2286
 
2216
 
2287
        case Dbctrls::nbCancel: BtnName = "Cancel Edits"; break;
2217
        case Dbctrls::nbCancel: BtnName = "Cancel Edits"; break;
Line 2303... Line 2233...
2303
        case Dbctrls::nbNext:   BtnName = "Next Record"; break;
2233
        case Dbctrls::nbNext:   BtnName = "Next Record"; break;
2304
        case Dbctrls::nbLast:   BtnName = "Last Record"; break;
2234
        case Dbctrls::nbLast:   BtnName = "Last Record"; break;
2305
        case Dbctrls::nbInsert: 
2235
        case Dbctrls::nbInsert: 
2306
        {  
2236
        {  
2307
             BtnName = "Insert Record";
2237
             BtnName = "Insert Record";
2308
             refresh_testcases = false;
2238
             //refresh_testcases = false;
2309
             AddTestCaseNodeClick(Sender);            
2239
             //AddTestCaseNodeClick(Sender);            
2310
             TTreeNode*    dummyNode;
2240
             //TTreeNode*    dummyNode;
2311
             ResequenceTestCases(dummyNode);
2241
             //ResequenceTestCases(dummyNode);
2312
             TxnStepsQuery->Edit();
2242
            // TxnStepsQuery->Edit();
-
 
2243
            
2313
             break;
2244
             break;
2314
        }
2245
        }
2315
        case Dbctrls::nbDelete: BtnName = "Delete Record"; 
2246
        case Dbctrls::nbDelete: BtnName = "Delete Record"; 
2316
        {  
2247
        {  
2317
             BtnName = "Delete Record";
2248
             BtnName = "Delete Record";
Line 2322... Line 2253...
2322
 
2253
 
2323
        case Dbctrls::nbCancel: BtnName = "Cancel Edits"; break;
2254
        case Dbctrls::nbCancel: BtnName = "Cancel Edits"; break;
2324
        case Dbctrls::nbRefresh: BtnName = "Refresh Data"; break;
2255
        case Dbctrls::nbRefresh: BtnName = "Refresh Data"; break;
2325
        default: BtnName = "Other"; break;
2256
        default: BtnName = "Other"; break;
2326
    }
2257
    }
2327
    
2258
 
2328
 
2259
 
2329
    //for (int J = 0; J < StepsGrid->RowCount; J++)
2260
    //for (int J = 0; J < StepsGrid->RowCount; J++)
2330
    //    StepsGrid->Cells[0][J] = IntToStr(J+1);
2261
    //    StepsGrid->Cells[0][J] = IntToStr(J+1);
2331
    
2262
    
2332
 
2263
 
Line 2364... Line 2295...
2364
        query->SQL->Text = sql_statement;
2295
        query->SQL->Text = sql_statement;
2365
        query->Open();
2296
        query->Open();
2366
        int max_testcase_seqno = query->FieldByName("MAX_SEQNO")->AsInteger;
2297
        int max_testcase_seqno = query->FieldByName("MAX_SEQNO")->AsInteger;
2367
 
2298
 
2368
        sql_statement="";
2299
        sql_statement="";
2369
        sql_statement.sprintf("INSERT INTO TEST_SCENARIOS (PROJECT_CODE,ITERATION,USECASE,TESTCASE_ID,TESTCASE_SEQNO) "
2300
        sql_statement.sprintf("INSERT INTO TEST_SCENARIOS (PROJECT_CODE,ITERATION,USECASE,TESTCASE_ID,TESTCASE_SEQNO,REPEAT_COUNT) "
2370
                              "VALUES ('%s',%d,'%s','%s',%d) ",
2301
                              "VALUES ('%s',%d,'%s','%s',%d,%d) ",
2371
                              m_currentproject.c_str(),
2302
                              m_currentproject.c_str(),
2372
                              m_currentiteration,
2303
                              m_currentiteration,
2373
                              m_currenttestcaseid.c_str(),
2304
                              m_currenttestcaseid.c_str(),
2374
                              m_currenttestcaseid.c_str(),
2305
                              m_currenttestcaseid.c_str(),
2375
                              max_testcase_seqno+1);
2306
                              max_testcase_seqno+1,
-
 
2307
                              1);
2376
 
2308
 
2377
        query->SQL->Text = sql_statement;
2309
        query->SQL->Text = sql_statement;
2378
        query->ExecSQL();
2310
        query->ExecSQL();
2379
 
2311
 
2380
        Data_Module->IntegrationDBConnection->CommitTrans();
2312
        Data_Module->IntegrationDBConnection->CommitTrans();
Line 4062... Line 3994...
4062
               m_transactionCache,
3994
               m_transactionCache,
4063
               *m_progressBar,
3995
               *m_progressBar,
4064
               scenario,
3996
               scenario,
4065
               m_schema_handle,
3997
               m_schema_handle,
4066
               m_currentiteration );
3998
               m_currentiteration );
4067
            
3999
 
4068
            try
4000
            try
4069
            {
4001
            {
4070
               Data_Module->IntegrationDBConnection->BeginTrans();
4002
               Data_Module->IntegrationDBConnection->BeginTrans();
4071
               applyTemplatesToScenario( *m_progressBar, scenario );
4003
               applyTemplatesToScenario( *m_progressBar, scenario );
4072
               Data_Module->IntegrationDBConnection->CommitTrans();
4004
               Data_Module->IntegrationDBConnection->CommitTrans();
Line 4222... Line 4154...
4222
 
4154
 
4223
   try
4155
   try
4224
   {
4156
   {
4225
   
4157
   
4226
      TxnStepsQuery->Close(); 
4158
      TxnStepsQuery->Close(); 
4227
      //TestCasesTabSheet->TabVisible = true;
-
 
4228
        //MainPageControl->ActivePage = TestCasesTabSheet;
-
 
4229
     // TestScenariosTabSheet->TabVisible = false;
-
 
4230
 
4159
 
4231
      if ( (m_currentproject.Length() > 0) && (m_currentiteration != 0) )
4160
      if ( (m_currentproject.Length() > 0) && (m_currentiteration != 0) )
4232
      {
4161
      {
4233
         TestCaseTreeView->Items->BeginUpdate();
4162
         TestCaseTreeView->Items->BeginUpdate();
4234
 
4163
 
Line 4280... Line 4209...
4280
 
4209
 
4281
         TestCaseTreeView->Items->EndUpdate();
4210
         TestCaseTreeView->Items->EndUpdate();
4282
         TestCaseTreeView->FullExpand();
4211
         TestCaseTreeView->FullExpand();
4283
         
4212
         
4284
         /* also refresh the Test Steps tab */
4213
         /* also refresh the Test Steps tab */
4285
 //        if (TxnStepsQuery->State == dsEdit) TxnStepsQuery->Post();         
-
 
4286
         // TxnStepsQuery->Close();                 
-
 
4287
         TxnStepsQuery->SQL->Text = sql_statement;
4214
         TxnStepsQuery->SQL->Text = sql_statement;
4288
         TxnStepsQuery->Open();
4215
         TxnStepsQuery->Open();
4289
 //        TxnStepsQuery->Edit();
-
 
4290
 
4216
 
4291
        }
4217
        }
4292
    }
4218
    }
4293
   __finally
4219
   __finally
4294
    {
4220
    {
Line 4326... Line 4252...
4326
}
4252
}
4327
//---------------------------------------------------------------------------
4253
//---------------------------------------------------------------------------
4328
 
4254
 
4329
void __fastcall TMainForm::TestCaseQueryBeforePost(TDataSet *DataSet)
4255
void __fastcall TMainForm::TestCaseQueryBeforePost(TDataSet *DataSet)
4330
{
4256
{
4331
   //DataSet->FieldByName("USECASE_ID")->AsString = DataSet->FieldByName("TESTCASE_ID")->AsString;
4257
   DataSet->FieldByName("USECASE_ID")->AsString = DataSet->FieldByName("TESTCASE_ID")->AsString;
4332
   if( DataSet->FieldByName("CASE_REPEAT")->AsInteger < 1) DataSet->FieldByName("CASE_REPEAT")->AsInteger = 1;
4258
   if( DataSet->FieldByName("CASE_REPEAT")->AsInteger < 1) DataSet->FieldByName("CASE_REPEAT")->AsInteger = 1;
4333
   if( DataSet->FieldByName("REPEAT_DELAY")->AsInteger > 360) DataSet->FieldByName("REPEAT_DELAY")->AsInteger = 360;
4259
   if( DataSet->FieldByName("REPEAT_DELAY")->AsInteger > 360) DataSet->FieldByName("REPEAT_DELAY")->AsInteger = 360;
4334
   if( DataSet->FieldByName("BATCH_SIZE")->AsInteger < 1) DataSet->FieldByName("BATCH_SIZE")->AsInteger = 1;
4260
   if( DataSet->FieldByName("BATCH_SIZE")->AsInteger < 1) DataSet->FieldByName("BATCH_SIZE")->AsInteger = 99;
4335
}
4261
}
4336
//---------------------------------------------------------------------------
4262
//---------------------------------------------------------------------------
4337
 
4263
 
4338
 
4264
 
4339
void __fastcall TMainForm::TxnStepsQueryBeforeClose(TDataSet *DataSet)
4265
void __fastcall TMainForm::TxnStepsQueryBeforeClose(TDataSet *DataSet)
4340
{
4266
{
4341
    if (DataSet->State == dsEdit )
4267
    if (DataSet->State == dsEdit )
4342
   {
4268
   {
4343
       //DataSet->FieldByName("TESTCASE_ID")->AsString = m_currenttestcaseid;
4269
       DataSet->FieldByName("TESTCASE_ID")->AsString = m_currenttestcaseid;
4344
       //DataSet->FieldByName("USECASE")->AsString = m_currenttestcaseid;
4270
       //DataSet->FieldByName("USECASE")->AsString = m_currenttestcaseid;
4345
       //DataSet->FieldByName("PROJECT_CODE")->AsString = m_currentproject;
4271
       //DataSet->FieldByName("PROJECT_CODE")->AsString = m_currentproject;
4346
       //DataSet->FieldByName("ITERATION")->AsInteger = m_currentiteration;
4272
       //DataSet->FieldByName("ITERATION")->AsInteger = m_currentiteration;
4347
       if( DataSet->FieldByName("REPEAT_COUNT")->AsInteger < 1) DataSet->FieldByName("REPEAT_COUNT")->AsInteger = 1;
4273
       if( DataSet->FieldByName("REPEAT_COUNT")->AsInteger < 1) DataSet->FieldByName("REPEAT_COUNT")->AsInteger = 1;
4348
       DataSet->Post();
4274
       DataSet->Post();
Line 5111... Line 5037...
5111
         EvaluationContext    context(definedVariableTable, sequences, *m_progressBar,
5037
         EvaluationContext    context(definedVariableTable, sequences, *m_progressBar,
5112
                                      messageDigest, hash, cryptographicServerProxy, timeEstimate );
5038
                                      messageDigest, hash, cryptographicServerProxy, timeEstimate );
5113
         buildExecutionSchedule( iteration, testCase.c_str() );
5039
         buildExecutionSchedule( iteration, testCase.c_str() );
5114
         loadLegacyVariables( definedVariableTable, m_currentproject.c_str(), iteration );
5040
         loadLegacyVariables( definedVariableTable, m_currentproject.c_str(), iteration );
5115
         readSequences( sequences, m_currentproject.c_str(), m_currentiteration );
5041
         readSequences( sequences, m_currentproject.c_str(), m_currentiteration );
-
 
5042
         iteration.setBatchSize (TestCaseQuery->FieldByName( "BATCH_SIZE" )->Text.ToInt());
5116
 
5043
 
5117
         try
5044
         try
5118
         {
5045
         {
5119
            int      count    = 0;
5046
            int      count    = 0;
5120
            bool     generated   = false;
5047
            bool     generated   = false;
Line 5123... Line 5050...
5123
            if ( scenarios.empty() )
5050
            if ( scenarios.empty() )
5124
            {
5051
            {
5125
               // generate for an entire test case
5052
               // generate for an entire test case
5126
               // first setup the environment
5053
               // first setup the environment
5127
               count = iteration.getTransactionCount();
5054
               count = iteration.getTransactionCount();
5128
               iteration.setBatchSize (TestCaseQuery->FieldByName( "BATCH_SIZE" )->Text.ToInt());
-
 
5129
               iteration.setTestCaseName (m_currenttestcaseid.c_str());
5055
               iteration.setTestCaseName (m_currenttestcaseid.c_str());
5130
               iteration.setCaseRepeat (m_currentcaserepeat);
5056
               iteration.setCaseRepeat (m_currentcaserepeat);
5131
               iteration.setRepeatDelay (m_currentcasedelay);
5057
               iteration.setRepeatDelay (m_currentcasedelay);
5132
 
5058
 
5133
               // now preapre the log file   and progress bars
-
 
5134
               message = DateToStr(Date());
-
 
5135
               stream.logToManifest (message.c_str(), false);
-
 
5136
               message = "Generating for Test Case " + testCase
-
 
5137
                                     + ". " +  TestCaseQuery->FieldByName( "NAME" )->AsString ;
-
 
5138
               stream.logToManifest (message.c_str(), false);
-
 
5139
               message.sprintf("Each run will create %d transactions with batch size of %d",count,iteration.getBatchSize());
-
 
5140
               stream.logToManifest (message.c_str(), false);
-
 
5141
               m_progressBar->open( count );
-
 
5142
               timeEstimate.start( count  );
-
 
5143
 
-
 
5144
               // now run the testcase multiple times
-
 
5145
               generated = true;
5059
               if (count > 0)
5146
               for ( int repeat = 1; repeat <= m_currentcaserepeat && generated; ++repeat )
-
 
5147
               {
5060
               {
5148
                  // first more logging and status bar info
5061
                  // now preapre the log file   and progress bars
5149
                  stream.logToManifest (" ", false);
5062
                  message = DateToStr(Date());
5150
                  message.sprintf("run %d of %d started.",repeat,m_currentcaserepeat);
-
 
5151
                  stream.logToManifest (message.c_str(), true);
5063
                  stream.logToManifest (message.c_str(), false);
5152
                  message.sprintf("%s: run %d of %d in progress.  %d transactions with batch size of %d",
5064
                  message = "Generating for Test Case " + testCase
5153
                                  m_currenttestcaseid.c_str(),repeat,m_currentcaserepeat,count, iteration.getBatchSize());
5065
                                        + ". " +  TestCaseQuery->FieldByName( "NAME" )->AsString ;
5154
                  MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;  
-
 
5155
                  Application->ProcessMessages();
5066
                  stream.logToManifest (message.c_str(), false);
5156
                   
-
 
5157
                  // now the real thing:  generate the test case 
5067
                  message.sprintf("Each run will create %d transactions with batch size of %d",count,iteration.getBatchSize());
5158
                  startTime = time(NULL);                              
-
 
5159
                  if (!iteration.generate( stream, generateHeaders, context ) )
5068
                  stream.logToManifest (message.c_str(), false);
5160
                  {  
-
 
5161
                     generated = false;
5069
                  m_progressBar->open( count );
5162
                     break;
5070
                  timeEstimate.start( count  );
5163
                  }   
-
 
5164
 
5071
   
5165
                  timeEstimate.stop();
-
 
5166
                  m_progressBar->close();       
5072
                  // now run the testcase multiple times
5167
                  
-
 
5168
                             
5073
                  generated = true;
5169
                  if (!generated)
5074
                  for ( int repeat = 1; repeat <= m_currentcaserepeat && generated; ++repeat )
5170
                  {
5075
                  {
5171
                      // problems with the generation  ..  best we can do for now is report it in status bar and log
-
 
5172
                      message.sprintf("run %d encountered a problem." ,repeat);
5076
                     // first more logging and status bar info
5173
                      stream.logToManifest (message.c_str(), true);
5077
                     stream.logToManifest (" ", false);
5174
                      message.sprintf("%s: run %d of %d encountered a problem." ,
-
 
5175
                                          m_currenttestcaseid.c_str(),repeat, m_currentcaserepeat);
-
 
5176
                      MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
-
 
5177
                      Application->ProcessMessages();
-
 
5178
                  }
-
 
5179
                  else
-
 
5180
                  {  
-
 
5181
                     // last run was good so check if we have to do it again
-
 
5182
                     // but first update log
-
 
5183
                     message.sprintf("run %d completed. Elapsed time for run was %d seconds" ,
5078
                     message.sprintf("run %d of %d started.",repeat,m_currentcaserepeat);
5184
                                     repeat, time(NULL) - startTime);
-
 
5185
                     stream.logToManifest (message.c_str(), true);
5079
                     stream.logToManifest (message.c_str(), true);
-
 
5080
                     message.sprintf("%s: run %d of %d in progress.  %d transactions with batch size of %d",
-
 
5081
                                     m_currenttestcaseid.c_str(),repeat,m_currentcaserepeat,count, iteration.getBatchSize());
-
 
5082
                     MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;  
-
 
5083
                     Application->ProcessMessages();
-
 
5084
                      
-
 
5085
                     // now the real thing:  generate the test case 
-
 
5086
                     startTime = time(NULL);                              
-
 
5087
                     if (!iteration.generate( stream, generateHeaders, context ) )
-
 
5088
                     {  
-
 
5089
                        generated = false;
-
 
5090
                        break;
-
 
5091
                     }   
5186
 
5092
   
-
 
5093
                     timeEstimate.stop();
-
 
5094
                     m_progressBar->close();       
-
 
5095
                     
-
 
5096
                                
5187
                     if ( repeat < m_currentcaserepeat )
5097
                     if (!generated)
5188
                     {
5098
                     {
5189
                        // do it again but possibly wait here before starting next session
5099
                         // problems with the generation  ..  best we can do for now is report it in status bar and log
5190
                        for (int delayRepeat = m_currentcasedelay - (time(NULL) - startTime); delayRepeat > 0 ; --delayRepeat)
5100
                         message.sprintf("run %d encountered a problem." ,repeat);
5191
                        {                     
5101
                         stream.logToManifest (message.c_str(), true);
5192
                           message.sprintf("%s: run %d of %d completed.  Pausing generation for %d seconds" ,
5102
                         message.sprintf("%s: run %d of %d encountered a problem." ,
5193
                                          m_currenttestcaseid.c_str(),repeat, m_currentcaserepeat, delayRepeat);
5103
                                             m_currenttestcaseid.c_str(),repeat, m_currentcaserepeat);
5194
                           MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
5104
                         MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
5195
                           Application->ProcessMessages();
5105
                         Application->ProcessMessages();
5196
                           Sleep (1000);
-
 
5197
                        } 
-
 
5198
                     }
5106
                     }
5199
                     else
5107
                     else
5200
                     {
5108
                     {  
-
 
5109
                        // last run was good so check if we have to do it again
-
 
5110
                        // but first update log
-
 
5111
                        message.sprintf("run %d completed. Elapsed time for run was %d seconds" ,
-
 
5112
                                        repeat, time(NULL) - startTime);
-
 
5113
                        stream.logToManifest (message.c_str(), true);
-
 
5114
   
-
 
5115
                        if ( repeat < m_currentcaserepeat )
-
 
5116
                        {
-
 
5117
                           // do it again but possibly wait here before starting next session
-
 
5118
                           for (int delayRepeat = m_currentcasedelay - (time(NULL) - startTime); delayRepeat > 0 ; --delayRepeat)
-
 
5119
                           {                     
-
 
5120
                              message.sprintf("%s: run %d of %d completed.  Pausing generation for %d seconds" ,
-
 
5121
                                             m_currenttestcaseid.c_str(),repeat, m_currentcaserepeat, delayRepeat);
-
 
5122
                              MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
-
 
5123
                              Application->ProcessMessages();
-
 
5124
                              Sleep (1000);
-
 
5125
                           } 
-
 
5126
                        }
-
 
5127
                        else
-
 
5128
                        {
5201
                           // all done
5129
                              // all done
5202
                           message.sprintf("%s: run %d of %d completed. " ,
5130
                              message.sprintf("%s: run %d of %d completed. " ,
5203
                                          m_currenttestcaseid.c_str(),repeat, m_currentcaserepeat);
5131
                                             m_currenttestcaseid.c_str(),repeat, m_currentcaserepeat);
5204
                           MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
5132
                              MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
5205
                           Application->ProcessMessages();               
5133
                              Application->ProcessMessages();               
-
 
5134
                        }
-
 
5135
   
5206
                     }
5136
                     } 
5207
                  }                      
5137
                  }                     
5208
               }  
5138
               }
-
 
5139
               else
-
 
5140
               {
-
 
5141
                  MessageDlg( "No transactions to generate", mtWarning, TMsgDlgButtons() << mbOK, 0 );
-
 
5142
               }                    
5209
            } // end of test case generation
5143
            } // end of test case generation
5210
            else
5144
            else
5211
            {
5145
            {
5212
               // single test step generation
5146
               // single test step generation
-
 
5147
               // note code caters for a list of scenarios but the GUI should only deliver a list of 1
-
 
5148
               std::string batchName;
-
 
5149
               TestScenario * scenario = 0;
-
 
5150
 
5213
               std::vector< int >::const_iterator where = scenarios.begin();
5151
               std::vector< int >::const_iterator where = scenarios.begin();
5214
               for ( where = scenarios.begin(); where != scenarios.end(); ++where )
5152
               for ( where = scenarios.begin(); where != scenarios.end(); ++where )
5215
               {
5153
               {
5216
                  count += iteration.
5154
                  scenario = &iteration.findTestScenario( *where );
5217
                  findTestScenario( *where ).getTransactionCount();
5155
                  count += scenario->getTransactionCount();
5218
               }
5156
               }
5219
 
-
 
5220
               // now preapre the log file   and progress bars
-
 
5221
               message = DateToStr(Date());
-
 
5222
               stream.logToManifest (message.c_str(), false);
-
 
5223
               message = "Generating for a single Test Step " ;
-
 
5224
               stream.logToManifest (message.c_str(), false);
-
 
5225
               message.sprintf("The step will create %d transactions with batch size of %d",count,iteration.getBatchSize());
-
 
5226
               stream.logToManifest (message.c_str(), false);               
-
 
5227
               m_progressBar->open( count );
-
 
5228
               timeEstimate.start( count );
-
 
5229
 
-
 
5230
               generated = true;
5157
               if (count > 0)
5231
               for ( where = scenarios.begin(); where != scenarios.end(); ++where )
-
 
5232
               {
5158
               {
5233
                 // first more logging and status bar info
5159
                  // now preapre the log file   and progress bars
5234
                  stream.logToManifest (" ", false);
-
 
5235
                  message.sprintf("test step started.");
5160
                  message = DateToStr(Date());
5236
                  stream.logToManifest (message.c_str(), true);
5161
                  stream.logToManifest (message.c_str(), false);
5237
                  message.sprintf("test step generation in progress.  %d transactions with batch size of %d",
-
 
5238
                                  count, iteration.getBatchSize());
5162
                  message = "Generating for a single Test Step " ;
5239
                  MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;  
-
 
5240
                  Application->ProcessMessages();
5163
                  stream.logToManifest (message.c_str(), false);
5241
                   
-
 
5242
                  // now the real thing:  generate the test step
5164
                  message.sprintf("The step will create %d transactions with batch size of %d",count,iteration.getBatchSize());
5243
                  startTime = time(NULL);    
5165
                  stream.logToManifest (message.c_str(), false);
5244
                  if ( !iteration.findTestScenario( *where ).generate(
-
 
5245
                        stream,
-
 
5246
                        generateHeaders,
5166
                  m_progressBar->open( count );
5247
                        context ) )
5167
                  timeEstimate.start( count );
5248
                  {
5168
   
5249
                     generated = false;
5169
                  generated = true;
5250
                     // problems with the generation  ..  best we can do for now is report it in status bar and log
-
 
5251
                     message.sprintf("test step encountered a problem.");
-
 
5252
                     stream.logToManifest (message.c_str(), true);
-
 
5253
                     message.sprintf("generation for test step encountered a problem." );
5170
                  for ( where = scenarios.begin(); where != scenarios.end(); ++where )
5254
                     MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
-
 
5255
                     Application->ProcessMessages();  
-
 
5256
                     break;
-
 
5257
                  }
-
 
5258
                  else
-
 
5259
                  {
5171
                  {
-
 
5172
                    // first more logging and status bar info
5260
                     // all done
5173
                     stream.logToManifest (" ", false);
5261
                     message.sprintf("test step completed.  Elapsed time for run was %d seconds",time(NULL) - startTime);
5174
                     message.sprintf("test step started.");
5262
                     stream.logToManifest (message.c_str(), true);
5175
                     stream.logToManifest (message.c_str(), true);
5263
                     message.sprintf("generation for test step completed." );
5176
                     message.sprintf("test step generation in progress.  %d transactions with batch size of %d",
-
 
5177
                                     count, iteration.getBatchSize());
5264
                     MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
5178
                     MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
5265
                     Application->ProcessMessages();                    
5179
                     Application->ProcessMessages();
-
 
5180
   
-
 
5181
                     // for test step we setup the filename here not in the iteration class which caters for test cases
-
 
5182
                     scenario = &iteration.findTestScenario( *where );
-
 
5183
                     batchName =  scenario->buildBatchName
-
 
5184
                                         (batchName, scenario->getScenarioName() );
-
 
5185
                     stream.newBatch(iteration.getBatchSize(),batchName);
-
 
5186
   
-
 
5187
                     // now the real thing:  generate the test step
-
 
5188
                     startTime = time(NULL);
-
 
5189
                     if ( !scenario->generate(
-
 
5190
                           stream,
-
 
5191
                           generateHeaders,
-
 
5192
                           context ) )
-
 
5193
                     {
-
 
5194
                        generated = false;
-
 
5195
                        // problems with the generation  ..  best we can do for now is report it in status bar and log
-
 
5196
                        message.sprintf("test step encountered a problem.");
-
 
5197
                        stream.logToManifest (message.c_str(), true);
-
 
5198
                        message.sprintf("generation for test step encountered a problem." );
-
 
5199
                        MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
-
 
5200
                        Application->ProcessMessages();
-
 
5201
                        break;
-
 
5202
                     }
-
 
5203
                     else
-
 
5204
                     {
-
 
5205
                        // all done
-
 
5206
                        message.sprintf("test step completed.  Elapsed time for run was %d seconds",time(NULL) - startTime);
-
 
5207
                        stream.logToManifest (message.c_str(), true);
-
 
5208
                        message.sprintf("generation for test step completed." );
-
 
5209
                        MainStatusBar->Panels->Items[ g_messagePanel ]->Text = message;
-
 
5210
                        Application->ProcessMessages();
-
 
5211
                     }
5266
                  }
5212
                  }
5267
               }
5213
               }
-
 
5214
               else
-
 
5215
               {
-
 
5216
                  MessageDlg( "No transactions to generate", mtWarning, TMsgDlgButtons() << mbOK, 0 );
-
 
5217
               }
5268
            }
5218
            }
5269
            
5219
 
5270
            // generation complete so just finish off and tidy up
5220
            // generation complete so just finish off and tidy up
5271
            if ( generated )
5221
            if ( generated )
5272
            {
5222
            {
5273
               writeSequences(
5223
               writeSequences(
5274
                  sequences,
5224
                  sequences,
Line 5334... Line 5284...
5334
}
5284
}
5335
//---------------------------------------------------------------------------
5285
//---------------------------------------------------------------------------
5336
 
5286
 
5337
void __fastcall TMainForm::UdTransferBtnClick(TObject *Sender)
5287
void __fastcall TMainForm::UdTransferBtnClick(TObject *Sender)
5338
{
5288
{
5339
    UdTransferHistoryForm->Show();
5289
    //UdTransferHistoryForm->Show();
5340
}
5290
}
5341
//---------------------------------------------------------------------------
5291
//---------------------------------------------------------------------------
5342
 
5292
 
5343
void __fastcall TMainForm::FormCloseQuery(TObject *Sender, bool &CanClose)
5293
void __fastcall TMainForm::FormCloseQuery(TObject *Sender, bool &CanClose)
5344
{
5294
{
5345
    CanClose = true;
5295
    CanClose = true;
5346
 
5296
 
5347
    // Warn if there are transfer tasks currently running
5297
    // Warn if there are transfer tasks currently running
5348
 
5298
 
5349
    if( (m_transferManager != NULL) &&
5299
    /*if( (m_transferManager != NULL) &&
5350
        (m_transferManager->IsTaskRunning()) )
5300
        (m_transferManager->IsTaskRunning()) )
5351
    {
5301
    {
5352
        AnsiString msg = "There are UD transfers currently in progress. Quitting now will abort these tasks.";
5302
        AnsiString msg = "There are UD transfers currently in progress. Quitting now will abort these tasks.";
5353
        msg += "\nAre you sure you want to continue?";
5303
        msg += "\nAre you sure you want to continue?";
5354
        if( MessageDlg( msg, mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0 ) == mrNo )
5304
        if( MessageDlg( msg, mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0 ) == mrNo )
5355
        {
5305
        {
5356
            CanClose = false;
5306
            CanClose = false;
5357
        }
5307
        }
5358
    }
5308
    }
-
 
5309
    */
5359
}
5310
}
5360
//---------------------------------------------------------------------------
5311
//---------------------------------------------------------------------------
5361
 
5312
 
5362
 
5313
 
5363
void __fastcall TMainForm::TestCaseTreeViewKeyUp(TObject *Sender,
5314
void __fastcall TMainForm::TestCaseTreeViewKeyUp(TObject *Sender,
Line 5426... Line 5377...
5426
//---------------------------------------------------------------------------
5377
//---------------------------------------------------------------------------
5427
//---------------------------------------------------------------------------
5378
//---------------------------------------------------------------------------
5428
 
5379
 
5429
void __fastcall TMainForm::ExitClick(TObject *Sender)
5380
void __fastcall TMainForm::ExitClick(TObject *Sender)
5430
{
5381
{
-
 
5382
 
5431
    Close();
5383
    Close();
5432
}
5384
}
5433
 
5385
 
-
 
5386
 
-
 
5387
void __fastcall TMainForm::AboutClick(TObject *Sender)
-
 
5388
{
-
 
5389
     AboutForm->Show();        
-
 
5390
}
-
 
5391
//---------------------------------------------------------------------------
-
 
5392