hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Quintiq file version 2.0
#parent: #root
Method PTF_GenerateBatchFile () id:Method_LibPTF_pnlTestController_PTF_GenerateBatchFile
{
  #keys: '[104342.0.327949308]'
  Body:
  [*
    // Generate the required batch files based on the options selected
    globalparameter     := this.PTF_GetPTFGlobalParameters();
    resultlogpath       := this.PTF_GetResultLogPath();
    batchscriptencoding := "CP1252";
    
    // Acts as the entrance to execute the actual start client batch file. Purpose is
    // to resolve not able to run TIMEOUT when having TestController with Thin Client
    fullPathKickStartClient := this.PTF_GetBatchFileFullPathForKickStartClient();  // Kick start client batch file
    fullPathStartClient     := this.PTF_GetBatchFileFullPathForStartClient();      // Start client batch file
    
    fileContentKickStartClient := globalparameter.GetKickStartClientBatchScript( fullPathStartClient );
    fileContentStartClient     := globalparameter.GetStartClientBatchScript();
    
    binaryContentKickStartClient := BinaryData::Construct( fileContentKickStartClient, batchscriptencoding );
    binaryContentStartClient     := BinaryData::Construct( fileContentStartClient, batchscriptencoding );
    
    Application.WriteBinaryFile( fullPathKickStartClient, binaryContentKickStartClient );
    Application.WriteBinaryFile( fullPathStartClient, binaryContentStartClient );
    
    // If QServer and QServer transaction logs should be copied
    if( this.PTF_IsCopyQTransLogs() )
    {
      fullPathCollectQServerLog      := this.PTF_GetBatchFileFullPathForCollectQServerLog();  // Collect QServer log batch file
      fileContentCollectQServerLog   := globalparameter.GetCollectQServerLogBatchScript( resultlogpath, fullPathCollectQServerLog );
      binaryContentCollectQServerLog := BinaryData::Construct( fileContentCollectQServerLog, batchscriptencoding );
    
      Application.WriteBinaryFile( fullPathCollectQServerLog, binaryContentCollectQServerLog );
    }
    
    // If Python scripts should be executed
    if( this.chkExecutePythonScripts().Checked() )
    {
      fullPathMergeResult         := this.PTF_GetBatchFileFullPathForMergeResult();          // Merge PTF result log batch file
      fullPathExecutePythonScript := this.PTF_GetBatchFileFullPathForExecutePythonScript();  // Execute python scripts batch file
    
      fileContentMergeResult         := globalparameter.GetMergeResultBatchScript( resultlogpath, fullPathMergeResult, fullPathExecutePythonScript );
      fileContentExecutePythonScript := globalparameter.GetExecutePythonScriptBatchScript( resultlogpath, fullPathExecutePythonScript, this.PTF_GetScriptPath() );
    
      binaryContentMergeScript         := BinaryData::Construct( fileContentMergeResult, batchscriptencoding );
      binaryContentExecutePythonScript := BinaryData::Construct( fileContentExecutePythonScript, batchscriptencoding );
    
      Application.WriteBinaryFile( fullPathMergeResult, binaryContentMergeScript );
      Application.WriteBinaryFile( fullPathExecutePythonScript, binaryContentExecutePythonScript );
    }
  *]
}