def invalidResume():
    tbTestSuite = TBTestSuite(1,'Sample test 2')
    for i in range(3):
        newTest = TBTAFSampleTest()
        tbTestSuite.addTestCase(newTest)

    executionTBTestSuite = ExecutionTBTestSuite(tbTestSuite)
    executionTBTestSuite.resume()
def invalidExecute():
    tbTestSuite = TBTestSuite(1,'Sample test 2')
    for i in range(3):
        newTest = TBTAFSampleTest()
        tbTestSuite.addTestCase(newTest)

    executionTBTestSuite = ExecutionTBTestSuite(tbTestSuite)
    executionTBTestSuite.execute()
    time.sleep(1)
    executionTBTestSuite.execute()
def validExecute():
    tbTestSuite = TBTestSuite(1,'Sample test 1')
    for i in range(3):
        newTest = TBTAFSampleTest()
        tbTestSuite.addTestCase(newTest)

    executionTBTestSuite = ExecutionTBTestSuite(tbTestSuite)
    executionTBTestSuite.execute()
    
    waitingComplete = True
    while waitingComplete:
        result = executionTBTestSuite.getStatus()
        time.sleep(5)
        waitingComplete = result != TBTAFExecutionStatusType.COMPLETED
def validGetBySuiteAndInit():
    tbTestSuite = TBTestSuite(1,'Sample test')
    for i in range(3):
        newTest = TBTAFSampleTest()
        tbTestSuite.addTestCase(newTest)

    executionTBTestSuite = ExecutionTBTestSuite.getBySuite(tbTestSuite)
    if executionTBTestSuite is None:
        executionTBTestSuite = ExecutionTBTestSuite(tbTestSuite)
def invalidGetBySuite():
    tbTestSuite = None
    executionTBTestSuite = ExecutionTBTestSuite.getBySuite(tbTestSuite)
def invalidGetRunStatus():
    tbTestSuite = TBTestSuite(1,'Sample test 4')
    executionTBTestSuite = ExecutionTBTestSuite(tbTestSuite)
    executionTBTestSuite.getRunStatus()