From 50d0937a706fd9c3aeebebd55e21d60499b8be20 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:58:37 +0100 Subject: debuglevels: some cleanup of the smoketest code, in preparation of #i116845# --- smoketestoo_native/data/Events.xml | 23 +++++++ smoketestoo_native/data/Global.xml | 94 ++++++++++++-------------- smoketestoo_native/data/Test_10er.xml | 120 ++++++++++++++++------------------ smoketestoo_native/data/content.xml | 87 +++++++++++++++++++++++- 4 files changed, 208 insertions(+), 116 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/data/Events.xml b/smoketestoo_native/data/Events.xml index 61272293f633..414f2c48e884 100644 --- a/smoketestoo_native/data/Events.xml +++ b/smoketestoo_native/data/Events.xml @@ -28,6 +28,8 @@ REM ***** BASIC ***** +Global s_CloseListenerCalled As Boolean + Sub PressCancel gDlgState = cDlgCancel end Sub @@ -40,4 +42,25 @@ Sub PressTest gOptionsDialog.EndExecute() gDlgState = cDlgStartTest end Sub + +Sub closeListener_queryClosing + ' not interested in + closeListener_queryClosing = TRUE +End Sub + +Sub closeListener_notifyClosing + s_CloseListenerCalled = TRUE +End Sub + +Sub closeListener_disposing + ' not interested in +End Sub + +Sub ResetCloseListenerFlag + s_CloseListenerCalled = FALSE +End Sub + +Function HasCloseListenerBeenCalled As Boolean + HasCloseListenerBeenCalled = s_CloseListenerCalled +End Function diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index 1ff082b0a1eb..e80ded136725 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -35,21 +35,21 @@ const cParagraphBreak = 0 global const cExtensionFileName = "TestExtension.oxt" -global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4, cDocWrite = 5 +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 cLogfileFailed = 255 global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 -global const cStMessage = 12, cStHTML = 6, cStChart = 4, cStJava = 7 +global const cStHTML = 6, cStChart = 4, cStJava = 7 global const cStMath = 5, cStDataBase = 9 global const cStExtension = 11 global const cStNone = -1 global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128 -global const frmWriter = 1, frmCalc = 2, frmMessage = 3, frmImpress = 4 -global const frmMath = 5, frmImage = 6, frmChart = 7, frmHyperText = 8, frmDraw = 9 +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 @@ -156,31 +156,27 @@ Sub CreateStatusTable tableHeaders(cStHTML) = "HTML" tableHeaders(cStJava) = "Java" - dim tableColums(3) as string - tableColums(cDocNew) = "new" - tableColums(cDocSaveOpen8) = "V8.0" - tableColums(cDocSaveOpenXML) = "XML" - tableColums(cDocSaveOpen50) = "V5.0" -' tableColums(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 (2, False) -' SetParagraphBreak (xCursor) -' SetParagraphBreak (xCursor) - 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.initialize(7,9) + table = aDoc.createInstance("com.sun.star.text.TextTable") + table.initialize(6,9) table.Name = "StTab1" xText.insertTextContent(xCursor, table, FALSE) @@ -200,8 +196,6 @@ Sub CreateStatusTable next i% xCursor.gotoStart(FALSE) -' SetParagraphBreak (xCursor) -' SetParagraphBreak (xCursor) tableCursor.gotoStart(FALSE) cName = tableCursor.getRangeName() @@ -209,11 +203,11 @@ Sub CreateStatusTable xCell.BackTransparent = False xCell.BackColor = cCoGrey - for i% = 0 to 3 + for i% = 0 to 4 tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() xCell = table.getCellByName(cName) - xCell.String=tableColums(i%) + xCell.String=tableRows(i%) xCell.BackTransparent = False xCell.BackColor = cCoGrey @@ -228,13 +222,13 @@ Sub CreateStatusTable2 tableHeaders(3) = "" tableHeaders(4) = "" - dim tableColums(5) as string - tableColums(cDBService ) = "services" - tableColums(cDBOpen ) = "open" - tableColums(cDBInsert ) = "insert" - tableColums(cDBDelete ) = "delete" - tableColums(cDBSeek ) = "seek" - tableColums(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 tableColums2(3) as string tableColums2(cEXTService ) = "services" @@ -284,11 +278,11 @@ Sub CreateStatusTable2 for i% = 0 to 5 tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums(i%) + xCell = table.getCellByName(cName) + xCell.String=tableRows(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey next i% tableCursor.gotoStart(FALSE) @@ -312,7 +306,7 @@ Sub CreateDocState 'table = aDoc.TextTables.GetByName ("StTab1") for j% = 0 to 7 - for i% = 0 to 5 + for i% = 0 to 4 sRangeName = GetRangeName(j%, i%+1) tableCursor = table.createCursorByCellName(sRangeName) @@ -386,23 +380,19 @@ end Sub Function GetStatusType (nDocType as Integer) as Integer Select Case ( nDocType ) case frmWriter - GetStatusType = cStWriter ' Textdokument + GetStatusType = cStWriter ' text document case frmCalc - GetStatusType = cStCalc 'Tabellendokument - case frmMessage - GetStatusType = cStMessage 'Nachricht + GetStatusType = cStCalc ' spreadsheet document case frmImpress - GetStatusType = cStPraesentation 'Präsentation + GetStatusType = cStPraesentation ' presentation case frmDraw - GetStatusType = cStZeichnen 'Zeichnen + GetStatusType = cStZeichnen ' drawing case frmMath - GetStatusType = cStMath 'Formel - case frmImage - GetStatusType = cStBild 'Bild + GetStatusType = cStMath ' formula case frmHyperText - GetStatusType = cStHTML 'Hypertext-Dokument + GetStatusType = cStHTML ' HTML document case frmChart - GetStatusType = cStChart 'Diagramm + GetStatusType = cStChart ' chart case frmJava GetStatusType = cStJava 'Java case frmDataBase diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index 56a8d130fc13..c48f564cd447 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -30,8 +30,8 @@ const sSWLogFileName = "swlog.dat", sSCLogFileName = "sclog.dat" const sSDLogFileName = "sdlog.dat", sSMathLogFileName = "smalog.dat" -const sSImDLogFileName = "simlog.dat", sSChartLogFileName = "schlog.dat" -const sSHptLogFileName = "shptlog.dat", sSMessageLogFileName = "smeslog.dat" +const sSChartLogFileName = "schlog.dat" +const sSHptLogFileName = "shptlog.dat" const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" const sLogFileName = "log.dat" @@ -107,18 +107,12 @@ Sub DeleteAllLogFiles() If FileExists (sWorkPath+sSMathLogFileName) then Kill (sWorkPath+sSMathLogFileName) End If - If FileExists (sWorkPath+sSImDLogFileName) then - Kill (sWorkPath+sSImDLogFileName) - End If If FileExists (sWorkPath+sSChartLogFileName) then Kill (sWorkPath+sSChartLogFileName) End If If FileExists (sWorkPath+sSHptLogFileName) then Kill (sWorkPath+sSHptLogFileName) End If - If FileExists (sWorkPath+sSMessageLogFileName) then - Kill (sWorkPath+sSMessageLogFileName) - End If If FileExists (sWorkPath+sSDrawLogFileName) then Kill (sWorkPath+sSDrawLogFileName) End If @@ -321,7 +315,7 @@ end Sub Sub MakeDocTest (FilterType as Integer) Dim oDoc as Object Dim sFileNameXML$, sFileName8$ - Dim bError as Boolean + Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR @@ -343,13 +337,11 @@ Sub MakeDocTest (FilterType as Integer) sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFltXML) SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML)) end if -' oDoc.dispose nCurrentAction = cDocClose - oDoc.close (true) -' bError = true ' nur zum ¦bergang, weil bError = oDoc.CurrentController.frame.close nicht geht -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) -' SetStatus (FilterType, cDocClose, bError) + bSuccess = CloseDoc( oDoc ) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) + SetStatus (FilterType, cDocClose, bSuccess) nCurrentAction = cDocSaveOpen8 if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then oDoc = LoadDoc (sFileName8) @@ -360,7 +352,6 @@ Sub MakeDocTest (FilterType as Integer) SetStatus (FilterType, cDocSaveOpen8, not IsNull (oDoc)) if not IsNull (oDoc) then -' oDoc.dispose nCurrentAction = cDocClose oDoc.close (true) end If @@ -376,7 +367,6 @@ Sub MakeDocTest (FilterType as Integer) SetStatus (FilterType, cDocSaveOpenXML, not IsNull (oDoc)) if not IsNull (oDoc) then -' oDoc.dispose nCurrentAction = cDocClose oDoc.close (true) end If @@ -402,7 +392,7 @@ End Sub Sub MakeNewDoc (FilterType as Integer) DIM oDoc as Object - Dim bError as Boolean + Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR2 nCurrentAction = cLogfileFailed @@ -415,12 +405,10 @@ Sub MakeNewDoc (FilterType as Integer) SetStatus (FilterType, cDocNew, not IsNull (oDoc)) if not IsNull (oDoc) then nCurrentAction = cDocClose -' oDoc.dispose - oDoc.close (true) -' bError = true ' nur zum ¦bergang, weil bError = oDoc.CurrentController.frame.close nicht geht -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) -' SetStatus (FilterType, cDocClose, bError) + bSuccess = CloseDoc( oDoc ) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) + SetStatus (FilterType, cDocClose, bSuccess) end If Print #FileChannel, "---" Close #FileChannel% @@ -445,7 +433,7 @@ Sub MakeChartTest (FilterType as Integer) Dim oRange(0) as New com.sun.star.table.CellRangeAddress Dim oRect as New com.sun.star.awt.Rectangle const cChartName="TestChart" - Dim bError as Boolean + Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo CHARTTESTERROR nCurrentAction = cLogfileFailed @@ -455,11 +443,10 @@ Sub MakeChartTest (FilterType as Integer) if not IsNull (oDoc) then oCharts = oDoc.sheets(0).Charts oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) - bError=oCharts.HasByName(cChartName) - LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, bError) -' oDoc.dispose + bSuccess=oCharts.HasByName(cChartName) + LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) + LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) + SetStatus (FilterType, cDocNew, bSuccess) nCurrentAction = cDocClose oDoc.close (true) else @@ -520,48 +507,44 @@ end Function Function GetDocFilter (DocType as Integer) as String Select Case ( DocType ) case frmWriter or cFlt8 - GetDocFilter = "writer8" ' Textdokument + GetDocFilter = "writer8" ' text document case frmCalc or cFlt8 - GetDocFilter = "calc8" 'Tabellendokument + GetDocFilter = "calc8" ' spreadsheet document case frmImpress or cFlt8 - GetDocFilter = "impress8" 'Präsentation + GetDocFilter = "impress8" ' presentation case frmDraw or cFlt8 - GetDocFilter = "draw8" 'Zeichen + GetDocFilter = "draw8" ' drawing case frmMath or cFlt8 - GetDocFilter = "math8" 'Formel + GetDocFilter = "math8" ' formula case frmWriter or cFltXML - GetDocFilter = "StarOffice XML (Writer)" ' Textdokument + GetDocFilter = "StarOffice XML (Writer)" ' text document case frmCalc or cFltXML - GetDocFilter = "StarOffice XML (Calc)" 'Tabellendokument + GetDocFilter = "StarOffice XML (Calc)" ' spreadsheet document case frmImpress or cFltXML - GetDocFilter = "StarOffice XML (Impress)" 'Präsentation + GetDocFilter = "StarOffice XML (Impress)" ' presentation case frmDraw or cFltXML - GetDocFilter = "StarOffice XML (Draw)" 'Zeichen + GetDocFilter = "StarOffice XML (Draw)" ' drawing case frmMath or cFltXML - GetDocFilter = "StarOffice XML (Math)" 'Formel + GetDocFilter = "StarOffice XML (Math)" ' formula case frmHyperText, frmHyperText or cFltXML - GetDocFilter = "HTML" 'Hypertext-Dokument + GetDocFilter = "HTML" ' HTML document case frmWriter or cFltNewDoc - GetDocFilter = "swriter" ' Textdokument + GetDocFilter = "swriter" ' text document case frmCalc or cFltNewDoc - GetDocFilter = "scalc" 'Tabellendokument - case frmMessage or cFltNewDoc - GetDocFilter = "Message" 'Nachricht + GetDocFilter = "scalc" ' spreadsheet document case frmImpress or cFltNewDoc - GetDocFilter = "simpress" 'Präsentation + GetDocFilter = "simpress" ' presentation case frmDraw or cFltNewDoc - GetDocFilter = "sdraw" 'Zeichen + GetDocFilter = "sdraw" ' drawing case frmMath or cFltNewDoc - GetDocFilter = "smath" 'Formel - case frmImage or cFltNewDoc - GetDocFilter = "simage" 'Bild + GetDocFilter = "smath" ' formula case frmHyperText or cFltNewDoc - GetDocFilter = "swriter/web" 'Hypertext-Dokument + GetDocFilter = "swriter/web" ' HTML document case frmChart or cFltNewDoc - GetDocFilter = "schart" 'Diagramm + GetDocFilter = "schart" ' chart case else GetDocFilter = "" end Select @@ -570,23 +553,19 @@ end Function Function GetLogFileName (DocType as Integer) as String Select Case ( DocType ) case frmWriter - GetLogFileName = sSWLogFileName ' Textdokument + GetLogFileName = sSWLogFileName ' text document case frmCalc - GetLogFileName = sSCLogFileName 'Tabellendokument - case frmMessage - GetLogFileName = sSMessageLogFileName 'Nachricht + GetLogFileName = sSCLogFileName ' spreadsheet document case frmImpress - GetLogFileName = sSDLogFileName 'PrÕsentation + GetLogFileName = sSDLogFileName ' presentation case frmDraw - GetLogFileName = sSDrawLogFileName 'Zeichnen + GetLogFileName = sSDrawLogFileName ' drawing case frmMath - GetLogFileName = sSMathLogFileName 'Formel - case frmImage - GetLogFileName = sSImDLogFileName 'Bild + GetLogFileName = sSMathLogFileName ' formula case frmHyperText - GetLogFileName = sSHptLogFileName 'Hypertext-Dokument + GetLogFileName = sSHptLogFileName ' HTML document case frmChart - GetLogFileName = sSChartLogFileName 'Diagramm + GetLogFileName = sSChartLogFileName ' chart case frmJava GetLogFileName = sJavaLogFileName 'Java case frmDataBase @@ -694,4 +673,19 @@ Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string ) MessageBox "Filtername is unknown!" end if end Sub + +Function CloseDoc( oDoc as Object ) + Dim oListener as Object + oListener = CreateUnoListener( "Events.closeListener_", "com.sun.star.util.XCloseListener" ) + oDoc.addCloseListener( oListener ) + + Events.ResetCloseListenerFlag() + oDoc.close( true ) + closeDoc = Events.HasCloseListenerBeenCalled() + + if ( Not Events.HasCloseListenerBeenCalled() ) Then + ' do this only if closing was not successful - otherwise, we'd get a DisposedException + oDoc.removeCloseListener( oListener ) + End If +End Function diff --git a/smoketestoo_native/data/content.xml b/smoketestoo_native/data/content.xml index dcd31b1759e4..3c81bbfbad5e 100644 --- a/smoketestoo_native/data/content.xml +++ b/smoketestoo_native/data/content.xml @@ -25,4 +25,89 @@ * for a copy of the LGPLv3 License. * **********************************************************************--> -stardiv.one.form.control.CommandButtonstardiv.one.form.control.CommandButtonstardiv.one.form.control.CommandButton + + + + + + + + + + + + + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From 325b08b894be41b87f353010156ce38b9a1cfaee Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:00 +0100 Subject: debuglevels: capture assertions during the test run, let the test fail in case we encounter an assertion. Still missing: Refactor the tests so that the currently running test case ("open doc", "save doc", etc.) is known in the assertion handler, so we can mark the proper test case as "failed". Currently, the "new doc" case is marked, which is wrong. --- smoketestoo_native/data/Global.xml | 29 ++++++- smoketestoo_native/data/Test_10er.xml | 140 ++++++++++++++++------------------ smoketestoo_native/data/Test_DB.xml | 38 +++------ smoketestoo_native/data/Test_Ext.xml | 26 +++---- 4 files changed, 111 insertions(+), 122 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index e80ded136725..3569343530ba 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -126,7 +126,14 @@ Sub ClearAllText call ClearStatus end Sub +Sub AssertionHandler( sMessage as String ) + LogTestResult( cDocNew, "assertion caught: " + sMessage, FALSE ) + 'TODO: get the proper test case number +End Sub + Sub Main + CaptureAssertions( "AssertionHandler" ) + call SetGlobalDoc if bShowTable then call ClearDoc (gOutPutDoc) @@ -143,6 +150,8 @@ Sub Main call CreateSecondState gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage end if + + CaptureAssertions( "" ) End Sub Sub CreateStatusTable @@ -362,10 +371,21 @@ Function GetRangeName (nColumn as integer, nRow as integer) as string GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) end Function -Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean) +Sub LogTestResult( nTestCase as Integer, sTestCaseDescription as String, bSuccess as Boolean ) + If ( nTestCase = cLogfileFailed ) Then + LogState( FALSE, "creating logfile '" + GetLogFileName( g_CurrentDocTest ) + "' failed", MainFileChannel ) + SetStatus( 0, FALSE ) + Else + LogState( bSuccess, sTestCaseDescription, FileChannel ) + LogState( bSuccess, sTestCaseDescription, MainFileChannel ) + SetStatus( nTestCase, bSuccess ) + End If +End Sub + +Sub SetStatus( nAction as Integer, bState as Boolean ) Dim nStatusType as Integer Dim nState as integer - nStatusType = GetStatusType (nDocType) + nStatusType = GetStatusType( g_CurrentDocTest ) If nStatusType = cStNone then Exit Sub if bState then @@ -374,6 +394,11 @@ Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean) nState = cLogFalse end If + If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then + ' don't overwrite a previous "failed" state for this this + nState = cLogFalse + End If + gErrorState (nStatusType, nAction) = nState end Sub diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index c48f564cd447..b586d9ba4bd1 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -42,6 +42,8 @@ const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" const cMessageNewDoc = "New Document" const cMessageCloseDoc = "Close Document" +Global g_CurrentDocTest As Integer + Global sWorkPath$ Global sWorkPathURL$ Global FileChannel% @@ -193,34 +195,44 @@ DIM nStrPos as Long MainFileChannel = OpenLogDat (sLogFileName) call WriteTestSequence (MainFileChannel) if bMakeWriterTest then - call MakeDocTest (frmWriter) + g_CurrentDocTest = frmWriter + call MakeDocTest end if if bMakeCalcTest then - call MakeDocTest (frmCalc) + g_CurrentDocTest = frmCalc + call MakeDocTest end if if bMakeImpressTest then - call MakeDocTest (frmImpress) + g_CurrentDocTest = frmImpress + call MakeDocTest end if if bMakeDrawTest then - call MakeDocTest (frmDraw) + g_CurrentDocTest = frmDraw + call MakeDocTest end if if bMakeHTMLTest then - call MakeDocTest (frmHyperText) + g_CurrentDocTest = frmHyperText + call MakeDocTest end if if bMakeChartTest then - call MakeChartTest (frmChart) + g_CurrentDocTest = frmChart + call MakeChartTest end if if bMakeMathTest then - call MakeNewDoc (frmMath) + g_CurrentDocTest = frmMath + call MakeNewDoc end if if bMakeJavaTest then - call TestJava (frmJava) + g_CurrentDocTest = frmJava + call TestJava end if if bMakeDBTest then - call Test_DB.TestDB (frmDataBase) + g_CurrentDocTest = frmDataBase + call Test_DB.TestDB end if if bMakeExtensionTest then - call Test_Ext.TestExtensions (frmExtension) + g_CurrentDocTest = frmExtension + call Test_Ext.TestExtensions end if Close #MainFileChannel @@ -312,7 +324,7 @@ Sub WriteExtensionTests (sText as string, nFileChannel as integer) Print #nFileChannel, sWriteStr end Sub -Sub MakeDocTest (FilterType as Integer) +Sub MakeDocTest Dim oDoc as Object Dim sFileNameXML$, sFileName8$ Dim bSuccess as Boolean @@ -320,36 +332,30 @@ Sub MakeDocTest (FilterType as Integer) On Local Error GoTo DOCTESTERROR nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) nCurrentAction = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(FilterType or cFltNewDoc)) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oDoc)) - if not IsNull (oDoc) then - nCurrentAction = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then - sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFlt8) - SaveDoc (sFileName8, oDoc, GetDocFilter(FilterType or cFlt8)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) + LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + if not IsNull (oDoc) then + nCurrentAction = 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)) end if nCurrentAction = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then - sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFltXML) - SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML)) + 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)) end if nCurrentAction = cDocClose bSuccess = CloseDoc( oDoc ) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) - SetStatus (FilterType, cDocClose, bSuccess) + LogTestResult( cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) nCurrentAction = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then + if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then oDoc = LoadDoc (sFileName8) ' oDoc = Documents.open(sFileName) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, FileChannel) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, MainFileChannel) - SetStatus (FilterType, cDocSaveOpen8, not IsNull (oDoc)) + LogTestResult(cDocSaveOpen8, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then nCurrentAction = cDocClose @@ -358,13 +364,11 @@ Sub MakeDocTest (FilterType as Integer) end if nCurrentAction = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then + if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then oDoc = LoadDoc (sFileNameXML) ' oDoc = Documents.open(sFileName) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, FileChannel) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, MainFileChannel) - SetStatus (FilterType, cDocSaveOpenXML, not IsNull (oDoc)) + LogTestResult(cDocSaveOpenXML, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then nCurrentAction = cDocClose @@ -379,36 +383,30 @@ Sub MakeDocTest (FilterType as Integer) DOCTESTERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FileChannel) - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult(nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) Close #FileChannel% End If Exit Sub ' With error End Sub -Sub MakeNewDoc (FilterType as Integer) +Sub MakeNewDoc DIM oDoc as Object Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR2 nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) nCurrentAction = cDocNew -' oDoc = Documents.Add(GetDocFilter(FilterType)) - oDoc = LoadDoc ("private:factory/" + GetDocFilter(FilterType or cFltNewDoc)) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oDoc)) +' oDoc = Documents.Add(GetDocFilter(g_CurrentDocTest)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) + LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then nCurrentAction = cDocClose bSuccess = CloseDoc( oDoc ) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) - SetStatus (FilterType, cDocClose, bSuccess) + LogTestResult(cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If Print #FileChannel, "---" Close #FileChannel% @@ -416,43 +414,37 @@ Sub MakeNewDoc (FilterType as Integer) DOCTESTERROR2: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FileChannel) - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) Close #FileChannel% End If Exit Sub ' With error End Sub -Sub MakeChartTest (FilterType as Integer) +Sub MakeChartTest Dim oCharts as Object Dim oDoc as Object Dim oRange(0) as New com.sun.star.table.CellRangeAddress Dim oRect as New com.sun.star.awt.Rectangle const cChartName="TestChart" - Dim bSuccess as Boolean - Dim nCurrentAction as Integer - On Local Error GoTo CHARTTESTERROR - nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) - nCurrentAction = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) + Dim bSuccess as Boolean + Dim nCurrentAction as Integer + On Local Error GoTo CHARTTESTERROR + nCurrentAction = cLogfileFailed + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) + nCurrentAction = 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) - LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, bSuccess) + LogTestResult( cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) nCurrentAction = cDocClose oDoc.close (true) else - LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (frmCalc, cDocNew, not IsNull (oDoc)) + LogTestResult( cDocNew, GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if Print #FileChannel, "---" Close #FileChannel% @@ -460,12 +452,10 @@ Sub MakeChartTest (FilterType as Integer) CHARTTESTERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FileChannel) - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FALSE ) Close #FileChannel% End If Exit Sub ' With error @@ -599,13 +589,11 @@ Function IsFilterAvailable (FilterType as Integer) as boolean end if End Function -Function TestJava (FilterType as Integer) as boolean +Function TestJava Dim oObj as Object - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) oObj = createUnoService(cUnoJavaLoader) - LogState (not IsNull (oObj), "Java "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oObj), "Java "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oObj)) + LogTestResult( cDocNew, "Java "+ cMessageNewDoc, not IsNull (oObj) ) Print #FileChannel, "---" Close #FileChannel% diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 34ade11f75fb..56e55e846c3a 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -35,7 +35,7 @@ const cMessageDatabaseDelete = "Delete record from Database" const cMessageDatabaseSeek = "Read other record from Database" const cMessageDatabaseClose = "Close Database" -Sub TestDB (FilterType as Integer) +Sub TestDB Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object Dim sDBName as String, sTable as String, sCurrentMessage as String @@ -47,7 +47,7 @@ Const sTestString = "Automatical Test" On Local Error GoTo DBERROR nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) nCurrentAction = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext @@ -62,9 +62,7 @@ Const sTestString = "Automatical Test" sTable=oDataSource.Tables.ElementNames(0) oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") - LogState (not IsNull (oDBConnection), "Database "+ cMessageDatabaseOpen, FileChannel) - LogState (not IsNull (oDBConnection), "Database "+ cMessageDatabaseOpen, MainFileChannel) - SetStatus (FilterType, cDBOpen, not IsNull (oDBConnection)) + LogTestResult( cDBOpen, "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then Close #FileChannel% Exit Sub @@ -77,14 +75,10 @@ Const sTestString = "Automatical Test" oRowSet = createUnoService(cUnoRowSet) if (IsNull(oRowSet)) then - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService + " " + cUnoRowSet, FileChannel) - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService + " " + cUnoRowSet, MainFileChannel) - SetStatus (FilterType, cDBService, not IsNull (oRowSet)) + LogTestResult( cDBService, "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) Exit Sub else - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService, FileChannel) - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService, MainFileChannel) - SetStatus (FilterType, cDBService, not IsNull (oRowSet)) + LogTestResult( cDBService, "Database "+ cMessageDatabaseService, TRUE ) End If nCurrentAction = cDBInsert @@ -105,9 +99,7 @@ Const sTestString = "Automatical Test" oRowSet.moveToCurrentRow() bResult = (oRowSet.getString(5) = sTestString) - LogState (bResult, "Database "+ cMessageDatabaseInsert, FileChannel) - LogState (bResult, "Database "+ cMessageDatabaseInsert, MainFileChannel) - SetStatus (FilterType, cDBInsert, bResult) + LogTestResult( cDBInsert, "Database "+ cMessageDatabaseInsert, bResult ) 'delete only if insert passed @@ -120,9 +112,7 @@ Const sTestString = "Automatical Test" oRowSet.next() bResult = (nRowCount - oRowSet.RowCount = 1) End If - LogState (bResult, "Database "+ cMessageDatabaseDelete, FileChannel) - LogState (bResult, "Database "+ cMessageDatabaseDelete, MainFileChannel) - SetStatus (FilterType, cDBDelete, bResult) + LogTestResult( cDBDelete, "Database "+ cMessageDatabaseDelete, bResult ) End If ' read other record @@ -131,16 +121,12 @@ Const sTestString = "Automatical Test" sCurrentMessage = cMessageDatabaseSeek oRowSet.first() bResult = not (oRowSet.getString(5) = sTestString) - LogState (bResult, "Database "+ cMessageDatabaseSeek, FileChannel) - LogState (bResult, "Database "+ cMessageDatabaseSeek, MainFileChannel) - SetStatus (FilterType, cDBSeek, bResult) + LogTestResult( cDBSeek, "Database "+ cMessageDatabaseSeek, bResult ) nCurrentAction = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() - LogState (True, "Database "+ cMessageDatabaseClose, FileChannel) - LogState (True, "Database "+ cMessageDatabaseClose, MainFileChannel) - SetStatus (FilterType, cDBClose, True) + LogTestResult( cDBClose, "Database "+ cMessageDatabaseClose, True ) Print #FileChannel, "---" Close #FileChannel% @@ -148,12 +134,10 @@ Const sTestString = "Automatical Test" DBERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDBOpen, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, "Database "+ sCurrentMessage, FileChannel) - LogState (False, "Database "+ sCurrentMessage, MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, "Database "+ sCurrentMessage, FALSE ) Close #FileChannel% End If Exit Sub ' With error diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml index 31d27dc7a4a7..534917f02eac 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestoo_native/data/Test_Ext.xml @@ -32,7 +32,7 @@ const cMessageExtensionService = "Extension Service" const cMessageExtensionInstall = "Install Extension" const cMessageExtensionUninstall = "Uninstall Extension" -Sub TestExtensions (FilterType as Integer) +Sub TestExtensions Dim oTestExtension as Object, obj_null as Object Dim sCurrentMessage as String Dim nCurrentAction as Integer @@ -43,7 +43,7 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q On Local Error GoTo EXTERROR nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) sCurrentMessage = cMessageExtensionService nCurrentAction = cEXTService @@ -58,11 +58,9 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q ctx = getDefaultContext ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) - LogState (not IsNull (ext_mgr), "Extension "+ cMessageExtensionService, FileChannel) - LogState (not IsNull (ext_mgr), "Extension "+ cMessageExtensionService, MainFileChannel) - SetStatus (FilterType, cEXTService, not IsNull (ext_mgr)) + LogTestResult( cEXTService, "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then - Close #FileChannel% + Close #FileChannel% Exit Sub End If @@ -79,11 +77,9 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q 'Check if the extension has been added by creating a service which is contained in the extension. oTestExtension = createUnoService(cUnoSmoketestTestExtension) bResult = (oTestExtension.getImplementationName = sImplementationNameString) - LogState (bResult, "Extension "+ cMessageExtensionInstall, FileChannel) - LogState (bResult, "Extension "+ cMessageExtensionInstall, MainFileChannel) - SetStatus (FilterType, cEXTInstall, bResult) + LogTestResult( cEXTInstall, "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then - Close #FileChannel% + Close #FileChannel% Exit Sub End If @@ -97,9 +93,7 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q oTestExtension = createUnoService(cUnoSmoketestTestExtension) 'The service must not be available anymore. Therefor isNull must return true. - LogState (IsNull (oTestExtension), "Extension "+ cMessageExtensionUninstall, FileChannel) - LogState (IsNull (oTestExtension), "Extension "+ cMessageExtensionUninstall, MainFileChannel) - SetStatus (FilterType, cEXTUninstall, IsNull (oTestExtension)) + LogTestResult( cEXTUninstall, "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) Print #FileChannel, "---" Close #FileChannel% @@ -107,12 +101,10 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q EXTERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cEXTService, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, "Extension "+ sCurrentMessage, FileChannel) - LogState (False, "Extension "+ sCurrentMessage, MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, "Extension "+ sCurrentMessage, False ) Close #FileChannel% End If Exit Sub ' With error -- cgit From 2b35c388bb80f1d7739afec38dbc842240babbdd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: make the current test case a global variable, so the AssertionHandler can use it --- smoketestoo_native/data/Global.xml | 12 +++--- smoketestoo_native/data/Test_10er.xml | 77 +++++++++++++++++------------------ smoketestoo_native/data/Test_DB.xml | 47 +++++++++++---------- smoketestoo_native/data/Test_Ext.xml | 31 +++++++------- 4 files changed, 82 insertions(+), 85 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index 3569343530ba..5da3617fad9b 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -53,6 +53,9 @@ global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 global const frmDataBase = 10, frmJava = 13 global const frmExtension = 14 +Global g_CurrentDocTest As Integer +Global g_CurrentTestCase As Integer + global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 'UserFieldKennungen @@ -127,8 +130,7 @@ Sub ClearAllText end Sub Sub AssertionHandler( sMessage as String ) - LogTestResult( cDocNew, "assertion caught: " + sMessage, FALSE ) - 'TODO: get the proper test case number + LogTestResult( "assertion caught: " + sMessage, FALSE ) End Sub Sub Main @@ -371,14 +373,14 @@ Function GetRangeName (nColumn as integer, nRow as integer) as string GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) end Function -Sub LogTestResult( nTestCase as Integer, sTestCaseDescription as String, bSuccess as Boolean ) - If ( nTestCase = cLogfileFailed ) Then +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 ) Else LogState( bSuccess, sTestCaseDescription, FileChannel ) LogState( bSuccess, sTestCaseDescription, MainFileChannel ) - SetStatus( nTestCase, bSuccess ) + SetStatus( g_CurrentTestCase, bSuccess ) End If End Sub diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index b586d9ba4bd1..84a8321deced 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -42,8 +42,6 @@ const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" const cMessageNewDoc = "New Document" const cMessageCloseDoc = "Close Document" -Global g_CurrentDocTest As Integer - Global sWorkPath$ Global sWorkPathURL$ Global FileChannel% @@ -328,50 +326,49 @@ Sub MakeDocTest Dim oDoc as Object Dim sFileNameXML$, sFileName8$ Dim bSuccess as Boolean - Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDocNew + g_CurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) - if not IsNull (oDoc) then - nCurrentAction = cDocSaveOpen8 + LogTestResult( GetDocFilter(g_CurrentDocTest 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)) end if - nCurrentAction = cDocSaveOpenXML + 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)) end if - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult( cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - nCurrentAction = cDocSaveOpen8 + LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + g_CurrentTestCase = cDocSaveOpen8 if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then oDoc = LoadDoc (sFileName8) ' oDoc = Documents.open(sFileName) - LogTestResult(cDocSaveOpen8, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose oDoc.close (true) end If end if - nCurrentAction = cDocSaveOpenXML + g_CurrentTestCase = cDocSaveOpenXML if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then oDoc = LoadDoc (sFileNameXML) ' oDoc = Documents.open(sFileName) - LogTestResult(cDocSaveOpenXML, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose oDoc.close (true) end If end if @@ -382,11 +379,11 @@ Sub MakeDocTest Exit Sub ' Without error DOCTESTERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult(nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) Close #FileChannel% End If Exit Sub ' With error @@ -395,29 +392,28 @@ End Sub Sub MakeNewDoc DIM oDoc as Object Dim bSuccess as Boolean - Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR2 - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDocNew + g_CurrentTestCase = cDocNew ' oDoc = Documents.Add(GetDocFilter(g_CurrentDocTest)) oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult(cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error DOCTESTERROR2: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) Close #FileChannel% End If Exit Sub ' With error @@ -430,32 +426,31 @@ Sub MakeChartTest Dim oRect as New com.sun.star.awt.Rectangle const cChartName="TestChart" Dim bSuccess as Boolean - Dim nCurrentAction as Integer On Local Error GoTo CHARTTESTERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDocNew + g_CurrentTestCase = 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( cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) - nCurrentAction = cDocClose + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) + g_CurrentTestCase = cDocClose oDoc.close (true) else - LogTestResult( cDocNew, GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) + LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error CHARTTESTERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FALSE ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), FALSE ) Close #FileChannel% End If Exit Sub ' With error @@ -591,9 +586,11 @@ End Function Function TestJava Dim oObj as Object + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - oObj = createUnoService(cUnoJavaLoader) - LogTestResult( cDocNew, "Java "+ cMessageNewDoc, not IsNull (oObj) ) + g_CurrentTestCase = cDocNew + oObj = createUnoService( cUnoJavaLoader ) + LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) Print #FileChannel, "---" Close #FileChannel% diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 56e55e846c3a..512a1abb1214 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -37,32 +37,31 @@ const cMessageDatabaseClose = "Close Database" Sub TestDB -Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object -Dim sDBName as String, sTable as String, sCurrentMessage as String -Dim nRowCount as Integer, nCurrentAction as Integer -Dim bResult as Boolean -Const sTestString = "Automatical Test" - + Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object + Dim sDBName as String, sTable as String, sCurrentMessage as String + Dim nRowCount as Integer + Dim bResult as Boolean + Const sTestString = "Automatical Test" On Local Error GoTo DBERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDBService + g_CurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext oDBContext = CreateUnoService(cUnoDatabaseContext) sDBName=oDBContext.ElementNames(0) 'Names of Databases - nCurrentAction = cDBOpen + g_CurrentTestCase = cDBOpen sCurrentMessage = cMessageDatabaseOpen oDataSource = oDBContext.GetByName(sDBName) sTable=oDataSource.Tables.ElementNames(0) oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") - LogTestResult( cDBOpen, "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) + LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then Close #FileChannel% Exit Sub @@ -70,18 +69,18 @@ Const sTestString = "Automatical Test" ' Database is open now - nCurrentAction = cDBService + g_CurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet oRowSet = createUnoService(cUnoRowSet) if (IsNull(oRowSet)) then - LogTestResult( cDBService, "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) + LogTestResult( "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) Exit Sub else - LogTestResult( cDBService, "Database "+ cMessageDatabaseService, TRUE ) + LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) End If - nCurrentAction = cDBInsert + g_CurrentTestCase = cDBInsert sCurrentMessage = cMessageDatabaseInsert oRowSet.ActiveConnection = oDBConnection @@ -99,12 +98,12 @@ Const sTestString = "Automatical Test" oRowSet.moveToCurrentRow() bResult = (oRowSet.getString(5) = sTestString) - LogTestResult( cDBInsert, "Database "+ cMessageDatabaseInsert, bResult ) + LogTestResult( "Database "+ cMessageDatabaseInsert, bResult ) 'delete only if insert passed if (bResult) Then - nCurrentAction = cDBDelete + g_CurrentTestCase = cDBDelete sCurrentMessage = cMessageDatabaseDelete oRowSet.deleteRow() bResult = (nRowCount - oRowSet.RowCount = 0) @@ -112,32 +111,32 @@ Const sTestString = "Automatical Test" oRowSet.next() bResult = (nRowCount - oRowSet.RowCount = 1) End If - LogTestResult( cDBDelete, "Database "+ cMessageDatabaseDelete, bResult ) + LogTestResult( "Database "+ cMessageDatabaseDelete, bResult ) End If ' read other record - nCurrentAction = cDBSeek + g_CurrentTestCase = cDBSeek sCurrentMessage = cMessageDatabaseSeek oRowSet.first() bResult = not (oRowSet.getString(5) = sTestString) - LogTestResult( cDBSeek, "Database "+ cMessageDatabaseSeek, bResult ) + LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) - nCurrentAction = cDBClose + g_CurrentTestCase = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() - LogTestResult( cDBClose, "Database "+ cMessageDatabaseClose, True ) + LogTestResult( "Database "+ cMessageDatabaseClose, True ) Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error DBERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, "Database "+ sCurrentMessage, FALSE ) + LogTestResult( "Database "+ sCurrentMessage, FALSE ) Close #FileChannel% End If Exit Sub ' With error diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml index 534917f02eac..9d3931643658 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestoo_native/data/Test_Ext.xml @@ -33,20 +33,19 @@ const cMessageExtensionInstall = "Install Extension" const cMessageExtensionUninstall = "Uninstall Extension" Sub TestExtensions -Dim oTestExtension as Object, obj_null as Object -Dim sCurrentMessage as String -Dim nCurrentAction as Integer -Dim bResult as Boolean -Dim sImplementationNameString as String -sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" + Dim oTestExtension as Object, obj_null as Object + Dim sCurrentMessage as String + Dim bResult as Boolean + Dim sImplementationNameString as String + sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" On Local Error GoTo EXTERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) sCurrentMessage = cMessageExtensionService - nCurrentAction = cEXTService + g_CurrentTestCase = cEXTService 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for 'adding the extension. The implementation is in @@ -58,14 +57,14 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q ctx = getDefaultContext ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) - LogTestResult( cEXTService, "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) + LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then Close #FileChannel% Exit Sub End If sCurrentMessage = cMessageExtensionInstall - nCurrentAction = cEXTInstall + g_CurrentTestCase = cEXTInstall 'Add the extension. We must provide a file URL here. 'By passing "user" we determine that the actions we perform on @@ -77,14 +76,14 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q 'Check if the extension has been added by creating a service which is contained in the extension. oTestExtension = createUnoService(cUnoSmoketestTestExtension) bResult = (oTestExtension.getImplementationName = sImplementationNameString) - LogTestResult( cEXTInstall, "Extension "+ cMessageExtensionInstall, bResult ) + LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then Close #FileChannel% Exit Sub End If sCurrentMessage = cMessageExtensionUninstall - nCurrentAction = cEXTUninstall + g_CurrentTestCase = cEXTUninstall 'Remove the package ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) @@ -93,18 +92,18 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q oTestExtension = createUnoService(cUnoSmoketestTestExtension) 'The service must not be available anymore. Therefor isNull must return true. - LogTestResult( cEXTUninstall, "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) + LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error EXTERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, "Extension "+ sCurrentMessage, False ) + LogTestResult( "Extension "+ sCurrentMessage, False ) Close #FileChannel% End If Exit Sub ' With error -- cgit From 2af2e7681a5e6c9a5cf854741454fce8c4696afa Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: also log errors during the test's glue code (well, assertions, at least) --- smoketestoo_native/data/Global.xml | 365 ++++++++++++++++++++-------------- smoketestoo_native/data/Test_10er.xml | 178 +++++++++-------- smoketestoo_native/data/Test_DB.xml | 31 +-- smoketestoo_native/data/Test_Ext.xml | 26 ++- 4 files changed, 339 insertions(+), 261 deletions(-) mode change 100644 => 100755 smoketestoo_native/data/Global.xml (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml old mode 100644 new mode 100755 index 5da3617fad9b..a412b9d2259c --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -28,7 +28,7 @@ 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 -- cgit From d4526842788adf0dcdaacc19f5c53bf9717b3d58 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: make dialog somewhat more usable --- smoketestoo_native/data/OptionsDlg.xml | 43 ++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml index 213c880d4d51..942500f61d71 100644 --- a/smoketestoo_native/data/OptionsDlg.xml +++ b/smoketestoo_native/data/OptionsDlg.xml @@ -28,35 +28,38 @@ - + - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + - + - + - - - - -- cgit From 77acab01ada07c352cd85383240b8281ef591064 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: removed the dead code and UI for binary file formats - no tests existed for this --- smoketestoo_native/data/Global.xml | 137 +++++++++++---------------------- smoketestoo_native/data/OptionsDlg.xml | 1 - 2 files changed, 43 insertions(+), 95 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index a412b9d2259c..d437eafe3457 100755 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -35,7 +35,7 @@ const cParagraphBreak = 0 global const cExtensionFileName = "TestExtension.oxt" -global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4 +global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3 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 @@ -89,7 +89,7 @@ Global const cUserFieldTestWriter = "Writer", cUserFieldTestCalc = &qu Global const cUserFieldTestDraw = "Draw", cUserFieldTestMath = "Math", cUserFieldTestChart = "Chart" Global const cUserFieldTestHTML = "HTML", cUserFieldTestJava = "Java", cUserFieldTestDatabase = "Database" Global const cUserFieldTestExtension = "Extension" -Global const cUserFieldTestOpenSaveXML = "SaveOpenXML", cUserFieldTestOpenSave50 = "SaveOpen50" +Global const cUserFieldTestOpenSaveXML = "SaveOpenXML" Global const cUserFieldTestTerminateAfterTest = "Terminate", cUserFieldTestOpenSave8 = "SaveOpen8" Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "Standard" @@ -107,7 +107,7 @@ Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest a Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean Global bMakeExtensionTest as boolean -Global bMakeSaveOpenXMLTest as boolean, bMakeSaveOpen50Test as boolean +Global bMakeSaveOpenXMLTest as boolean Global bMakeTerminateAfterTest as boolean, bShowTable as boolean Global bMakeSaveOpen8Test as boolean @@ -139,11 +139,12 @@ Sub AssertionHandler( sMessage as String ) End Sub Sub Main - CaptureAssertions( "AssertionHandler" ) - gCurrentDocTest = frmTestGlue gCurrentTestCase = cOtherSetupDoc + On Local Error Goto MainError + CaptureAssertions( "AssertionHandler" ) + call SetGlobalDoc Dim bWasModified as Boolean @@ -155,14 +156,18 @@ Sub Main call ClearStatus + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + Call Test_10er.Main + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherWriteStatus if bShowTable then - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherWriteStatus call CreateStatusTable2 call CreateStatusTable call CreateDocState + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + ' do this LogTestResult call before CreateSecondState, since the latter accesses (and displays) the result call CreateSecondState gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage end if @@ -170,8 +175,23 @@ Sub Main gOutputDoc.setModified( bWasModified ) CaptureAssertions( "" ) + Exit Sub + +MainError: + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), FALSE ) End Sub +Function GetTestGlueDescription( nTestCase as Integer ) + Select Case ( nTestCase ) + case cOtherSetupDoc + GetTestGlueDescription = "setup test document" + case cOtherWriteStatus + GetTestGlueDescription = "write test status" + case Else + GetTestGlueDescription = "" + End Select +End Function + Sub CreateStatusTable dim tableHeaders(7) as string tableHeaders(cStWriter) = "Writer" @@ -183,11 +203,10 @@ Sub CreateStatusTable tableHeaders(cStHTML) = "HTML" tableHeaders(cStJava) = "Java" - dim tableRows(4) as string + dim tableRows(3) as string tableRows(cDocNew) = "new" tableRows(cDocSaveOpen8) = "V8.0" tableRows(cDocSaveOpenXML) = "XML" - tableRows(cDocSaveOpen50) = "V5.0" tableRows(cDocClose) = "close" aDoc = gOutputDoc @@ -205,6 +224,7 @@ Sub CreateStatusTable table = aDoc.createInstance("com.sun.star.text.TextTable") table.initialize(6,9) table.Name = "StTab1" + table.BackColor = cCoGrey xText.insertTextContent(xCursor, table, FALSE) tableCursor = table.createCursorByCellName(table.CellNames(0)) @@ -212,37 +232,13 @@ Sub CreateStatusTable tableCursor.goRight(1,FALSE) for i% = 0 to 7 - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - 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 - - for i% = 0 to 4 - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( i% + 1, 0 ) + tableCell.String = tableHeaders( i% ) next i% end Sub Sub CreateStatusTable2 - dim tableHeaders(5) as string + dim tableHeaders(4) as string tableHeaders(0) = "Database" tableHeaders(1) = "" tableHeaders(2) = "Extension" @@ -263,8 +259,8 @@ Sub CreateStatusTable2 tableRows2(cEXTUninstall ) = "uninstall" dim tableRows3(1) as string - tableRows3(cOtherSetupDoc ) = "setup doc" - tableRows3(cOtherWriteStatus ) = "write status" + tableRows3(cOtherSetupDoc ) = "setup test" + tableRows3(cOtherWriteStatus ) = "write test result" aDoc = gOutputDoc @@ -284,62 +280,24 @@ Sub CreateStatusTable2 xText.insertTextContent(xCursor, table, FALSE) - tableCursor = table.createCursorByCellName(table.CellNames(0)) - tableCursor.gotoStart(FALSE) - tableCursor.goRight(1,FALSE) - for i% = LBound( tableHeaders ) to UBound( tableHeaders ) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - tableCursor.goRight(1,FALSE) + tableCell = table.getCellByPosition( i% + 1, 0 ) + tableCell.String = tableHeaders(i%) next i% - tableCursor.gotoStart(FALSE) - - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - for i% = LBound( tableRows ) to UBound( tableRows ) - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( 0, i% + 1 ) + tableCell.String=tableRows(i%) next i% - tableCursor.gotoStart(FALSE) - tableCursor.goRight(2,FALSE) - for i% = LBound( tableRows2 ) to UBound( tableRows2 ) - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows2(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( 2, i% + 1 ) + tableCell.String=tableRows2(i%) 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 + tableCell = table.getCellByPosition( 4, i% + 1 ) + tableCell.String=tableRows3(i%) next i% end Sub @@ -579,7 +537,6 @@ Sub SetOptions 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 @@ -597,7 +554,6 @@ Sub GetOptions 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 @@ -615,7 +571,6 @@ Sub ReadOptions 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 @@ -639,11 +594,6 @@ Sub SetDefaultOptions End If bMakeSaveOpenXMLTest = true REM Disable StarOffice 5.0 tests in case binfilter has not been included - if Environ("WITH_BINFILTER") = "NO" then - bMakeSaveOpen50Test = false - else - bMakeSaveOpen50Test = true - End If bMakeSaveOpen8Test = true bMakeTerminateAfterTest = false end Sub @@ -678,11 +628,10 @@ Function StartTestWithDefaultOptions component(cStJava) = "Java" component(cStDataBase) = "Base" component(cStExtension) = "Extensions" - dim action(3) as string + dim action(2) as string action(cDocNew) = "new" action(cDocSaveOpen8) = "V8.0" action(cDocSaveOpenXML) = "XML" - action(cDocSaveOpen50) = "V5.0" dim baseAction(5) as string baseAction(cDBService) = "services" baseAction(cDBOpen) = "open" diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml index 942500f61d71..c03026185886 100644 --- a/smoketestoo_native/data/OptionsDlg.xml +++ b/smoketestoo_native/data/OptionsDlg.xml @@ -47,7 +47,6 @@ - -- cgit From ad36c8bb35f3ff5666363d876be319497a28001f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Feb 2011 11:08:08 +0100 Subject: debuglevels: outsourced creation of the smoketest doc into an own module, so it can be used outside smoketesoo_native, too --- .../com/sun/star/comp/smoketest/MANIFEST.MF | 2 - .../com/sun/star/comp/smoketest/TestExtension.idl | 40 -- .../com/sun/star/comp/smoketest/TestExtension.java | 166 ----- .../com/sun/star/comp/smoketest/delzip | 1 - .../com/sun/star/comp/smoketest/makefile.mk | 90 --- .../com/sun/star/comp/smoketest/manifest.xml | 5 - smoketestoo_native/data/Events.xml | 66 -- smoketestoo_native/data/Global.xml | 789 --------------------- smoketestoo_native/data/OptionsDlg.xml | 64 -- smoketestoo_native/data/Test_10er.xml | 690 ------------------ smoketestoo_native/data/Test_DB.xml | 147 ---- smoketestoo_native/data/Test_Ext.xml | 116 --- smoketestoo_native/data/content.xml | 113 --- smoketestoo_native/data/dialog-lb.xml | 31 - smoketestoo_native/data/dialog-lc.xml | 31 - smoketestoo_native/data/makefile.mk | 70 -- smoketestoo_native/data/manifest.xml | 49 -- smoketestoo_native/data/meta.xml | 28 - smoketestoo_native/data/script-lb.xml | 35 - smoketestoo_native/data/script-lc.xml | 31 - smoketestoo_native/data/settings.xml | 28 - smoketestoo_native/data/styles.xml | 28 - smoketestoo_native/makefile.mk | 2 +- smoketestoo_native/prj/build.lst | 6 +- smoketestoo_native/prj/d.lst | 0 smoketestoo_native/smoketest.cxx | 0 smoketestoo_native/version.map | 0 27 files changed, 3 insertions(+), 2625 deletions(-) delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/delzip delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml delete mode 100644 smoketestoo_native/data/Events.xml delete mode 100755 smoketestoo_native/data/Global.xml delete mode 100644 smoketestoo_native/data/OptionsDlg.xml delete mode 100644 smoketestoo_native/data/Test_10er.xml delete mode 100644 smoketestoo_native/data/Test_DB.xml delete mode 100644 smoketestoo_native/data/Test_Ext.xml delete mode 100644 smoketestoo_native/data/content.xml delete mode 100644 smoketestoo_native/data/dialog-lb.xml delete mode 100644 smoketestoo_native/data/dialog-lc.xml delete mode 100644 smoketestoo_native/data/makefile.mk delete mode 100644 smoketestoo_native/data/manifest.xml delete mode 100644 smoketestoo_native/data/meta.xml delete mode 100644 smoketestoo_native/data/script-lb.xml delete mode 100644 smoketestoo_native/data/script-lc.xml delete mode 100644 smoketestoo_native/data/settings.xml delete mode 100644 smoketestoo_native/data/styles.xml mode change 100644 => 100755 smoketestoo_native/makefile.mk mode change 100644 => 100755 smoketestoo_native/prj/build.lst mode change 100644 => 100755 smoketestoo_native/prj/d.lst mode change 100644 => 100755 smoketestoo_native/smoketest.cxx mode change 100644 => 100755 smoketestoo_native/version.map (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF b/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF deleted file mode 100755 index 09e2f42ca0f6..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -RegistrationClassName: com.sun.star.comp.smoketest.TestExtension - diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl b/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl deleted file mode 100755 index 83c370e11a18..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl +++ /dev/null @@ -1,40 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _com_sun_star_comp_smoketest_TestExtension_idl_ -#define _com_sun_star_comp_smoketest_TestExtension_idl_ - -#include - - -module com { module sun { module star { module comp { module smoketest { - // example service, XServiceInfo is implemented here for demonstration - // issues. XServiceInfo must be implemented by all components. - service TestExtension: ::com::sun::star::lang::XServiceInfo; -};};};};}; - -#endif diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java b/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java deleted file mode 100755 index c08c719116ae..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java +++ /dev/null @@ -1,166 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.comp.smoketest; - -import com.sun.star.lib.uno.helper.Factory; -import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.lang.XSingleComponentFactory; -import com.sun.star.lib.uno.helper.WeakBase; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.registry.XRegistryKey; -import com.sun.star.lang.XInitialization; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.uno.Type; - -/** This class capsulates the class, that implements the minimal component, a - * factory for creating the service (__getComponentFactory) and a - * method, that writes the information into the given registry key - * (__writeRegistryServiceInfo). - */ -public class TestExtension { - /** This class implements the component. At least the interfaces XServiceInfo, - * XTypeProvider, and XInitialization should be provided by the service. - */ - public static class _TestExtension extends WeakBase - implements XServiceInfo { - /** The service name, that must be used to get an instance of this service. - */ - static private final String __serviceName = - "com.sun.star.comp.smoketest.TestExtension"; - - /** The initial component contextr, that gives access to - * the service manager, supported singletons, ... - * It's often later used - */ - private XComponentContext m_cmpCtx; - - /** The service manager, that gives access to all registered services. - * It's often later used - */ - private XMultiComponentFactory m_xMCF; - - /** The constructor of the inner class has a XMultiServiceFactory parameter. - * @param xmultiservicefactoryInitialization A special service factory - * could be introduced while initializing. - */ - public _TestExtension(XComponentContext xCompContext) { - try { - m_cmpCtx = xCompContext; - m_xMCF = m_cmpCtx.getServiceManager(); - } - catch( Exception e ) { - e.printStackTrace(); - } - } - - /** This method returns an array of all supported service names. - * @return Array of supported service names. - */ - public String[] getSupportedServiceNames() { - return getServiceNames(); - } - - /** This method is a simple helper function to used in the - * static component initialisation functions as well as in - * getSupportedServiceNames. - */ - public static String[] getServiceNames() { - String[] sSupportedServiceNames = { __serviceName }; - return sSupportedServiceNames; - } - - /** This method returns true, if the given service will be - * supported by the component. - * @param sServiceName Service name. - * @return True, if the given service name will be supported. - */ - public boolean supportsService( String sServiceName ) { - return sServiceName.equals( __serviceName ); - } - - /** Return the class name of the component. - * @return Class name of the component. - */ - public String getImplementationName() { - return _TestExtension.class.getName(); - } - } - - - /** - * Gives a factory for creating the service. - * This method is called by the JavaLoader - *

- * @return returns a XSingleComponentFactory for creating - * the component - * @param sImplName the name of the implementation for which a - * service is desired - * @see com.sun.star.comp.loader.JavaLoader - */ - public static XSingleComponentFactory __getComponentFactory(String sImplName) - { - XSingleComponentFactory xFactory = null; - - if ( sImplName.equals( _TestExtension.class.getName() ) ) - xFactory = Factory.createComponentFactory(_TestExtension.class, - _TestExtension.getServiceNames()); - - return xFactory; - } - - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

- * @return returns true if the operation succeeded - * @param regKey the registryKey - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(_TestExtension.class.getName(), - _TestExtension.getServiceNames(), - regKey); - } - /** This method is a member of the interface for initializing an object - * directly after its creation. - * @param object This array of arbitrary objects will be passed to the - * component after its creation. - * @throws Exception Every exception will not be handled, but will be - * passed to the caller. - */ - public void initialize( Object[] object ) - throws com.sun.star.uno.Exception { - /* The component describes what arguments its expected and in which - * order!At this point you can read the objects and can intialize - * your component using these objects. - */ - } - -} diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/delzip b/smoketestoo_native/com/sun/star/comp/smoketest/delzip deleted file mode 100755 index 636fda90bfcb..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/delzip +++ /dev/null @@ -1 +0,0 @@ -ECHO is OFF diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk b/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk deleted file mode 100755 index da9b302791f0..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk +++ /dev/null @@ -1,90 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/..$/..$/.. -PRJNAME = smoke_test -PACKAGE = com$/sun$/star$/comp$/smoketest -TARGET = com_sun_star_comp_smoketest - -no_common_build_zip:=TRUE - -# --- Settings ----------------------------------------------------- - -.IF "$(SOLAR_JAVA)" != "" - -.INCLUDE : settings.mk - -JARFILES = ridl.jar jurt.jar unoil.jar juh.jar - - -JARTARGET = TestExtension.jar -JARCOMPRESS = TRUE -CUSTOMMANIFESTFILE = MANIFEST.MF - -ZIP1TARGET=TestExtension -ZIP1LIST=* -ZIPFLAGS=-r -ZIP1DIR=$(MISC)$/$(TARGET) -ZIP1EXT=.oxt - -# --- Files -------------------------------------------------------- - -#COPY_OXT_MANIFEST:= $(MISC)$/$(TARGET)$/META-INF$/manifest.xml -JAVAFILES = TestExtension.java - -# --- Targets ------------------------------------------------------ - -ZIP1DEPS=$(MISC)$/$(TARGET)$/$(JARTARGET)\ - $(MISC)$/$(TARGET)$/TestExtension.rdb\ - $(MISC)$/$(TARGET)$/META-INF$/manifest.xml - -.INCLUDE : target.mk - -$(MISC)$/$(TARGET)$/META-INF: - @-$(MKDIRHIER) $(@) - -$(MISC)$/TestExtension.urd: TestExtension.idl - $(IDLC) -O$(MISC) -I$(SOLARIDLDIR) -cid -we $< - -$(MISC)$/$(TARGET)$/META-INF$/manifest.xml $(MISC)$/$(TARGET)$/TestExtension.rdb : $(MISC)$/$(TARGET)$/META-INF - -$(MISC)$/$(TARGET)$/META-INF$/manifest.xml: manifest.xml - $(COPY) $< $@ - -$(MISC)$/$(TARGET)$/TestExtension.rdb: $(MISC)$/TestExtension.urd - $(REGMERGE) $@ /UCR $< - -$(JAVACLASSFILES) .UPDATEALL: $(MISC)$/$(TARGET)$/TestExtension.rdb - $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -X$(SOLARBINDIR)/types.rdb $< - -$(MISC)$/$(TARGET)$/$(JARTARGET) : $(JARTARGETN) - $(COPY) $< $@ - -.ELSE -@all: - @echo "Java disabled. Nothing to do." -.ENDIF diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml b/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml deleted file mode 100755 index 7e3e7947aa0f..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/smoketestoo_native/data/Events.xml b/smoketestoo_native/data/Events.xml deleted file mode 100644 index 414f2c48e884..000000000000 --- a/smoketestoo_native/data/Events.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - -REM ***** BASIC ***** - -Global s_CloseListenerCalled As Boolean - -Sub PressCancel - gDlgState = cDlgCancel -end Sub - -Sub PressOk - gDlgState = cDlgOk -end Sub - -Sub PressTest - gOptionsDialog.EndExecute() - gDlgState = cDlgStartTest -end Sub - -Sub closeListener_queryClosing - ' not interested in - closeListener_queryClosing = TRUE -End Sub - -Sub closeListener_notifyClosing - s_CloseListenerCalled = TRUE -End Sub - -Sub closeListener_disposing - ' not interested in -End Sub - -Sub ResetCloseListenerFlag - s_CloseListenerCalled = FALSE -End Sub - -Function HasCloseListenerBeenCalled As Boolean - HasCloseListenerBeenCalled = s_CloseListenerCalled -End Function - diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml deleted file mode 100755 index d437eafe3457..000000000000 --- a/smoketestoo_native/data/Global.xml +++ /dev/null @@ -1,789 +0,0 @@ - - - -REM ***** BASIC ***** - -const cMaxErrorStates = 14 - -const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256 -const cParagraphBreak = 0 - -global const cExtensionFileName = "TestExtension.oxt" - -global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3 -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 - -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 gCurrentDocTest As Integer -Global gCurrentTestCase As Integer - -global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 - -'UserFieldKennungen -Global const cYes = "y", cNo = "n" -Global const cStateNo = 0, cStateYes = 1 - -'Feldtypen -Global const cFtExtUser = 21, cFtPageNum = 5, cFtStatistic = 8, cFtDateTime = 27, cFtDatabase = 31 - -'UnoStrings -Global const cUnoSeparator = "." -Global const cUnoPrefix = "com.sun.star." -Global const cUnoUserField = cUnoPrefix + "text.FieldMaster.User" -Global const cUnoExtUserField = cUnoPrefix + "text.TextField.ExtendedUser" -Global const cUnoMasterDataBase = cUnoPrefix + "text.FieldMaster.Database" -Global const cUnoDataBase = cUnoPrefix + "text.TextField.Database" -Global const cUnoDateTime = cUnoPrefix + "text.TextField.DateTime" -Global const cUnoTextGraphi2 = cUnoPrefix + "text.Graphic" -Global const cUnoJavaLoader = cUnoPrefix + "loader.Java" -Global const cUnoDatabaseContext = cUnoPrefix + "sdb.DatabaseContext" -Global const cUnoRowSet = cUnoPrefix + "sdb.RowSet" -Global const cUnoSmoketestTestExtension = cUnoPrefix + "comp.smoketest.TestExtension" -Global const cUnoSmoketestCommandEnvironment = cUnoPrefix + "deployment.test.SmoketestCommandEnvironment" -Global const cExtensionManager = cUnoPrefix + "deployment.ExtensionManager" - -'UserFieldNames -Global const cUserFieldTestWriter = "Writer", cUserFieldTestCalc = "Calc", cUserFieldTestImpress = "Impress" -Global const cUserFieldTestDraw = "Draw", cUserFieldTestMath = "Math", cUserFieldTestChart = "Chart" -Global const cUserFieldTestHTML = "HTML", cUserFieldTestJava = "Java", cUserFieldTestDatabase = "Database" -Global const cUserFieldTestExtension = "Extension" -Global const cUserFieldTestOpenSaveXML = "SaveOpenXML" -Global const cUserFieldTestTerminateAfterTest = "Terminate", cUserFieldTestOpenSave8 = "SaveOpen8" - -Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "Standard" - -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 -global gOptionsDialog as Object - -Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest as boolean -Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean -Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean -Global bMakeExtensionTest as boolean -Global bMakeSaveOpenXMLTest as boolean -Global bMakeTerminateAfterTest as boolean, bShowTable as boolean -Global bMakeSaveOpen8Test as boolean - -global sExtensionURL as string - -Dim gDlgState as Integer - -Sub SetGlobalDoc - gOutputDoc = ThisComponent -end Sub - -Sub ClearStatus - for j% = 0 to cMaxErrorStates - for i% = 0 to 5 - gErrorState (j%, i%) = cLogUnknown - gTestCaseAnnotations( J%, i% ) = "" - next i% - next j% -end Sub - -Sub ClearAllText - call SetGlobalDoc - call ClearDoc (gOutputDoc) - call ClearStatus -end Sub - -Sub AssertionHandler( sMessage as String ) - LogTestResult( "assertion caught: " + sMessage, FALSE ) -End Sub - -Sub Main - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherSetupDoc - - On Local Error Goto MainError - CaptureAssertions( "AssertionHandler" ) - - call SetGlobalDoc - - Dim bWasModified as Boolean - bWasModified = gOutputDoc.isModified() - - if bShowTable then - call ClearDoc (gOutputDoc) - end If - - call ClearStatus - - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) - - Call Test_10er.Main - - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherWriteStatus - if bShowTable then - call CreateStatusTable2 - call CreateStatusTable - call CreateDocState - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) - ' do this LogTestResult call before CreateSecondState, since the latter accesses (and displays) the result - call CreateSecondState - gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage - end if - - gOutputDoc.setModified( bWasModified ) - - CaptureAssertions( "" ) - Exit Sub - -MainError: - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), FALSE ) -End Sub - -Function GetTestGlueDescription( nTestCase as Integer ) - Select Case ( nTestCase ) - case cOtherSetupDoc - GetTestGlueDescription = "setup test document" - case cOtherWriteStatus - GetTestGlueDescription = "write test status" - case Else - GetTestGlueDescription = "" - End Select -End Function - -Sub CreateStatusTable - dim tableHeaders(7) as string - tableHeaders(cStWriter) = "Writer" - tableHeaders(cStCalc) = "Calc" - tableHeaders(cStPraesentation) = "Präsen- tation" - tableHeaders(cStZeichnen) = "Zeichn." - tableHeaders(cStChart) = "Diagr." - tableHeaders(cStMath) = "Math" - tableHeaders(cStHTML) = "HTML" - tableHeaders(cStJava) = "Java" - - dim tableRows(3) as string - tableRows(cDocNew) = "new" - tableRows(cDocSaveOpen8) = "V8.0" - tableRows(cDocSaveOpenXML) = "XML" - tableRows(cDocClose) = "close" - - aDoc = gOutputDoc - - 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) - - table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(6,9) - table.Name = "StTab1" - table.BackColor = cCoGrey - xText.insertTextContent(xCursor, table, FALSE) - - tableCursor = table.createCursorByCellName(table.CellNames(0)) - tableCursor.gotoStart(FALSE) - tableCursor.goRight(1,FALSE) - - for i% = 0 to 7 - tableCell = table.getCellByPosition( i% + 1, 0 ) - tableCell.String = tableHeaders( i% ) - next i% -end Sub - -Sub CreateStatusTable2 - dim tableHeaders(4) as string - tableHeaders(0) = "Database" - tableHeaders(1) = "" - tableHeaders(2) = "Extension" - tableHeaders(3) = "" - 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 tableRows2(2) as string - tableRows2(cEXTService ) = "services" - tableRows2(cEXTInstall ) = "install" - tableRows2(cEXTUninstall ) = "uninstall" - - dim tableRows3(1) as string - tableRows3(cOtherSetupDoc ) = "setup test" - tableRows3(cOtherWriteStatus ) = "write test result" - - aDoc = gOutputDoc - - xText = aDoc.Text - xCursor = xText.createTextCursor() - - xCursor.gotoStart(FALSE) - xCursor.GoRight (4, False) - SetParagraphBreak (xCursor) - SetParagraphBreak (xCursor) - xCursor.gotoEnd(FALSE) - - table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(7,6) - table.Name = "StTab2" - table.BackColor = cCoGrey - - xText.insertTextContent(xCursor, table, FALSE) - - for i% = LBound( tableHeaders ) to UBound( tableHeaders ) - tableCell = table.getCellByPosition( i% + 1, 0 ) - tableCell.String = tableHeaders(i%) - next i% - - for i% = LBound( tableRows ) to UBound( tableRows ) - tableCell = table.getCellByPosition( 0, i% + 1 ) - tableCell.String=tableRows(i%) - next i% - - for i% = LBound( tableRows2 ) to UBound( tableRows2 ) - tableCell = table.getCellByPosition( 2, i% + 1 ) - tableCell.String=tableRows2(i%) - next i% - - for i% = LBound( tableRows3 ) to UBound( tableRows3 ) - tableCell = table.getCellByPosition( 4, i% + 1 ) - tableCell.String=tableRows3(i%) - next i% -end Sub - - -Sub CreateDocState - aDoc = gOutputDoc - table = aDoc.TextTables.GetByIndex (1) - - for j% = 0 to 7 - for i% = 0 to 4 - sRangeName = GetRangeName(j%, i%+1) - - 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 - 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 - table = aDoc.TextTables.GetByIndex (0) - - 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 - -Function GetRangeName (nColumn as integer, nRow as integer) as string - GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) -end Function - -Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) - If ( gCurrentTestCase = cLogfileFailed ) Then - Dim sAnnotation as String - sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" - LogState( FALSE, sAnnotation, MainFileChannel ) - SetStatus( 0, FALSE, sAnnotation ) - Else - 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, sFailureAnnotation as String ) - Dim nStatusType as Integer - Dim nState as integer - nStatusType = GetStatusType( gCurrentDocTest ) - If nStatusType = cStNone then Exit Sub - - if bState then - nState = cLogTrue - else - nState = cLogFalse - end If - - If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then - ' don't overwrite a previous "failed" state for this this - nState = cLogFalse - 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 - Select Case ( nDocType ) - case frmWriter - GetStatusType = cStWriter ' text document - case frmCalc - GetStatusType = cStCalc ' spreadsheet document - case frmImpress - GetStatusType = cStPraesentation ' presentation - case frmDraw - GetStatusType = cStZeichnen ' drawing - case frmMath - GetStatusType = cStMath ' formula - case frmHyperText - GetStatusType = cStHTML ' HTML document - case frmChart - GetStatusType = cStChart ' chart - case frmJava - GetStatusType = cStJava 'Java - case frmTestGlue - GetStatusType = cStTestGlue ' test framework - case frmDataBase - GetStatusType = cStDataBase 'DataBase - case frmExtension - GetStatusType = cStExtension 'Extension - case else - GetStatusType = cStNone - end Select -end Function - -Sub SetParagraphBreak (aCursor as Object) - aCursor.Text.InsertControlCharacter (aCursor, cParagraphBreak, True) -end Sub - -Sub ClearDoc (aDoc as Object) - Dim aText as Object - Dim i% - for i%=1 to aDoc.TextTables.count - aDoc.TextTables.GetByIndex(0).dispose - next - - aText = aDoc.Text.CreateTextCursor - aText.GotoStart (False) - aText.GoRight (3, False) - SetParagraphBreak (aText) - aText.GotoEnd (True) - aText.String="" -end Sub - -Sub ClearDocFull (aDoc as Object) - Dim aText as Object - Dim i% - for i%=1 to aDoc.TextTables.count - aDoc.TextTables.GetByIndex(0).dispose - next - - aText = aDoc.Text.CreateTextCursor - aText.GotoStart (False) - aText.GotoEnd (True) - aText.String="" -end Sub - -Sub SetGlobalOptionsDialog () - - Dim oLibContainer As Object, oLib As Object - Dim oInputStreamProvider As Object - Dim oDialog As Object - - Const sLibName = cTest10Modul - Const sDialogName = cOptionsDialogName - - REM get library and input stream provider - oLibContainer = DialogLibraries - - REM load the library - oLibContainer.loadLibrary( sLibName ) - - oLib = oLibContainer.getByName( sLibName ) - oInputStreamProvider = oLib.getByName( sDialogName ) - - REM create dialog control - gOptionsDialog = CreateUnoDialog( oInputStreamProvider ) - -end Sub - -Sub ShowOptionsDlg - - call SetGlobalDoc - call SetGlobalOptionsDialog - call GetOptions - - REM show the dialog - gOptionsDialog.execute() - - ' jetzt läuft der Dialog, bis ein Button gedrückt wird - - Select Case (gDlgState) - case cDlgOk - call SetOptions () - case cDlgStartTest - call SetOptions () - call StartTestByOptions () - end Select - - gOptionsDialog.dispose() - -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 (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("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) - bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) - bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) -end Sub - -Sub SetDefaultOptions - bMakeWriterTest = true - bMakeCalcTest = true - bMakeImpressTest = true - bMakeDrawTest = true - bMakeHTMLTest = true - bMakeMathTest = true - bMakeChartTest = true - if Environ("SOLAR_JAVA") = "" then - bMakeJavaTest = false - bMakeDBTest = false - bMakeExtensionTest = false - else - bMakeJavaTest = true - bMakeDBTest = true - bMakeExtensionTest = true - End If - bMakeSaveOpenXMLTest = true - REM Disable StarOffice 5.0 tests in case binfilter has not been included - bMakeSaveOpen8Test = true - bMakeTerminateAfterTest = false -end Sub - -Sub StartTestByOptions - bShowTable = true - call ReadOptions - call Main - if bMakeTerminateAfterTest then - ClearDocFull (gOutputDoc) - gOutputDoc.dispose - 'StarDesktop.Terminate - - 'EnableReschedule( false ) - 'DispatchSlot( 5300 ) - stop - End If -end Sub - -Function StartTestWithDefaultOptions - bShowTable = false - call SetDefaultOptions - call Main - dim component(cMaxErrorStates) as string - component(cStWriter) = "Writer" - component(cStCalc) = "Calc" - component(cStPraesentation) = "Impress" - component(cStZeichnen) = "Draw" - component(cStChart) = "Chart" - component(cStMath) = "Math" - component(cStHTML) = "HTML" - component(cStJava) = "Java" - component(cStDataBase) = "Base" - component(cStExtension) = "Extensions" - dim action(2) as string - action(cDocNew) = "new" - action(cDocSaveOpen8) = "V8.0" - action(cDocSaveOpenXML) = "XML" - dim baseAction(5) as string - baseAction(cDBService) = "services" - baseAction(cDBOpen) = "open" - baseAction(cDBInsert) = "insert" - baseAction(cDBDelete) = "delete" - baseAction(cDBSeek) = "seek" - baseAction(cDBClose) = "close" - dim extAction(2) as string - extAction(cEXTService) = "services" - extAction(cEXTInstall) = "install" - extAction(cEXTUninstall) = "uninstall" - dim result as string - for i = 0 to cMaxErrorStates - for j = 0 to 5 - if gErrorState(i, j) = cLogFalse then - result = result & " " & component(i) & ":" - if i = cStDataBase then - result = result & baseAction(j) - else if i = cStExtension then - result = result & extAction(j) - else - result = result & action(j) - end if - end if - end if - next j - next i - StartTestWithDefaultOptions = result -end Function - -Sub DispatchSlot(SlotID as Integer) - Dim oArg() as new com.sun.star.beans.PropertyValue - Dim oUrl as new com.sun.star.util.URL - Dim oTrans as Object - Dim oDisp as Object - - oTrans = createUNOService("com.sun.star.util.URLTransformer") - oUrl.Complete = "slot:" & CStr(SlotID) - oTrans.parsestrict(oUrl) - - oDisp = StarDesktop.queryDispatch(oUrl, "_self", 0) - oDisp.dispatch(oUrl, oArg()) -End Sub - -Sub LoadLibrary( LibName As String ) - - dim args(1) - dim arg as new com.sun.star.beans.PropertyValue - arg.Name = "LibraryName" - arg.Value = LibName - args(0) = arg - - dim url as new com.sun.star.util.URL - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url.Complete = "slot:6517" - trans.parsestrict( url ) - - dim disp as object - disp = StarDesktop.currentFrame.queryDispatch( url, "", 0 ) - disp.dispatch( url, args() ) - -End Sub - -Sub ExecuteSlot( SlotNr As String, oDoc as Object ) - dim args() - dim url as new com.sun.star.util.URL - dim trans as object - dim disp as object - - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url.Complete = "slot:" + SlotNr - trans.parsestrict( url ) - - disp = oDoc.CurrentController.Frame.queryDispatch( url, "", 0 ) - disp.dispatch( url, args() ) - -End Sub - -Sub DelAllUserFields (aDoc as Object) - Dim aFieldType as Object - Dim aElements as Variant - Dim i% - Dim aFieldMasters, aFieldMaster as Object - Dim sElement$ - aFieldMasters = aDoc.TextFieldMasters - aElements = aFieldMasters.ElementNames - for i = 0 to UBound(aElements) - sElement$ = aElements(i) - if 0 <> instr(sElement$, cUnoUserField ) then - aFieldMaster = aFieldMasters.GetByName(sElement$) - aFieldMaster.Dispose - endif - next -end Sub - -Function GetUserFieldState (sName as String, aDoc as Object) as boolean - Dim sFieldText as String - Dim bState as boolean - sFieldText = ReadUserField (sName, aDoc) - - if LCase(sFieldText) = cYes then - bState = true - else - bState = false - end IF - - GetUserFieldState = bState -end Function - -Sub SetUserFieldState (sName as String, nState as boolean, aDoc as Object) - Dim sFieldText as String - - sFieldText = cNo 'default - - Select case nState - case true - sFieldText = cYes - case false - sFieldText = cNo - end Select - - WriteUserField (sFieldText, sName, aDoc) -end Sub - -Function ReadUserField(sFieldName as String, aDoc as Object) as String - Dim aMasters as Object - aMasters = aDoc.TextFieldMasters - if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then - ReadUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName).Content - else - ReadUserField = "" - end If -End Function - -Sub WriteUserField(sValue as String, sFieldName as String, aDoc as Object, optional aCursor as Object) - Dim aMasters, aUserField, aTxtCursor as Object - aMasters = aDoc.TextFieldMasters - if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then - aUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName) - else - aUserField = aDoc.CreateInstance (cUnoUserField) - aUserField.Name = sFieldName - end if - aUserField.Content = sValue -End Sub - -Sub WriteExtUserField(nIndex as Integer, aCursor as Object, aDoc as Object) - Dim aUserField as Object - aUserField = aDoc.CreateInstance (cUnoExtUserField) - aUserField.UserDataType = nIndex - aCursor.Text.InsertTextContent (aCursor, aUserField, True) - aUserField.Fix = True -End Sub - diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml deleted file mode 100644 index c03026185886..000000000000 --- a/smoketestoo_native/data/OptionsDlg.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml deleted file mode 100644 index a6f46b01eb78..000000000000 --- a/smoketestoo_native/data/Test_10er.xml +++ /dev/null @@ -1,690 +0,0 @@ - - - -REM 10er Test - -const sSWLogFileName = "swlog.dat", sSCLogFileName = "sclog.dat" -const sSDLogFileName = "sdlog.dat", sSMathLogFileName = "smalog.dat" -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" - -const cMessageSaveOpen8Doc = "Save/Open open Documents (8.0)" -const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" -const cMessageNewDoc = "New Document" -const cMessageCloseDoc = "Close Document" - -Global sWorkPath$ -Global sWorkPathURL$ -Global LocalFileChannel% -Global MainFileChannel% - -Sub Main - call TestAllDocs() -end Sub - -Sub DeleteAllSavedFiles() - Dim sFileName as String - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmWriter) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmCalc) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmImpress) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmDraw) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmHyperText) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmWriter or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmCalc or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmImpress or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmDraw or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If -End Sub - -Sub DeleteAllLogFiles() - If FileExists (sWorkPath+sLogFileName) then - Kill (sWorkPath+sLogFileName) - End If - If FileExists (sWorkPath+sSWLogFileName) then - Kill (sWorkPath+sSWLogFileName) - End If - If FileExists (sWorkPath+sSCLogFileName) then - Kill (sWorkPath+sSCLogFileName) - End If - If FileExists (sWorkPath+sSDLogFileName) then - Kill (sWorkPath+sSDLogFileName) - End If - If FileExists (sWorkPath+sSMathLogFileName) then - Kill (sWorkPath+sSMathLogFileName) - End If - If FileExists (sWorkPath+sSChartLogFileName) then - Kill (sWorkPath+sSChartLogFileName) - End If - If FileExists (sWorkPath+sSHptLogFileName) then - Kill (sWorkPath+sSHptLogFileName) - End If - If FileExists (sWorkPath+sSDrawLogFileName) then - Kill (sWorkPath+sSDrawLogFileName) - End If - 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 - If FileExists (sWorkPath+sExtLogFileName) then - Kill (sWorkPath+sExtLogFileName) - End If -end Sub - -Function OpenLogDat (sFileName as String) as Integer - Dim LocaleFileChannel% - If FileExists (sWorkPath+sFileName) then - Kill (sWorkPath+sFileName) - End If - LocaleFileChannel% = Freefile - Open sWorkPath+sFileName For Output As LocaleFileChannel% - OpenLogDat = LocaleFileChannel% -end Function - -Function GetWorkPath as string - sTemp = "$(userpath)/temp/" - GetWorkPath = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function - -Function GetWorkURL as string - sTemp = "$(userurl)/temp/" - GetWorkURL = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function - -Function GetSystem (sTmpWorkPath as string) as string - GetSystem = "" - if InStr (sTmpWorkPath, ":") then - GetSystem = "windows" - else - GetSystem = "unix" - End If -end Function - -Function ConvertPathToWin (sTmpWorkPath as string) as string - for i%=1 to Len(sTmpWorkPath) - sTemp = Mid (sTmpWorkPath, i%, 1) - if sTemp = "/" then - sTmpWorkPath = Left (sTmpWorkPath, i%-1) + "\" + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%) - else - if sTemp = "|" then - sTmpWorkPath = Left (sTmpWorkPath, i%-1) + ":" + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%) - end If - end If - next i% - ConvertPathToWin = sTmpWorkPath -end Function - -Sub TestAllDocs() -DIM sDocURL as String, sDocPath as String -DIM nStrPos as Long - - sWorkPath = GetWorkPath - sWorkPathURL = GetWorkURL - - if GetSystem (sWorkPath) = "windows" then - sWorkPath = ConvertPathToWin (sWorkPath) - end if - - 'search ExtensionURL - sDocURL = gOutputDoc.URL - CompatibilityMode(true) - nStrPos = InStrRev (sDocURL, "/" ) - CompatibilityMode(false) - sExtensionURL = Left (sDocURL, nStrPos) - - call DeleteAllSavedFiles() - call DeleteAllLogFiles() - MainFileChannel = OpenLogDat (sLogFileName) - call WriteTestSequence - if bMakeWriterTest then - gCurrentDocTest = frmWriter - call MakeDocTest - end if - if bMakeCalcTest then - gCurrentDocTest = frmCalc - call MakeDocTest - end if - if bMakeImpressTest then - gCurrentDocTest = frmImpress - call MakeDocTest - end if - if bMakeDrawTest then - gCurrentDocTest = frmDraw - call MakeDocTest - end if - if bMakeHTMLTest then - gCurrentDocTest = frmHyperText - call MakeDocTest - end if - if bMakeChartTest then - gCurrentDocTest = frmChart - call MakeChartTest - end if - if bMakeMathTest then - gCurrentDocTest = frmMath - call MakeNewDoc - end if - if bMakeJavaTest then - gCurrentDocTest = frmJava - call TestJava - end if - if bMakeDBTest then - gCurrentDocTest = frmDataBase - call Test_DB.TestDB - end if - if bMakeExtensionTest then - gCurrentDocTest = frmExtension - call Test_Ext.TestExtensions - end if - - Close #MainFileChannel - MainFileChannel = 0 -end Sub - -Sub WriteTestSequence - Print #MainFileChannel, "Sequence of testing" - - if bMakeWriterTest then - WriteTests ("writer : ", true, MainFileChannel) - end if - if bMakeCalcTest then - WriteTests ("calc : ", true, MainFileChannel) - end if - if bMakeImpressTest then - WriteTests ("impress : ", true, MainFileChannel) - end if - if bMakeDrawTest then - WriteTests ("draw : ", true, MainFileChannel) - end if - if bMakeHTMLTest then - WriteTests ("HTML : ", true, MainFileChannel) - end if - if bMakeChartTest then - WriteTests ("chart : ", false, MainFileChannel) - end if - if bMakeMathTest then - WriteTests ("math : ", false, MainFileChannel) - end if - if bMakeJavaTest then - WriteTests ("Java : ", false, MainFileChannel) - end if - if bMakeDBTest then - WriteDBTests ("Database : ", MainFileChannel) - end if - if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", MainFileChannel) - end if - - Print #MainFileChannel -end Sub - -Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) - Dim sWriteStr as string - - sWriteStr = sText - sWriteStr = sWriteStr + "new" - if bTestAll then - if bMakeSaveOpen8Test then - sWriteStr = sWriteStr + ", save 8.0" - end if - if bMakeSaveOpenXMLTest then - sWriteStr = sWriteStr + ", save XML" - end if - if bMakeSaveOpen8Test then - sWriteStr = sWriteStr + ", open 8.0" - end if - if bMakeSaveOpenXMLTest then - sWriteStr = sWriteStr + ", open XML" - end if - end if - - sWriteStr = sWriteStr + ", close" - - Print #nFileChannel, sWriteStr -end Sub - -Sub WriteDBTests (sText as string, nFileChannel as integer) - Dim sWriteStr as string - - sWriteStr = sText - sWriteStr = sWriteStr + "open / services" - sWriteStr = sWriteStr + ", insert" - sWriteStr = sWriteStr + ", delete" - sWriteStr = sWriteStr + ", seek" - sWriteStr = sWriteStr + ", close" - - Print #nFileChannel, sWriteStr -end Sub - -Sub WriteExtensionTests (sText as string, nFileChannel as integer) - Dim sWriteStr as string - - sWriteStr = sText - sWriteStr = sWriteStr + "services" - sWriteStr = sWriteStr + ", install" - sWriteStr = sWriteStr + ", uninstall" - - Print #nFileChannel, sWriteStr -end Sub - -Sub MakeDocTest - Dim oDoc as Object - Dim sFileNameXML$, sFileName8$ - Dim bSuccess as Boolean - - On Local Error GoTo DOCTESTERROR - 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 - 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 - 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 - gCurrentTestCase = cDocClose - bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - gCurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then - oDoc = LoadDoc (sFileName8) - -' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) - - if not IsNull (oDoc) then - gCurrentTestCase = cDocClose - oDoc.close (true) - end If - end if - - gCurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then - oDoc = LoadDoc (sFileNameXML) - -' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) - - if not IsNull (oDoc) then - gCurrentTestCase = cDocClose - oDoc.close (true) - end If - end if - - end If - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - DOCTESTERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - -Sub MakeNewDoc - DIM oDoc as Object - Dim bSuccess as Boolean - On Local Error GoTo DOCTESTERROR2 - 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 - gCurrentTestCase = cDocClose - bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - end If - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - DOCTESTERROR2: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - -Sub MakeChartTest - Dim oCharts as Object - Dim oDoc as Object - Dim oRange(0) as New com.sun.star.table.CellRangeAddress - Dim oRect as New com.sun.star.awt.Rectangle - const cChartName="TestChart" - Dim bSuccess as Boolean - On Local Error GoTo CHARTTESTERROR - 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(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) - gCurrentTestCase = cDocClose - oDoc.close (true) - else - LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) - End if - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - CHARTTESTERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - -Sub LogState (bState as Boolean, sText as String, nLocaleFileChannel as integer) - if bState then - Print #nLocaleFileChannel, sText+" -> ok" - else - Print #nLocaleFileChannel, sText+" -> error" - end If -end Sub - -Function GetDocEndings (DocType as Integer) as String - Select Case ( DocType ) - case frmWriter or cFlt8 - GetDocEndings = "odt" ' Textdokument - case frmCalc or cFlt8 - GetDocEndings = "ods" 'Tabellendokument - case frmImpress or cFlt8 - GetDocEndings = "odp" 'PrÕsentation - case frmDraw or cFlt8 - GetDocEndings = "odg" 'Zeichen - case frmHyperText, frmHyperText or cFltXML - GetDocEndings = "html" 'Hypertext-Dokument - case frmWriter or cFltXML - GetDocEndings = "sxw" ' Textdokument - case frmCalc or cFltXML - GetDocEndings = "sxc" 'Tabellendokument - case frmImpress or cFltXML - GetDocEndings = "sxi" 'PrÕsentation - case frmDraw or cFltXML - GetDocEndings = "sxd" 'Zeichen - case else - GetDocEndings = "" - end Select -end Function - -Function GetDocFilter (DocType as Integer) as String - Select Case ( DocType ) - case frmWriter or cFlt8 - GetDocFilter = "writer8" ' text document - case frmCalc or cFlt8 - GetDocFilter = "calc8" ' spreadsheet document - case frmImpress or cFlt8 - GetDocFilter = "impress8" ' presentation - case frmDraw or cFlt8 - GetDocFilter = "draw8" ' drawing - case frmMath or cFlt8 - GetDocFilter = "math8" ' formula - - case frmWriter or cFltXML - GetDocFilter = "StarOffice XML (Writer)" ' text document - case frmCalc or cFltXML - GetDocFilter = "StarOffice XML (Calc)" ' spreadsheet document - case frmImpress or cFltXML - GetDocFilter = "StarOffice XML (Impress)" ' presentation - case frmDraw or cFltXML - GetDocFilter = "StarOffice XML (Draw)" ' drawing - case frmMath or cFltXML - GetDocFilter = "StarOffice XML (Math)" ' formula - - case frmHyperText, frmHyperText or cFltXML - GetDocFilter = "HTML" ' HTML document - - case frmWriter or cFltNewDoc - GetDocFilter = "swriter" ' text document - case frmCalc or cFltNewDoc - GetDocFilter = "scalc" ' spreadsheet document - case frmImpress or cFltNewDoc - GetDocFilter = "simpress" ' presentation - case frmDraw or cFltNewDoc - GetDocFilter = "sdraw" ' drawing - case frmMath or cFltNewDoc - GetDocFilter = "smath" ' formula - case frmHyperText or cFltNewDoc - GetDocFilter = "swriter/web" ' HTML document - case frmChart or cFltNewDoc - GetDocFilter = "schart" ' chart - case else - GetDocFilter = "" - end Select -end Function - -Function GetLogFileName (DocType as Integer) as String - Select Case ( DocType ) - case frmWriter - GetLogFileName = sSWLogFileName ' text document - case frmCalc - GetLogFileName = sSCLogFileName ' spreadsheet document - case frmImpress - GetLogFileName = sSDLogFileName ' presentation - case frmDraw - GetLogFileName = sSDrawLogFileName ' drawing - case frmMath - GetLogFileName = sSMathLogFileName ' formula - case frmHyperText - GetLogFileName = sSHptLogFileName ' HTML document - case frmChart - GetLogFileName = sSChartLogFileName ' chart - case frmJava - GetLogFileName = sJavaLogFileName 'Java - case frmOther - GetLogFileName = sTestGlueLogFileName ' test framework - case frmDataBase - GetLogFileName = sSDBLogFileName 'Database - case frmExtension - GetLogFileName = sExtLogFileName 'Extension - case else - GetLogFileName = "" - end Select -end Function - -Function GetErrorMessageOnAction (nAction as Integer) as String - Select Case ( nAction ) - case cDocNew - GetErrorMessageOnAction = cMessageNewDoc - case cDocSaveOpen8 - GetErrorMessageOnAction = cMessageSaveOpen8Doc - case cDocSaveOpenXML - GetErrorMessageOnAction = cMessageSaveOpenXMLDoc - case cDocClose - GetErrorMessageOnAction = cMessageCloseDoc - case else - GetErrorMessageOnAction = "" - end Select -end Function - -Function IsFilterAvailable (FilterType as Integer) as boolean - IsFilterAvailable = true - if ((FilterType = (frmHyperText or cFltXML))) then - IsFilterAvailable = false - end if -End Function - -Function TestJava - Dim oObj as Object - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - gCurrentTestCase = cDocNew - oObj = createUnoService( cUnoJavaLoader ) - LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) - - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - - TestJava = not IsNull (oObj) -End Function - -Sub LoadLibrary( LibName as String ) - - dim args(1) - dim arg as new com.sun.star.beans.PropertyValue - arg.Name = "LibraryName" - arg.Value = LibName - args(0) = arg - - dim url as new com.sun.star.util.URL - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url.Complete = "slot:6517" - trans.parsestrict( url ) - - dim disp as object - disp = StarDesktop.currentFrame.queryDispatch( url, "", 0 ) - disp.dispatch( url, args() ) - -End Sub - -Sub LoadDoc (DocName as String) as Object - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url = createUnoStruct("com.sun.star.util.URL" ) - url.Complete = DocName - if Left(DocName, 5 ) <> "file:" then - trans.parsestrict( url ) - endif - - Dim aPropArray(0) as Object - aPropArray(0) = CreateUnoStruct("com.sun.star.beans.PropertyValue") - aPropArray(0).Name = "OpenFlags" - aPropArray(0).Value = "S" - - dim doc as object - dim noargs() - doc = StarDesktop.loadComponentFromURL( url.Complete, "_blank", 0, aPropArray() ) ' XModel - LoadDoc = doc -End Sub - -Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string ) - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url = createUnoStruct("com.sun.star.util.URL" ) - url.Complete = DocName - if Left(DocName, 5 ) <> "file:" then - trans.parsestrict( url ) - endif - - if not (sFilterName = "") then - Dim aPropArray(0) as Object - aPropArray(0) = CreateUnoStruct("com.sun.star.beans.PropertyValue") - aPropArray(0).Name = "FilterName" - aPropArray(0).Value = sFilterName - - oDoc.storeAsURL( url.Complete, aPropArray() ) - else - MessageBox "Filtername is unknown!" - end if -end Sub - -Function CloseDoc( oDoc as Object ) - Dim oListener as Object - oListener = CreateUnoListener( "Events.closeListener_", "com.sun.star.util.XCloseListener" ) - oDoc.addCloseListener( oListener ) - - Events.ResetCloseListenerFlag() - oDoc.close( true ) - closeDoc = Events.HasCloseListenerBeenCalled() - - if ( Not Events.HasCloseListenerBeenCalled() ) Then - ' do this only if closing was not successful - otherwise, we'd get a DisposedException - oDoc.removeCloseListener( oListener ) - End If -End Function - diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml deleted file mode 100644 index a9f1fc2e316d..000000000000 --- a/smoketestoo_native/data/Test_DB.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - -REM ***** Database Test ***** - -const cMessageDatabaseService = "Database Service" -const cMessageDatabaseOpen = "Open Database" -const cMessageDatabaseInsert = "Insert record into Database" -const cMessageDatabaseDelete = "Delete record from Database" -const cMessageDatabaseSeek = "Read other record from Database" -const cMessageDatabaseClose = "Close Database" - -Sub TestDB - - Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object - Dim sDBName as String, sTable as String, sCurrentMessage as String - Dim nRowCount as Integer - Dim bResult as Boolean - Const sTestString = "Automatical Test" - - On Local Error GoTo DBERROR - - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - - gCurrentTestCase = cDBService - sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext - - oDBContext = CreateUnoService(cUnoDatabaseContext) - sDBName=oDBContext.ElementNames(0) 'Names of Databases - - gCurrentTestCase = cDBOpen - sCurrentMessage = cMessageDatabaseOpen - - oDataSource = oDBContext.GetByName(sDBName) - sTable=oDataSource.Tables.ElementNames(0) - oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") - - LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) - if (IsNull(oDBConnection)) then - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub - End If - - ' Database is open now - - gCurrentTestCase = cDBService - sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet - oRowSet = createUnoService(cUnoRowSet) - - if (IsNull(oRowSet)) then - LogTestResult( "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) - Exit Sub - else - LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) - End If - - gCurrentTestCase = cDBInsert - sCurrentMessage = cMessageDatabaseInsert - - oRowSet.ActiveConnection = oDBConnection - - oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND - oRowSet.Command = "SELECT * FROM " + sTable - oRowSet.execute() - - oRowSet.moveToInsertRow - oRowSet.updateString(5, sTestString) - - oRowSet.insertRow() - nRowCount=oRowSet.RowCount - - oRowSet.moveToCurrentRow() - - bResult = (oRowSet.getString(5) = sTestString) - LogTestResult( "Database "+ cMessageDatabaseInsert, bResult ) - - 'delete only if insert passed - - if (bResult) Then - gCurrentTestCase = cDBDelete - sCurrentMessage = cMessageDatabaseDelete - oRowSet.deleteRow() - bResult = (nRowCount - oRowSet.RowCount = 0) - if ( bResult ) Then - oRowSet.next() - bResult = (nRowCount - oRowSet.RowCount = 1) - End If - LogTestResult( "Database "+ cMessageDatabaseDelete, bResult ) - End If - - ' read other record - - gCurrentTestCase = cDBSeek - sCurrentMessage = cMessageDatabaseSeek - oRowSet.first() - bResult = not (oRowSet.getString(5) = sTestString) - LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) - - gCurrentTestCase = cDBClose - sCurrentMessage = cMessageDatabaseClose - oDBConnection.Dispose() - LogTestResult( "Database "+ cMessageDatabaseClose, True ) - - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - DBERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( "Database "+ sCurrentMessage, FALSE ) - 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 deleted file mode 100644 index 735aae537596..000000000000 --- a/smoketestoo_native/data/Test_Ext.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - -REM ***** BASIC ***** - -const cMessageExtensionService = "Extension Service" -const cMessageExtensionInstall = "Install Extension" -const cMessageExtensionUninstall = "Uninstall Extension" - -Sub TestExtensions - Dim oTestExtension as Object, obj_null as Object - Dim sCurrentMessage as String - Dim bResult as Boolean - Dim sImplementationNameString as String - sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" - - On Local Error GoTo EXTERROR - - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - - sCurrentMessage = cMessageExtensionService - gCurrentTestCase = cEXTService - - 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for - 'adding the extension. The implementation is in - 'javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java and the code is in juh.jar - cmdEnv = createUnoService(cUnoSmoketestCommandEnvironment) - - 'Create the component context and then get the singleton ExtensionManager - 'A singleton cannot be created with createUnoService - ctx = getDefaultContext - ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) - - LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) - if (IsNull(ext_mgr)) then - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub - End If - - sCurrentMessage = cMessageExtensionInstall - gCurrentTestCase = cEXTInstall - - 'Add the extension. We must provide a file URL here. - 'By passing "user" we determine that the actions we perform on - 'XExtensionManager only affect the user installation. To modify the share installation one would pass "share". - - Dim props() as Object - ext_mgr.addExtension(sExtensionURL + cExtensionFileName, props, "user", obj_null, cmdEnv) - - 'Check if the extension has been added by creating a service which is contained in the extension. - oTestExtension = createUnoService(cUnoSmoketestTestExtension) - bResult = (oTestExtension.getImplementationName = sImplementationNameString) - LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) - if (not bResult) then - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub - End If - - sCurrentMessage = cMessageExtensionUninstall - gCurrentTestCase = cEXTUninstall - - 'Remove the package - ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) - - 'Try to create the service which is contained in the now removed extension. - oTestExtension = createUnoService(cUnoSmoketestTestExtension) - - 'The service must not be available anymore. Therefor isNull must return true. - LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) - - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - EXTERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( "Extension "+ sCurrentMessage, False ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error - -End Sub - diff --git a/smoketestoo_native/data/content.xml b/smoketestoo_native/data/content.xml deleted file mode 100644 index 3c81bbfbad5e..000000000000 --- a/smoketestoo_native/data/content.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - stardiv.one.form.control.CommandButton - - - - - - - - - - - - stardiv.one.form.control.CommandButton - - - - - - - - - - - - stardiv.one.form.control.CommandButton - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/smoketestoo_native/data/dialog-lb.xml b/smoketestoo_native/data/dialog-lb.xml deleted file mode 100644 index 973dfe688828..000000000000 --- a/smoketestoo_native/data/dialog-lb.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/smoketestoo_native/data/dialog-lc.xml b/smoketestoo_native/data/dialog-lc.xml deleted file mode 100644 index e3a5a0e326e4..000000000000 --- a/smoketestoo_native/data/dialog-lc.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/smoketestoo_native/data/makefile.mk b/smoketestoo_native/data/makefile.mk deleted file mode 100644 index 2096d07de90e..000000000000 --- a/smoketestoo_native/data/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#***********************************************************************/ - -PRJ = .. -PRJNAME = smoketestoo_native -TARGET = data - -.INCLUDE: settings.mk - -$(BIN)/smoketestdoc.sxw: $(MISC)/zip/smoketestdoc.sxw - $(COPY) $< $@ - -$(MISC)/zip/smoketestdoc.sxw: \ - Events.xml \ - Global.xml \ - OptionsDlg.xml \ - Test_10er.xml \ - Test_DB.xml \ - Test_Ext.xml \ - content.xml \ - dialog-lb.xml \ - dialog-lc.xml \ - manifest.xml \ - meta.xml \ - script-lb.xml \ - script-lc.xml \ - settings.xml \ - styles.xml - $(RM) -r $(MISC)/zip - $(MKDIR) $(MISC)/zip - $(COPY) content.xml meta.xml settings.xml styles.xml $(MISC)/zip/ - printf application/vnd.sun.xml.writer > $(MISC)/zip/mimetype - $(MKDIR) $(MISC)/zip/META-INF - $(COPY) manifest.xml $(MISC)/zip/META-INF/ - $(MKDIR) $(MISC)/zip/Basic - $(COPY) script-lc.xml $(MISC)/zip/Basic/ - $(MKDIR) $(MISC)/zip/Basic/Standard - $(COPY) script-lb.xml Events.xml Global.xml Test_10er.xml Test_DB.xml \ - Test_Ext.xml $(MISC)/zip/Basic/Standard/ - $(MKDIR) $(MISC)/zip/Dialogs - $(COPY) dialog-lc.xml $(MISC)/zip/Dialogs/ - $(MKDIR) $(MISC)/zip/Dialogs/Standard - $(COPY) dialog-lb.xml OptionsDlg.xml $(MISC)/zip/Dialogs/Standard/ - cd $(MISC)/zip && zip -rD $(@:f) . - -.INCLUDE: target.mk diff --git a/smoketestoo_native/data/manifest.xml b/smoketestoo_native/data/manifest.xml deleted file mode 100644 index 48fc9ce900a0..000000000000 --- a/smoketestoo_native/data/manifest.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/smoketestoo_native/data/meta.xml b/smoketestoo_native/data/meta.xml deleted file mode 100644 index 43f14295e2b3..000000000000 --- a/smoketestoo_native/data/meta.xml +++ /dev/null @@ -1,28 +0,0 @@ - - -Oracle_Open_Office/3.2$Win32 OpenOffice.org_project/300m77$Build-9496$CWS-renaissance22001-06-08T15:59:032007-01-18T12:45:22de-DE0PT0S diff --git a/smoketestoo_native/data/script-lb.xml b/smoketestoo_native/data/script-lb.xml deleted file mode 100644 index fc4f6c6370ba..000000000000 --- a/smoketestoo_native/data/script-lb.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/smoketestoo_native/data/script-lc.xml b/smoketestoo_native/data/script-lc.xml deleted file mode 100644 index e3a5a0e326e4..000000000000 --- a/smoketestoo_native/data/script-lc.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/smoketestoo_native/data/settings.xml b/smoketestoo_native/data/settings.xml deleted file mode 100644 index cd4524b741ff..000000000000 --- a/smoketestoo_native/data/settings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - -003638217120truefalseview217120300200363801711900false100falsefalsefalsefalsefalse1falsefalsetruefalsetruefalsetruetruefalsetruetrueGgX+/01pY3Jvc29mdCBYUFMgRG9jdW1lbnQgV3JpdGVyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATWljcm9zb2Z0IFhQUyBEb2N1bWVudCBXcml0ZXIAAAAWAAEAPAQAAAAAAAAFAFZUAAAkbQAAM1ROVwIACABNAGkAYwByAG8AcwBvAGYAdAAgAFgAUABTACAARABvAGMAdQBtAGUAbgB0ACAAVwByAGkAdABlAHIAAAAAAAAAAQQABtwAWAMD/wAAAQABAJoLNAhkAAEADwBYAgIAAQBYAgIAAABBADQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAACAAAAAQAAAP////8AAAAAAAAAAAAAAAAAAAAARElOVSIAEAFMAwwAytL2cgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAQAQAAU01USgAAAAAQAAABTQBpAGMAcgBvAHMAbwBmAHQAIABYAFAAUwAgAEQAbwBjAHUAbQBlAG4AdAAgAFcAcgBpAHQAZQByAAAASW5wdXRCaW4ARk9STVNPVVJDRQBSRVNETEwAVW5pcmVzRExMAEludGVybGVhdmluZwBPRkYASW1hZ2VUeXBlAEpQRUdNZWQAT3JpZW50YXRpb24AUE9SVFJBSVQAQ29sbGF0ZQBPRkYAUmVzb2x1dGlvbgBPcHRpb24xAFBhcGVyU2l6ZQBMRVRURVIAQ29sb3JNb2RlADI0YnBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAABNWERXAQEAABIAQ09NUEFUX0RVUExFWF9NT0RFDgBEVVBMRVhfVU5LTk9XTg==Adreßbuchfalseadressenfalsefalsefalsetruetruetruefalse0falsetruefalseMicrosoft XPS Document Writertruefalsetruetrue0truefalsefalsefalsetruetrue0truefalsetruefalsefalsetruefalsetruefalsetruetruedisabledfalsefalsefalse diff --git a/smoketestoo_native/data/styles.xml b/smoketestoo_native/data/styles.xml deleted file mode 100644 index 3f8d75fa6db3..000000000000 --- a/smoketestoo_native/data/styles.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk old mode 100644 new mode 100755 index 18f3a42b789f..aa7d4f5a0725 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -56,7 +56,7 @@ ALLTAR : cpptest cpptest : $(SHL1TARGETN) -TEST_ARGUMENTS = smoketest.doc=$(BIN)/smoketestdoc.sxw +TEST_ARGUMENTS = smoketest.doc=$(OUTDIR)/bin$(PROEXT)/smoketestdoc.sxw CPPTEST_LIBRARY = $(SHL1TARGETN) .IF "$(OS)" != "WNT" diff --git a/smoketestoo_native/prj/build.lst b/smoketestoo_native/prj/build.lst old mode 100644 new mode 100755 index 147a363d3da5..9527079f56d2 --- a/smoketestoo_native/prj/build.lst +++ b/smoketestoo_native/prj/build.lst @@ -1,5 +1,3 @@ -smtoon smoketestoo_native :: instsetoo_native test NULL +smtoon smoketestoo_native :: instsetoo_native test smoketestdoc NULL smtoon smoketestoo_native usr1 - all smoketestoonative_mkout NULL -smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smoketestoonative_csscs NULL -smtoon smoketestoo_native\data nmake - all smoketestoonative_data NULL -smtoon smoketestoo_native nmake - all,test10 smoketestoonative_mk smoketestoonative_csscs smoketestoonative_data NULL +smtoon smoketestoo_native nmake - all,test10 smoketestoonative_mk NULL diff --git a/smoketestoo_native/prj/d.lst b/smoketestoo_native/prj/d.lst old mode 100644 new mode 100755 diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx old mode 100644 new mode 100755 diff --git a/smoketestoo_native/version.map b/smoketestoo_native/version.map old mode 100644 new mode 100755 -- cgit From 1275251797b8ce74312d91a9e0f5252068ebd6c8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:15:05 +0100 Subject: debuglevels: bin, not binPROEXT --- smoketestoo_native/makefile.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk index aa7d4f5a0725..76ea6c2c52ae 100755 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -56,18 +56,18 @@ ALLTAR : cpptest cpptest : $(SHL1TARGETN) -TEST_ARGUMENTS = smoketest.doc=$(OUTDIR)/bin$(PROEXT)/smoketestdoc.sxw +TEST_ARGUMENTS = smoketest.doc=$(OUTDIR)/bin$(UPDMINOREXT)/smoketestdoc.sxw CPPTEST_LIBRARY = $(SHL1TARGETN) .IF "$(OS)" != "WNT" $(installationtest_instpath).flag : $(shell ls \ $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).tar.gz) - $(RM) -r $(installationtest_instpath) - $(MKDIRHIER) $(installationtest_instpath) - cd $(installationtest_instpath) && $(GNUTAR) xfz \ + $(COMMAND_ECHO)$(RM) -r $(installationtest_instpath) + $(COMMAND_ECHO)$(MKDIRHIER) $(installationtest_instpath) + $(COMMAND_ECHO)cd $(installationtest_instpath) && $(GNUTAR) xfz \ $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).tar.gz - $(MV) $(installationtest_instpath)/OOo_*_install-arc_$(defaultlangiso) \ + $(COMMAND_ECHO)$(MV) $(installationtest_instpath)/OOo_*_install-arc_$(defaultlangiso) \ $(installationtest_instpath)/opt - $(TOUCH) $@ + $(COMMAND_ECHO)$(TOUCH) $@ cpptest : $(installationtest_instpath).flag .END -- cgit From e648dff4561470d3aba457ec916437d04fea5c0c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Feb 2011 10:23:55 +0100 Subject: debuglevels: explicit failure upon catching an UNO exception (which gives a slightly better idea of the failure than what cppunit emits by default) --- smoketestoo_native/smoketest.cxx | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx index a4e532123456..002967823e00 100755 --- a/smoketestoo_native/smoketest.cxx +++ b/smoketestoo_native/smoketest.cxx @@ -48,6 +48,7 @@ #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/util/URL.hpp" #include +#include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/implbase1.hxx" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" @@ -56,6 +57,7 @@ #include #include "osl/conditn.hxx" #include "osl/diagnose.h" +#include "rtl/strbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "test/gettestargument.hxx" @@ -130,23 +132,46 @@ public: private: CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(test); + CPPUNIT_TEST(runSmoketestDoc); CPPUNIT_TEST_SUITE_END(); - void test(); + void runSmoketestDoc(); + + ::rtl::OString getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ); test::OfficeConnection connection_; }; +::rtl::OString Test::getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ) +{ + ::rtl::OStringBuffer failMessage; + failMessage.append( i_context ); + failMessage.append( ": caught a " ); + failMessage.append( ::rtl::OUStringToOString( i_exception.getValueTypeName(), RTL_TEXTENCODING_ASCII_US ) ); + return failMessage.makeStringAndClear(); +} + void Test::setUp() { - connection_.setUp(); + try { + connection_.setUp(); + } + catch( css::uno::Exception const & ) { + CPPUNIT_FAIL( getFailMessage( "setting up the connection failed", ::cppu::getCaughtException() ).getStr() ); + } } void Test::tearDown() { - connection_.tearDown(); + try { + connection_.tearDown(); + } + catch( css::uno::Exception const & ) { + CPPUNIT_FAIL( getFailMessage( "tearing down the connection failed", ::cppu::getCaughtException() ).getStr() ); + } } -void Test::test() { +void Test::runSmoketestDoc() { + try + { rtl::OUString doc; CPPUNIT_ASSERT( test::getTestArgument( @@ -195,6 +220,10 @@ void Test::test() { result.condition.wait(); CPPUNIT_ASSERT(result.success); CPPUNIT_ASSERT_EQUAL(rtl::OUString(), result.result); + } + catch( css::uno::Exception const & ) { + CPPUNIT_FAIL( getFailMessage( "executing the smoketest macro", ::cppu::getCaughtException() ).getStr() ); + } } CPPUNIT_TEST_SUITE_REGISTRATION(Test); -- cgit From 123c60ed46489e3147d58ab6684c9de1cf0f656d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Feb 2011 10:32:07 +0100 Subject: debuglevels: let smoketestoo_native use a dedicated version of dbgsvrc/DBGSV_INIT, instead of using the default which the build env points to - it might direct assertion output to whereever ... --- smoketestoo_native/makefile.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk index 76ea6c2c52ae..aab245371a72 100755 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -29,6 +29,8 @@ TARGET = smoketest ENABLE_EXCEPTIONS = TRUE +ABORT_ON_ASSERTION = TRUE + .INCLUDE: settings.mk CFLAGSCXX += $(CPPUNIT_CFLAGS) -- cgit From e2cb37ffec3734ab7894af5cf52a97639630cedd Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 25 Feb 2011 11:32:55 +0100 Subject: debuglevels: #i117073# added cppunittester --protector support; added unoexceptionprotector and use it in installationtest.mk; reverted changes to smoketest.cxx obsoleted by these additions --- smoketestoo_native/smoketest.cxx | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx index 002967823e00..a4e532123456 100755 --- a/smoketestoo_native/smoketest.cxx +++ b/smoketestoo_native/smoketest.cxx @@ -48,7 +48,6 @@ #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/util/URL.hpp" #include -#include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/implbase1.hxx" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" @@ -57,7 +56,6 @@ #include #include "osl/conditn.hxx" #include "osl/diagnose.h" -#include "rtl/strbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "test/gettestargument.hxx" @@ -132,46 +130,23 @@ public: private: CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(runSmoketestDoc); + CPPUNIT_TEST(test); CPPUNIT_TEST_SUITE_END(); - void runSmoketestDoc(); - - ::rtl::OString getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ); + void test(); test::OfficeConnection connection_; }; -::rtl::OString Test::getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ) -{ - ::rtl::OStringBuffer failMessage; - failMessage.append( i_context ); - failMessage.append( ": caught a " ); - failMessage.append( ::rtl::OUStringToOString( i_exception.getValueTypeName(), RTL_TEXTENCODING_ASCII_US ) ); - return failMessage.makeStringAndClear(); -} - void Test::setUp() { - try { - connection_.setUp(); - } - catch( css::uno::Exception const & ) { - CPPUNIT_FAIL( getFailMessage( "setting up the connection failed", ::cppu::getCaughtException() ).getStr() ); - } + connection_.setUp(); } void Test::tearDown() { - try { - connection_.tearDown(); - } - catch( css::uno::Exception const & ) { - CPPUNIT_FAIL( getFailMessage( "tearing down the connection failed", ::cppu::getCaughtException() ).getStr() ); - } + connection_.tearDown(); } -void Test::runSmoketestDoc() { - try - { +void Test::test() { rtl::OUString doc; CPPUNIT_ASSERT( test::getTestArgument( @@ -220,10 +195,6 @@ void Test::runSmoketestDoc() { result.condition.wait(); CPPUNIT_ASSERT(result.success); CPPUNIT_ASSERT_EQUAL(rtl::OUString(), result.result); - } - catch( css::uno::Exception const & ) { - CPPUNIT_FAIL( getFailMessage( "executing the smoketest macro", ::cppu::getCaughtException() ).getStr() ); - } } CPPUNIT_TEST_SUITE_REGISTRATION(Test); -- cgit From e4aa69025215074e4be1fdd9b501f34361a064f4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Mar 2011 10:42:58 +0100 Subject: debuglevels: open the smoketest doc read-only --- smoketestoo_native/smoketest.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'smoketestoo_native') diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx index a4e532123456..5fd16914b0d7 100755 --- a/smoketestoo_native/smoketest.cxx +++ b/smoketestoo_native/smoketest.cxx @@ -151,13 +151,18 @@ void Test::test() { CPPUNIT_ASSERT( test::getTestArgument( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("smoketest.doc")), &doc)); - css::uno::Sequence< css::beans::PropertyValue > args(1); + css::uno::Sequence< css::beans::PropertyValue > args(2); args[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")); args[0].Handle = -1; args[0].Value <<= com::sun::star::document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; args[0].State = css::beans::PropertyState_DIRECT_VALUE; + args[1].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + args[1].Handle = -1; + args[1].Value <<= sal_True; + args[1].State = css::beans::PropertyState_DIRECT_VALUE; css::util::URL url; url.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( -- cgit