diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-08 12:59:01 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-08 12:59:01 +0100 |
commit | 2af2e7681a5e6c9a5cf854741454fce8c4696afa (patch) | |
tree | a6ab9660a0c155dd339a05ea9a0f8c495a36926b /smoketestoo_native | |
parent | debuglevels: make the current test case a global variable, so the AssertionHa... (diff) | |
download | core-2af2e7681a5e6c9a5cf854741454fce8c4696afa.tar.gz core-2af2e7681a5e6c9a5cf854741454fce8c4696afa.zip |
debuglevels: also log errors during the test's glue code (well, assertions, at least)
Diffstat (limited to 'smoketestoo_native')
-rwxr-xr-x[-rw-r--r--] | smoketestoo_native/data/Global.xml | 365 | ||||
-rw-r--r-- | smoketestoo_native/data/Test_10er.xml | 178 | ||||
-rw-r--r-- | smoketestoo_native/data/Test_DB.xml | 31 | ||||
-rw-r--r-- | smoketestoo_native/data/Test_Ext.xml | 26 |
4 files changed, 339 insertions, 261 deletions
diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index 5da3617fad9b..a412b9d2259c 100644..100755 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -28,7 +28,7 @@ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Global" script:language="StarBasic">REM ***** BASIC ***** -const cMaxErrorStates = 13 +const cMaxErrorStates = 14 const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256 const cParagraphBreak = 0 @@ -38,12 +38,14 @@ global const cExtensionFileName = "TestExtension.oxt" global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4 global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 +global const cOtherSetupDoc = 0, cOtherWriteStatus = 1 global const cLogfileFailed = 255 global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 global const cStHTML = 6, cStChart = 4, cStJava = 7 global const cStMath = 5, cStDataBase = 9 global const cStExtension = 11 +global const cStTestGlue = 12 global const cStNone = -1 global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128 @@ -52,9 +54,10 @@ global const frmWriter = 1, frmCalc = 2, frmImpress = 4 global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 global const frmDataBase = 10, frmJava = 13 global const frmExtension = 14 +global const frmTestGlue = 15 -Global g_CurrentDocTest As Integer -Global g_CurrentTestCase As Integer +Global gCurrentDocTest As Integer +Global gCurrentTestCase As Integer global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 @@ -94,6 +97,7 @@ Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "S Global const cDlgCancel = 1, cDlgOk = 0, cDlgStartTest = 2 global gErrorState (cMaxErrorStates, 5) as integer +Global gTestCaseAnnotations( cMaxErrorStates, 5 ) As String global gOutputDoc as Object global gOutputDocNotUno as Object @@ -112,20 +116,21 @@ global sExtensionURL as string Dim gDlgState as Integer Sub SetGlobalDoc - gOutPutDoc = ThisComponent + gOutputDoc = ThisComponent end Sub Sub ClearStatus for j% = 0 to cMaxErrorStates for i% = 0 to 5 - gErrorState (j%, i%) = cLogUnknown + gErrorState (j%, i%) = cLogUnknown + gTestCaseAnnotations( J%, i% ) = "" next i% next j% end Sub Sub ClearAllText call SetGlobalDoc - call ClearDoc (gOutPutDoc) + call ClearDoc (gOutputDoc) call ClearStatus end Sub @@ -134,11 +139,18 @@ Sub AssertionHandler( sMessage as String ) End Sub Sub Main - CaptureAssertions( "AssertionHandler" ) + CaptureAssertions( "AssertionHandler" ) + + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherSetupDoc call SetGlobalDoc + + Dim bWasModified as Boolean + bWasModified = gOutputDoc.isModified() + if bShowTable then - call ClearDoc (gOutPutDoc) + call ClearDoc (gOutputDoc) end If call ClearStatus @@ -146,6 +158,8 @@ Sub Main Call Test_10er.Main if bShowTable then + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherWriteStatus call CreateStatusTable2 call CreateStatusTable call CreateDocState @@ -153,7 +167,9 @@ Sub Main gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage end if - CaptureAssertions( "" ) + gOutputDoc.setModified( bWasModified ) + + CaptureAssertions( "" ) End Sub Sub CreateStatusTable @@ -167,26 +183,26 @@ Sub CreateStatusTable tableHeaders(cStHTML) = "HTML" tableHeaders(cStJava) = "Java" - dim tableRows(4) as string - tableRows(cDocNew) = "new" - tableRows(cDocSaveOpen8) = "V8.0" - tableRows(cDocSaveOpenXML) = "XML" - tableRows(cDocSaveOpen50) = "V5.0" - tableRows(cDocClose) = "close" + dim tableRows(4) as string + tableRows(cDocNew) = "new" + tableRows(cDocSaveOpen8) = "V8.0" + tableRows(cDocSaveOpenXML) = "XML" + tableRows(cDocSaveOpen50) = "V5.0" + tableRows(cDocClose) = "close" - aDoc = gOutPutDoc + aDoc = gOutputDoc - xText = aDoc.Text - xCursor = xText.createTextCursor() + xText = aDoc.Text + xCursor = xText.createTextCursor() - xCursor.gotoStart(FALSE) - xCursor.GoRight (4, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) + xCursor.gotoStart(FALSE) + xCursor.GoRight (4, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) - table = aDoc.createInstance("com.sun.star.text.TextTable") + table = aDoc.createInstance("com.sun.star.text.TextTable") table.initialize(6,9) table.Name = "StTab1" xText.insertTextContent(xCursor, table, FALSE) @@ -196,57 +212,61 @@ Sub CreateStatusTable tableCursor.goRight(1,FALSE) for i% = 0 to 7 - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + xCell.String=tableHeaders(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey - tableCursor.goRight(1,FALSE) + tableCursor.goRight(1,FALSE) next i% xCursor.gotoStart(FALSE) tableCursor.gotoStart(FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell = table.getCellByName(cName) + xCell.BackTransparent = False + xCell.BackColor = cCoGrey for i% = 0 to 4 tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows(i%) + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + xCell.String=tableRows(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey next i% end Sub Sub CreateStatusTable2 dim tableHeaders(5) as string - tableHeaders(cStDataBase-9) = "Database" + tableHeaders(0) = "Database" tableHeaders(1) = "" - tableHeaders(cStExtension-9) = "Extension" + tableHeaders(2) = "Extension" tableHeaders(3) = "" - tableHeaders(4) = "" + tableHeaders(4) = "Other" + + dim tableRows(5) as string + tableRows(cDBService ) = "services" + tableRows(cDBOpen ) = "open" + tableRows(cDBInsert ) = "insert" + tableRows(cDBDelete ) = "delete" + tableRows(cDBSeek ) = "seek" + tableRows(cDBClose ) = "close" - dim tableRows(5) as string - tableRows(cDBService ) = "services" - tableRows(cDBOpen ) = "open" - tableRows(cDBInsert ) = "insert" - tableRows(cDBDelete ) = "delete" - tableRows(cDBSeek ) = "seek" - tableRows(cDBClose ) = "close" + dim tableRows2(2) as string + tableRows2(cEXTService ) = "services" + tableRows2(cEXTInstall ) = "install" + tableRows2(cEXTUninstall ) = "uninstall" - dim tableColums2(3) as string - tableColums2(cEXTService ) = "services" - tableColums2(cEXTInstall ) = "install" - tableColums2(cEXTUninstall ) = "uninstall" + dim tableRows3(1) as string + tableRows3(cOtherSetupDoc ) = "setup doc" + tableRows3(cOtherWriteStatus ) = "write status" - aDoc = gOutPutDoc + aDoc = gOutputDoc xText = aDoc.Text xCursor = xText.createTextCursor() @@ -260,7 +280,7 @@ Sub CreateStatusTable2 table = aDoc.createInstance("com.sun.star.text.TextTable") table.initialize(7,6) table.Name = "StTab2" - 'table.RelativeWidth =500 + table.BackColor = cCoGrey xText.insertTextContent(xCursor, table, FALSE) @@ -268,7 +288,7 @@ Sub CreateStatusTable2 tableCursor.gotoStart(FALSE) tableCursor.goRight(1,FALSE) - for i% = 0 to 5 + for i% = LBound( tableHeaders ) to UBound( tableHeaders ) cName = tableCursor.getRangeName() xCell = table.getCellByName(cName) xCell.String=tableHeaders(i%) @@ -282,11 +302,11 @@ Sub CreateStatusTable2 tableCursor.gotoStart(FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell = table.getCellByName(cName) + xCell.BackTransparent = False + xCell.BackColor = cCoGrey - for i% = 0 to 5 + for i% = LBound( tableRows ) to UBound( tableRows ) tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() xCell = table.getCellByName(cName) @@ -299,22 +319,34 @@ Sub CreateStatusTable2 tableCursor.gotoStart(FALSE) tableCursor.goRight(2,FALSE) - for i% = 0 to 3 + for i% = LBound( tableRows2 ) to UBound( tableRows2 ) tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums2(i%) + xCell = table.getCellByName(cName) + xCell.String=tableRows2(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey + next i% + + tableCursor.gotoStart(FALSE) + tableCursor.goRight(4,FALSE) + + for i% = LBound( tableRows3 ) to UBound( tableRows3 ) + tableCursor.goDown(1,FALSE) + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + xCell.String=tableRows3(i%) + + xCell.BackTransparent = False + xCell.BackColor = cCoGrey next i% end Sub Sub CreateDocState - aDoc = gOutPutDoc + aDoc = gOutputDoc table = aDoc.TextTables.GetByIndex (1) - 'table = aDoc.TextTables.GetByName ("StTab1") for j% = 0 to 7 for i% = 0 to 4 @@ -322,49 +354,62 @@ Sub CreateDocState tableCursor = table.createCursorByCellName(sRangeName) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - - xCell.BackTransparent = False - - if gErrorState (j%, i%) = cLogTrue then - xCell.BackColor = cCoGreen - else if gErrorState (j%, i%) = cLogFalse then - xCell.BackColor = cCoRed - else - xCell.BackColor = cCoGrey - end If - end If - + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + + xCell.BackTransparent = False + + If gErrorState (j%, i%) = cLogTrue Then + xCell.BackColor = cCoGreen + else + If gErrorState (j%, i%) = cLogFalse Then + xCell.BackColor = cCoRed + If ( gTestCaseAnnotations( j%, i% ) <> "" ) Then + Dim annotation as Object + annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) + annotation.Author = "smoketest" + annotation.Content = gTestCaseAnnotations( j%, i% ) + xCell.insertTextContent( xCell, annotation, false ) + End If + else + xCell.BackColor = cCoGrey + end If + end If next i% next j% end Sub Sub CreateSecondState - aDoc = gOutPutDoc + aDoc = gOutputDoc table = aDoc.TextTables.GetByIndex (0) - 'table = aDoc.TextTables.GetByName ("StTab2") - for j% = 0 to cMaxErrorStates-9 - for i% = 0 to 5 - sRangeName = GetRangeName(j%, i%+1) - - tableCursor = table.createCursorByCellName(sRangeName) - - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - - xCell.BackTransparent = False - - if gErrorState (j%+9, i%) = cLogTrue then - xCell.BackColor = cCoGreen - else if gErrorState (j%+9, i%) = cLogFalse then - xCell.BackColor = cCoRed - else - xCell.BackColor = cCoGrey - end If + Dim stateIndex(2) as Integer + stateIndex(0) = cStDataBase + stateIndex(1) = cStExtension + stateIndex(2) = cStTestGlue + + Dim j as Integer + For j = LBound( stateIndex ) To UBound( stateIndex ) + for i% = 1 to 6 + tableCell = table.getCellByPosition( 2 * j + 1, i% ) + tableCell.BackTransparent = False + + if gErrorState( stateIndex(j), i% - 1 ) = cLogTrue then + tableCell.BackColor = cCoGreen + else + if gErrorState ( stateIndex(j), i% - 1 ) = cLogFalse then + tableCell.BackColor = cCoRed + If ( gTestCaseAnnotations( stateIndex(j), i% - 1 ) <> "" ) Then + Dim annotation as Object + annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) + annotation.Author = "smoketest" + annotation.Content = gTestCaseAnnotations( stateIndex(j), i% - 1 ) + tableCell.insertTextContent( tableCell, annotation, false ) + End If + else + tableCell.BackColor = cCoGrey + end If end If - next i% next j% end Sub @@ -374,20 +419,26 @@ Function GetRangeName (nColumn as integer, nRow as integer) as string end Function Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) - If ( g_CurrentTestCase = cLogfileFailed ) Then - LogState( FALSE, "creating logfile '" + GetLogFileName( g_CurrentDocTest ) + "' failed", MainFileChannel ) - SetStatus( 0, FALSE ) + If ( gCurrentTestCase = cLogfileFailed ) Then + Dim sAnnotation as String + sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" + LogState( FALSE, sAnnotation, MainFileChannel ) + SetStatus( 0, FALSE, sAnnotation ) Else - LogState( bSuccess, sTestCaseDescription, FileChannel ) - LogState( bSuccess, sTestCaseDescription, MainFileChannel ) - SetStatus( g_CurrentTestCase, bSuccess ) + If ( LocalFileChannel <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, LocalFileChannel ) + EndIf + if ( MainFileChannel <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, MainFileChannel ) + EndIf + SetStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) End If End Sub -Sub SetStatus( nAction as Integer, bState as Boolean ) +Sub SetStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) Dim nStatusType as Integer Dim nState as integer - nStatusType = GetStatusType( g_CurrentDocTest ) + nStatusType = GetStatusType( gCurrentDocTest ) If nStatusType = cStNone then Exit Sub if bState then @@ -402,6 +453,10 @@ Sub SetStatus( nAction as Integer, bState as Boolean ) End If gErrorState (nStatusType, nAction) = nState + + If ( nState = cLogFalse ) And ( sFailureAnnotation <> "" ) Then + gTestCaseAnnotations( nStatusType, nAction ) = gTestCaseAnnotations( nStatusType, nAction ) + sFailureAnnotation + chr(13) + End If end Sub Function GetStatusType (nDocType as Integer) as Integer @@ -422,6 +477,8 @@ Function GetStatusType (nDocType as Integer) as Integer GetStatusType = cStChart ' chart case frmJava GetStatusType = cStJava 'Java + case frmTestGlue + GetStatusType = cStTestGlue ' test framework case frmDataBase GetStatusType = cStDataBase 'DataBase case frmExtension @@ -511,56 +568,56 @@ end Sub Sub SetOptions call SetGlobalDoc - SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl("cbWriterTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl("cbCalcTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl("cbImpressTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl("cbDrawTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl("cbHTMLTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl("cbMathTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl("cbChartTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl("cbSaveOpen50Test").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutPutDoc) + SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl("cbWriterTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl("cbCalcTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl("cbImpressTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl("cbDrawTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl("cbHTMLTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl("cbMathTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl("cbChartTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl("cbSaveOpen50Test").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutputDoc) end Sub Sub GetOptions call SetGlobalDoc - gOptionsDialog.getControl("cbWriterTest").setState( -( GetUserFieldState (cUserFieldTestWriter, gOutPutDoc))) - gOptionsDialog.getControl("cbCalcTest").setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutPutDoc))) - gOptionsDialog.getControl("cbImpressTest").setState( -( GetUserFieldState (cUserFieldTestImpress, gOutPutDoc))) - gOptionsDialog.getControl("cbDrawTest").setState( -( GetUserFieldState (cUserFieldTestDraw, gOutPutDoc))) - gOptionsDialog.getControl("cbHTMLTest").setState( -( GetUserFieldState (cUserFieldTestHTML, gOutPutDoc))) - gOptionsDialog.getControl("cbMathTest").setState( -( GetUserFieldState (cUserFieldTestMath, gOutPutDoc))) - gOptionsDialog.getControl("cbChartTest").setState( -( GetUserFieldState (cUserFieldTestChart, gOutPutDoc))) - gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutPutDoc))) - gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc))) - gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutPutDoc))) - gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc))) - gOptionsDialog.getControl("cbSaveOpen50Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc))) - gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc))) - gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc))) + gOptionsDialog.getControl("cbWriterTest").setState( -( GetUserFieldState (cUserFieldTestWriter, gOutputDoc))) + gOptionsDialog.getControl("cbCalcTest").setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutputDoc))) + gOptionsDialog.getControl("cbImpressTest").setState( -( GetUserFieldState (cUserFieldTestImpress, gOutputDoc))) + gOptionsDialog.getControl("cbDrawTest").setState( -( GetUserFieldState (cUserFieldTestDraw, gOutputDoc))) + gOptionsDialog.getControl("cbHTMLTest").setState( -( GetUserFieldState (cUserFieldTestHTML, gOutputDoc))) + gOptionsDialog.getControl("cbMathTest").setState( -( GetUserFieldState (cUserFieldTestMath, gOutputDoc))) + gOptionsDialog.getControl("cbChartTest").setState( -( GetUserFieldState (cUserFieldTestChart, gOutputDoc))) + gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutputDoc))) + gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutputDoc))) + gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpen50Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc))) + gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc))) End Sub Sub ReadOptions call SetGlobalDoc - bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutPutDoc) - bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutPutDoc) - bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutPutDoc) - bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutPutDoc) - bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutPutDoc) - bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutPutDoc) - bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutPutDoc) - bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutPutDoc) - bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc) - bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutPutDoc) - bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc) - bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc) - bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc) - bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc) + bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutputDoc) + bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutputDoc) + bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutputDoc) + bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutputDoc) + bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutputDoc) + bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutputDoc) + bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutputDoc) + bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutputDoc) + bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutputDoc) + bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutputDoc) + bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc) + bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutputDoc) + bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) + bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) end Sub Sub SetDefaultOptions @@ -596,8 +653,8 @@ Sub StartTestByOptions call ReadOptions call Main if bMakeTerminateAfterTest then - ClearDocFull (gOutPutDoc) - gOutPutDoc.dispose + ClearDocFull (gOutputDoc) + gOutputDoc.dispose 'StarDesktop.Terminate 'EnableReschedule( false ) diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index 84a8321deced..a6f46b01eb78 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -34,6 +34,7 @@ const sSChartLogFileName = "schlog.dat" const sSHptLogFileName = "shptlog.dat" const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" +const sTestGlueLogFileName = "testgluelog.dat" const sLogFileName = "log.dat" const cTempFileName = "ttt" @@ -44,7 +45,7 @@ const cMessageCloseDoc = "Close Document" Global sWorkPath$ Global sWorkPathURL$ -Global FileChannel% +Global LocalFileChannel% Global MainFileChannel% Sub Main @@ -119,6 +120,9 @@ Sub DeleteAllLogFiles() If FileExists (sWorkPath+sJavaLogFileName) then Kill (sWorkPath+sJavaLogFileName) End If + If FileExists (sWorkPath+sTestGlueLogFileName) then + Kill (sWorkPath+sTestGlueLogFileName) + End If If FileExists (sWorkPath+sSDBLogFileName) then Kill (sWorkPath+sSDBLogFileName) End If @@ -182,7 +186,7 @@ DIM nStrPos as Long end if 'search ExtensionURL - sDocURL = gOutPutDoc.URL + sDocURL = gOutputDoc.URL CompatibilityMode(true) nStrPos = InStrRev (sDocURL, "/" ) CompatibilityMode(false) @@ -191,86 +195,87 @@ DIM nStrPos as Long call DeleteAllSavedFiles() call DeleteAllLogFiles() MainFileChannel = OpenLogDat (sLogFileName) - call WriteTestSequence (MainFileChannel) + call WriteTestSequence if bMakeWriterTest then - g_CurrentDocTest = frmWriter + gCurrentDocTest = frmWriter call MakeDocTest end if if bMakeCalcTest then - g_CurrentDocTest = frmCalc + gCurrentDocTest = frmCalc call MakeDocTest end if if bMakeImpressTest then - g_CurrentDocTest = frmImpress + gCurrentDocTest = frmImpress call MakeDocTest end if if bMakeDrawTest then - g_CurrentDocTest = frmDraw + gCurrentDocTest = frmDraw call MakeDocTest end if if bMakeHTMLTest then - g_CurrentDocTest = frmHyperText + gCurrentDocTest = frmHyperText call MakeDocTest end if if bMakeChartTest then - g_CurrentDocTest = frmChart + gCurrentDocTest = frmChart call MakeChartTest end if if bMakeMathTest then - g_CurrentDocTest = frmMath + gCurrentDocTest = frmMath call MakeNewDoc end if if bMakeJavaTest then - g_CurrentDocTest = frmJava + gCurrentDocTest = frmJava call TestJava end if if bMakeDBTest then - g_CurrentDocTest = frmDataBase + gCurrentDocTest = frmDataBase call Test_DB.TestDB end if if bMakeExtensionTest then - g_CurrentDocTest = frmExtension + gCurrentDocTest = frmExtension call Test_Ext.TestExtensions end if Close #MainFileChannel + MainFileChannel = 0 end Sub -Sub WriteTestSequence (FileChannel as integer) - Print #FileChannel, "Sequence of testing" +Sub WriteTestSequence + Print #MainFileChannel, "Sequence of testing" if bMakeWriterTest then - WriteTests ("writer : ", true, FileChannel) + WriteTests ("writer : ", true, MainFileChannel) end if if bMakeCalcTest then - WriteTests ("calc : ", true, FileChannel) + WriteTests ("calc : ", true, MainFileChannel) end if if bMakeImpressTest then - WriteTests ("impress : ", true, FileChannel) + WriteTests ("impress : ", true, MainFileChannel) end if if bMakeDrawTest then - WriteTests ("draw : ", true, FileChannel) + WriteTests ("draw : ", true, MainFileChannel) end if if bMakeHTMLTest then - WriteTests ("HTML : ", true, FileChannel) + WriteTests ("HTML : ", true, MainFileChannel) end if if bMakeChartTest then - WriteTests ("chart : ", false, FileChannel) + WriteTests ("chart : ", false, MainFileChannel) end if if bMakeMathTest then - WriteTests ("math : ", false, FileChannel) + WriteTests ("math : ", false, MainFileChannel) end if if bMakeJavaTest then - WriteTests ("Java : ", false, FileChannel) + WriteTests ("Java : ", false, MainFileChannel) end if if bMakeDBTest then - WriteDBTests ("Database : ", FileChannel) + WriteDBTests ("Database : ", MainFileChannel) end if if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", FileChannel) + WriteExtensionTests ("Extension : ", MainFileChannel) end if - Print #FileChannel + Print #MainFileChannel end Sub Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) @@ -328,63 +333,65 @@ Sub MakeDocTest Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew + oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then - sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFlt8) - SaveDoc (sFileName8, oDoc, GetDocFilter(g_CurrentDocTest or cFlt8)) + gCurrentTestCase = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then + sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFlt8) + SaveDoc (sFileName8, oDoc, GetDocFilter(gCurrentDocTest or cFlt8)) end if - g_CurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then - sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFltXML) - SaveDoc (sFileNameXML, oDoc, GetDocFilter(g_CurrentDocTest or cFltXML)) + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then + sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFltXML) + SaveDoc (sFileNameXML, oDoc, GetDocFilter(gCurrentDocTest or cFltXML)) end if - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - g_CurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + gCurrentTestCase = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then oDoc = LoadDoc (sFileName8) ' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose oDoc.close (true) end If end if - g_CurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then oDoc = LoadDoc (sFileNameXML) ' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose oDoc.close (true) end If end if end If - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error DOCTESTERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub @@ -393,28 +400,30 @@ Sub MakeNewDoc DIM oDoc as Object Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR2 - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew -' oDoc = Documents.Add(GetDocFilter(g_CurrentDocTest)) - oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew +' oDoc = Documents.Add(GetDocFilter(gCurrentDocTest)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error DOCTESTERROR2: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub @@ -427,31 +436,33 @@ Sub MakeChartTest const cChartName="TestChart" Dim bSuccess as Boolean On Local Error GoTo CHARTTESTERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) if not IsNull (oDoc) then oCharts = oDoc.sheets(0).Charts oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) bSuccess=oCharts.HasByName(cChartName) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) - g_CurrentTestCase = cDocClose + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) + gCurrentTestCase = cDocClose oDoc.close (true) else LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error CHARTTESTERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), FALSE ) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub @@ -553,6 +564,8 @@ Function GetLogFileName (DocType as Integer) as String GetLogFileName = sSChartLogFileName ' chart case frmJava GetLogFileName = sJavaLogFileName 'Java + case frmOther + GetLogFileName = sTestGlueLogFileName ' test framework case frmDataBase GetLogFileName = sSDBLogFileName 'Database case frmExtension @@ -586,14 +599,15 @@ End Function Function TestJava Dim oObj as Object - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew oObj = createUnoService( cUnoJavaLoader ) LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 TestJava = not IsNull (oObj) End Function diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 512a1abb1214..a9f1fc2e316d 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -45,16 +45,16 @@ Sub TestDB On Local Error GoTo DBERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - g_CurrentTestCase = cDBService + gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext oDBContext = CreateUnoService(cUnoDatabaseContext) sDBName=oDBContext.ElementNames(0) 'Names of Databases - g_CurrentTestCase = cDBOpen + gCurrentTestCase = cDBOpen sCurrentMessage = cMessageDatabaseOpen oDataSource = oDBContext.GetByName(sDBName) @@ -63,13 +63,14 @@ Sub TestDB LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub End If ' Database is open now - g_CurrentTestCase = cDBService + gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet oRowSet = createUnoService(cUnoRowSet) @@ -80,7 +81,7 @@ Sub TestDB LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) End If - g_CurrentTestCase = cDBInsert + gCurrentTestCase = cDBInsert sCurrentMessage = cMessageDatabaseInsert oRowSet.ActiveConnection = oDBConnection @@ -103,7 +104,7 @@ Sub TestDB 'delete only if insert passed if (bResult) Then - g_CurrentTestCase = cDBDelete + gCurrentTestCase = cDBDelete sCurrentMessage = cMessageDatabaseDelete oRowSet.deleteRow() bResult = (nRowCount - oRowSet.RowCount = 0) @@ -116,28 +117,30 @@ Sub TestDB ' read other record - g_CurrentTestCase = cDBSeek + gCurrentTestCase = cDBSeek sCurrentMessage = cMessageDatabaseSeek oRowSet.first() bResult = not (oRowSet.getString(5) = sTestString) LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) - g_CurrentTestCase = cDBClose + gCurrentTestCase = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() LogTestResult( "Database "+ cMessageDatabaseClose, True ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error DBERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else LogTestResult( "Database "+ sCurrentMessage, FALSE ) - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml index 9d3931643658..735aae537596 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestoo_native/data/Test_Ext.xml @@ -41,11 +41,11 @@ Sub TestExtensions On Local Error GoTo EXTERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) sCurrentMessage = cMessageExtensionService - g_CurrentTestCase = cEXTService + gCurrentTestCase = cEXTService 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for 'adding the extension. The implementation is in @@ -59,12 +59,13 @@ Sub TestExtensions LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub End If sCurrentMessage = cMessageExtensionInstall - g_CurrentTestCase = cEXTInstall + gCurrentTestCase = cEXTInstall 'Add the extension. We must provide a file URL here. 'By passing "user" we determine that the actions we perform on @@ -78,12 +79,13 @@ Sub TestExtensions bResult = (oTestExtension.getImplementationName = sImplementationNameString) LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub End If sCurrentMessage = cMessageExtensionUninstall - g_CurrentTestCase = cEXTUninstall + gCurrentTestCase = cEXTUninstall 'Remove the package ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) @@ -94,17 +96,19 @@ Sub TestExtensions 'The service must not be available anymore. Therefor isNull must return true. LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error EXTERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else LogTestResult( "Extension "+ sCurrentMessage, False ) - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error |