diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-25 09:25:18 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-25 09:25:18 +0100 |
commit | 6d5880a46ca136c69bea3efea703f0d654505c2b (patch) | |
tree | 1796e287945d36d195263b43e8d9b1a3ce1b380a | |
parent | fs34b: pulled and merged CWS dba34d (diff) | |
parent | CWS-TOOLING: integrate CWS dba34c (diff) | |
download | core-6d5880a46ca136c69bea3efea703f0d654505c2b.tar.gz core-6d5880a46ca136c69bea3efea703f0d654505c2b.zip |
fs34b: pulled and merged DEV300:m104
-rwxr-xr-x | smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF (renamed from smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF) | 0 | ||||
-rwxr-xr-x | smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl (renamed from smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl) | 0 | ||||
-rwxr-xr-x | smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java (renamed from smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java) | 0 | ||||
-rwxr-xr-x | smoketestdoc/com/sun/star/comp/smoketest/delzip (renamed from smoketestoo_native/com/sun/star/comp/smoketest/delzip) | 0 | ||||
-rwxr-xr-x | smoketestdoc/com/sun/star/comp/smoketest/makefile.mk (renamed from smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk) | 41 | ||||
-rwxr-xr-x | smoketestdoc/com/sun/star/comp/smoketest/manifest.xml (renamed from smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/Events.xml (renamed from smoketestoo_native/data/Events.xml) | 23 | ||||
-rw-r--r-- | smoketestdoc/data/Global.xml (renamed from smoketestoo_native/data/Global.xml) | 479 | ||||
-rw-r--r-- | smoketestdoc/data/OptionsDlg.xml (renamed from smoketestoo_native/data/OptionsDlg.xml) | 42 | ||||
-rw-r--r-- | smoketestdoc/data/Test_10er.xml (renamed from smoketestoo_native/data/Test_10er.xml) | 388 | ||||
-rw-r--r-- | smoketestdoc/data/Test_DB.xml (renamed from smoketestoo_native/data/Test_DB.xml) | 78 | ||||
-rw-r--r-- | smoketestdoc/data/Test_Ext.xml (renamed from smoketestoo_native/data/Test_Ext.xml) | 57 | ||||
-rw-r--r-- | smoketestdoc/data/content.xml | 113 | ||||
-rw-r--r-- | smoketestdoc/data/dialog-lb.xml (renamed from smoketestoo_native/data/dialog-lb.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/dialog-lc.xml (renamed from smoketestoo_native/data/dialog-lc.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/makefile.mk (renamed from smoketestoo_native/data/makefile.mk) | 32 | ||||
-rw-r--r-- | smoketestdoc/data/manifest.xml (renamed from smoketestoo_native/data/manifest.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/meta.xml (renamed from smoketestoo_native/data/meta.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/script-lb.xml (renamed from smoketestoo_native/data/script-lb.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/script-lc.xml (renamed from smoketestoo_native/data/script-lc.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/settings.xml (renamed from smoketestoo_native/data/settings.xml) | 0 | ||||
-rw-r--r-- | smoketestdoc/data/styles.xml (renamed from smoketestoo_native/data/styles.xml) | 0 | ||||
-rwxr-xr-x | smoketestdoc/prj/build.lst | 4 | ||||
-rwxr-xr-x | smoketestdoc/prj/d.lst | 4 | ||||
-rw-r--r-- | smoketestoo_native/data/content.xml | 28 | ||||
-rwxr-xr-x[-rw-r--r--] | smoketestoo_native/makefile.mk | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | smoketestoo_native/prj/build.lst | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | smoketestoo_native/smoketest.cxx | 7 | ||||
-rw-r--r-- | test/prj/build.lst | 3 | ||||
-rw-r--r-- | test/prj/d.lst | 3 | ||||
-rw-r--r-- | test/source/cpp/makefile.mk | 11 | ||||
-rw-r--r-- | test/source/cpp/unoexceptionprotector/makefile.mk | 56 | ||||
-rw-r--r-- | test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx | 98 | ||||
-rw-r--r-- | testautomation/graphics/required/includes/global/id_004.inc | 2 |
34 files changed, 894 insertions, 595 deletions
diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF b/smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF index 09e2f42ca0f6..09e2f42ca0f6 100755 --- a/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF +++ b/smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl index 83c370e11a18..83c370e11a18 100755 --- a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl +++ b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java index c08c719116ae..c08c719116ae 100755 --- a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java +++ b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/delzip b/smoketestdoc/com/sun/star/comp/smoketest/delzip index 636fda90bfcb..636fda90bfcb 100755 --- a/smoketestoo_native/com/sun/star/comp/smoketest/delzip +++ b/smoketestdoc/com/sun/star/comp/smoketest/delzip diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk b/smoketestdoc/com/sun/star/comp/smoketest/makefile.mk index da9b302791f0..173898970254 100755 --- a/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk +++ b/smoketestdoc/com/sun/star/comp/smoketest/makefile.mk @@ -25,9 +25,9 @@ # #************************************************************************* -PRJ = ..$/..$/..$/..$/.. -PRJNAME = smoke_test -PACKAGE = com$/sun$/star$/comp$/smoketest +PRJ = ../../../../.. +PRJNAME = smoketestdoc +PACKAGE = com/sun/star/comp/smoketest TARGET = com_sun_star_comp_smoketest no_common_build_zip:=TRUE @@ -40,7 +40,6 @@ no_common_build_zip:=TRUE JARFILES = ridl.jar jurt.jar unoil.jar juh.jar - JARTARGET = TestExtension.jar JARCOMPRESS = TRUE CUSTOMMANIFESTFILE = MANIFEST.MF @@ -48,41 +47,41 @@ CUSTOMMANIFESTFILE = MANIFEST.MF ZIP1TARGET=TestExtension ZIP1LIST=* ZIPFLAGS=-r -ZIP1DIR=$(MISC)$/$(TARGET) +ZIP1DIR=$(MISC)/$(TARGET) ZIP1EXT=.oxt # --- Files -------------------------------------------------------- -#COPY_OXT_MANIFEST:= $(MISC)$/$(TARGET)$/META-INF$/manifest.xml +#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 +ZIP1DEPS=$(MISC)/$(TARGET)/$(JARTARGET)\ + $(MISC)/$(TARGET)/TestExtension.rdb\ + $(MISC)/$(TARGET)/META-INF/manifest.xml .INCLUDE : target.mk -$(MISC)$/$(TARGET)$/META-INF: +$(MISC)/$(TARGET)/META-INF: @-$(MKDIRHIER) $(@) -$(MISC)$/TestExtension.urd: TestExtension.idl - $(IDLC) -O$(MISC) -I$(SOLARIDLDIR) -cid -we $< +$(MISC)/TestExtension.urd: TestExtension.idl + $(COMMAND_ECHO)$(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 $(MISC)/$(TARGET)/TestExtension.rdb : $(MISC)/$(TARGET)/META-INF -$(MISC)$/$(TARGET)$/META-INF$/manifest.xml: manifest.xml - $(COPY) $< $@ +$(MISC)/$(TARGET)/META-INF/manifest.xml: manifest.xml + $(COMMAND_ECHO)$(COPY) $< $@ -$(MISC)$/$(TARGET)$/TestExtension.rdb: $(MISC)$/TestExtension.urd - $(REGMERGE) $@ /UCR $< +$(MISC)/$(TARGET)/TestExtension.rdb: $(MISC)/TestExtension.urd + $(COMMAND_ECHO)$(REGMERGE) $@ /UCR $< -$(JAVACLASSFILES) .UPDATEALL: $(MISC)$/$(TARGET)$/TestExtension.rdb - $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -X$(SOLARBINDIR)/types.rdb $< +$(JAVACLASSFILES) .UPDATEALL: $(MISC)/$(TARGET)/TestExtension.rdb + $(COMMAND_ECHO)$(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -X$(SOLARBINDIR)/types.rdb $< -$(MISC)$/$(TARGET)$/$(JARTARGET) : $(JARTARGETN) - $(COPY) $< $@ +$(MISC)/$(TARGET)/$(JARTARGET) : $(JARTARGETN) + $(COMMAND_ECHO)$(COPY) $< $@ .ELSE @all: diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml b/smoketestdoc/com/sun/star/comp/smoketest/manifest.xml index 7e3e7947aa0f..7e3e7947aa0f 100755 --- a/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml +++ b/smoketestdoc/com/sun/star/comp/smoketest/manifest.xml diff --git a/smoketestoo_native/data/Events.xml b/smoketestdoc/data/Events.xml index 61272293f633..414f2c48e884 100644 --- a/smoketestoo_native/data/Events.xml +++ b/smoketestdoc/data/Events.xml @@ -28,6 +28,8 @@ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Events" script:language="StarBasic">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 </script:module> diff --git a/smoketestoo_native/data/Global.xml b/smoketestdoc/data/Global.xml index 1ff082b0a1eb..99c7bf1fe9af 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestdoc/data/Global.xml @@ -28,30 +28,36 @@ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Global" script:language="StarBasic">REM ***** BASIC ***** -const cMaxErrorStates = 13 +const cMaxErrorStates = 14 const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256 const cParagraphBreak = 0 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, 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 cTestClosureSetupDoc = 0, cTestClosureWriteStatus = 1 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 cStTestGlue = 12 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 +global const frmTestClosure = 15 + +Global gCurrentDocTest As Integer +Global gCurrentTestCase As Integer global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 @@ -83,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" @@ -91,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 @@ -100,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 @@ -109,42 +116,110 @@ 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 +Sub AssertionHandler( sMessage as String ) + LogTestResult( "assertion caught: " + sMessage, FALSE ) +End Sub + Sub Main + On Local Error Goto MainError + + gCurrentDocTest = frmTestClosure + gCurrentTestCase = cLogfileFailed + + DeleteAllSavedFiles() + DeleteAllLogFiles() + SetupWorkPath() + + if GetSystem (sWorkPath) = "windows" then + sWorkPath = ConvertPathToWin (sWorkPath) + end if + + LocalTestLog% = OpenLogDat( GetLogFileName( gCurrentDocTest ) ) + + gCurrentTestCase = cTestClosureSetupDoc + CaptureAssertions( "AssertionHandler" ) + call SetGlobalDoc + + Dim bWasModified as Boolean + bWasModified = gOutputDoc.isModified() + if bShowTable then - call ClearDoc (gOutPutDoc) + call ClearDoc (gOutputDoc) end If call ClearStatus + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + + Dim nPreserveFileHandle% + nPreserveFileHandle% = LocalTestLog% Call Test_10er.Main + LocalTestLog% = nPreserveFileHandle% + gCurrentDocTest = frmTestClosure + gCurrentTestCase = cTestClosureWriteStatus 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 + Else + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + End If + + ' print the 'test complete' marker + Print #LocalTestLog%, "---" + LocalTestLog% = 0 + + gOutputDoc.setModified( bWasModified ) + + CaptureAssertions( "" ) + Exit Sub + +MainError: + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( "testclosure " + GetTestGlueDescription( gCurrentTestCase ), FALSE ) + Close #LocalTestLog% + LocalTestLog = 0 + End If End Sub +Function GetTestGlueDescription( nTestCase as Integer ) + Select Case ( nTestCase ) + case cTestClosureSetupDoc + GetTestGlueDescription = "setup" + case cTestClosureWriteStatus + GetTestGlueDescription = "write_status" + case Else + GetTestGlueDescription = "" + End Select +End Function + Sub CreateStatusTable dim tableHeaders(7) as string tableHeaders(cStWriter) = "Writer" @@ -156,22 +231,17 @@ 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(3) as string + tableRows(cDocNew) = "new" + tableRows(cDocSaveOpen8) = "V8.0" + tableRows(cDocSaveOpenXML) = "XML" + tableRows(cDocClose) = "close" - aDoc = gOutPutDoc + aDoc = gOutputDoc 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) @@ -180,68 +250,48 @@ Sub CreateStatusTable xCursor.GoRight (1, False) table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(7,9) + table.initialize(5,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 - 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% - xCursor.gotoStart(FALSE) -' SetParagraphBreak (xCursor) -' SetParagraphBreak (xCursor) - - tableCursor.gotoStart(FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - for i% = 0 to 3 - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + for i% = LBound( tableRows ) to UBound( tableRows ) + tableCell = table.getCellByPosition( 0, i% + 1 ) + tableCell.String=tableRows(i%) next i% end Sub Sub CreateStatusTable2 - dim tableHeaders(5) as string - tableHeaders(cStDataBase-9) = "Database" + dim tableHeaders(4) as string + 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 tableColums(5) as string - tableColums(cDBService ) = "services" - tableColums(cDBOpen ) = "open" - tableColums(cDBInsert ) = "insert" - tableColums(cDBDelete ) = "delete" - tableColums(cDBSeek ) = "seek" - tableColums(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(cTestClosureSetupDoc ) = "setup test" + tableRows3(cTestClosureWriteStatus ) = "write test result" - aDoc = gOutPutDoc + aDoc = gOutputDoc xText = aDoc.Text xCursor = xText.createTextCursor() @@ -255,111 +305,98 @@ 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) - tableCursor = table.createCursorByCellName(table.CellNames(0)) - tableCursor.gotoStart(FALSE) - tableCursor.goRight(1,FALSE) - - for i% = 0 to 5 - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - tableCursor.goRight(1,FALSE) + for i% = LBound( tableHeaders ) to UBound( tableHeaders ) + 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% = 0 to 5 - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + for i% = LBound( tableRows ) to UBound( tableRows ) + tableCell = table.getCellByPosition( 0, i% + 1 ) + tableCell.String=tableRows(i%) next i% - tableCursor.gotoStart(FALSE) - tableCursor.goRight(2,FALSE) - - for i% = 0 to 3 - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums2(i%) + for i% = LBound( tableRows2 ) to UBound( tableRows2 ) + tableCell = table.getCellByPosition( 2, i% + 1 ) + tableCell.String=tableRows2(i%) + next i% - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + 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 + aDoc = gOutputDoc table = aDoc.TextTables.GetByIndex (1) - 'table = aDoc.TextTables.GetByName ("StTab1") for j% = 0 to 7 - for i% = 0 to 5 + for i% = 0 to 3 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 - 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 @@ -368,11 +405,33 @@ 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( sTestCaseDescription as String, bSuccess as Boolean ) + If ( gCurrentTestCase = cLogfileFailed ) Then + Dim sAnnotation as String + sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" + LogState( FALSE, sAnnotation, GlobalTestLog ) + RecordTestCaseStatus( 0, FALSE, sAnnotation ) + Else + bSuccess = RecordTestCaseStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) + If ( LocalTestLog <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, LocalTestLog ) + EndIf + if ( GlobalTestLog <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, GlobalTestLog ) + EndIf + End If +End Sub + +Function RecordTestCaseStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) as Boolean Dim nStatusType as Integer Dim nState as integer - nStatusType = GetStatusType (nDocType) - If nStatusType = cStNone then Exit Sub + nStatusType = GetStatusType( gCurrentDocTest ) + If nStatusType = cStNone then Exit Function + + If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then + ' don't overwrite a previous "failed" state for this test + bState = FALSE + End If if bState then nState = cLogTrue @@ -381,30 +440,34 @@ Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean) end If gErrorState (nStatusType, nAction) = nState -end Sub + + If ( nState = cLogFalse ) And ( sFailureAnnotation <> "" ) Then + gTestCaseAnnotations( nStatusType, nAction ) = gTestCaseAnnotations( nStatusType, nAction ) + sFailureAnnotation + chr(13) + End If + + RecordTestCaseStatus = bState +End Function 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 frmTestClosure + GetStatusType = cStTestGlue ' test framework case frmDataBase GetStatusType = cStDataBase 'DataBase case frmExtension @@ -494,56 +557,53 @@ 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 (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("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) + bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) + bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) end Sub Sub SetDefaultOptions @@ -565,11 +625,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 @@ -579,8 +634,8 @@ Sub StartTestByOptions call ReadOptions call Main if bMakeTerminateAfterTest then - ClearDocFull (gOutPutDoc) - gOutPutDoc.dispose + ClearDocFull (gOutputDoc) + gOutputDoc.dispose 'StarDesktop.Terminate 'EnableReschedule( false ) @@ -608,7 +663,7 @@ Function StartTestWithDefaultOptions action(cDocNew) = "new" action(cDocSaveOpen8) = "V8.0" action(cDocSaveOpenXML) = "XML" - action(cDocSaveOpen50) = "V5.0" + action(cDocClose) = "close" dim baseAction(5) as string baseAction(cDBService) = "services" baseAction(cDBOpen) = "open" diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestdoc/data/OptionsDlg.xml index 213c880d4d51..c03026185886 100644 --- a/smoketestoo_native/data/OptionsDlg.xml +++ b/smoketestdoc/data/OptionsDlg.xml @@ -28,35 +28,37 @@ <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd"> <dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="OptionsDlg" dlg:left="173" dlg:top="100" dlg:width="223" dlg:height="214" dlg:closeable="true" dlg:moveable="true" dlg:title="Options for smoketest"> <dlg:bulletinboard> - <dlg:titledbox dlg:id="fmTests" dlg:tab-index="0" dlg:left="114" dlg:top="7" dlg:width="101" dlg:height="157"> + <dlg:titledbox dlg:id="fmTests" dlg:tab-index="0" dlg:left="114" dlg:top="7" dlg:width="100" dlg:height="157"> <dlg:title dlg:value="Tests"/> </dlg:titledbox> - <dlg:titledbox dlg:id="fmInstalls" dlg:tab-index="1" dlg:left="7" dlg:top="7" dlg:width="100" dlg:height="157"> + <dlg:checkbox dlg:id="cbWriterTest" dlg:tab-index="1" dlg:left="19" dlg:top="21" dlg:width="80" dlg:height="8" dlg:value="Writer" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbCalcTest" dlg:tab-index="2" dlg:left="19" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Calc" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbImpressTest" dlg:tab-index="3" dlg:left="19" dlg:top="49" dlg:width="80" dlg:height="8" dlg:value="Impress" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbDrawTest" dlg:tab-index="4" dlg:left="19" dlg:top="63" dlg:width="80" dlg:height="8" dlg:value="Draw" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbHTMLTest" dlg:tab-index="5" dlg:left="19" dlg:top="77" dlg:width="80" dlg:height="8" dlg:value="HTML" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbMathTest" dlg:tab-index="6" dlg:left="19" dlg:top="91" dlg:width="80" dlg:height="8" dlg:value="Math" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbChartTest" dlg:tab-index="7" dlg:left="19" dlg:top="105" dlg:width="80" dlg:height="8" dlg:value="Chart" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbJavaTest" dlg:tab-index="8" dlg:left="19" dlg:top="119" dlg:width="80" dlg:height="8" dlg:value="Java" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbDatabaseTest" dlg:tab-index="9" dlg:left="19" dlg:top="133" dlg:width="80" dlg:height="8" dlg:value="Database" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbExtensionTest" dlg:tab-index="10" dlg:left="19" dlg:top="147" dlg:width="80" dlg:height="8" dlg:value="Extension" dlg:checked="false"/> + + <dlg:titledbox dlg:id="fmInstalls" dlg:tab-index="11" dlg:left="7" dlg:top="7" dlg:width="100" dlg:height="157"> <dlg:title dlg:value="Functions"/> </dlg:titledbox> - <dlg:checkbox dlg:id="cbWriterTest" dlg:tab-index="2" dlg:left="126" dlg:top="21" dlg:width="80" dlg:height="8" dlg:value="Writer" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbCalcTest" dlg:tab-index="3" dlg:left="126" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Calc" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbImpressTest" dlg:tab-index="4" dlg:left="126" dlg:top="49" dlg:width="80" dlg:height="8" dlg:value="Impress" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbDrawTest" dlg:tab-index="5" dlg:left="126" dlg:top="63" dlg:width="80" dlg:height="8" dlg:value="Draw" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbHTMLTest" dlg:tab-index="6" dlg:left="126" dlg:top="77" dlg:width="80" dlg:height="8" dlg:value="HTML" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbMathTest" dlg:tab-index="7" dlg:left="126" dlg:top="91" dlg:width="80" dlg:height="8" dlg:value="Math" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbChartTest" dlg:tab-index="8" dlg:left="126" dlg:top="105" dlg:width="80" dlg:height="8" dlg:value="Chart" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbSaveOpenXMLTest" dlg:tab-index="9" dlg:left="19" dlg:top="49" dlg:width="80" dlg:height="8" dlg:value="Save / Open XML" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbSaveOpen50Test" dlg:tab-index="10" dlg:left="19" dlg:top="63" dlg:width="80" dlg:height="8" dlg:value="Save / Open V5.0" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbTerminateAfterTest" dlg:tab-index="11" dlg:disabled="true" dlg:left="19" dlg:top="174" dlg:width="190" dlg:height="8" dlg:value="Terminate Office after test" dlg:checked="false"/> - <dlg:titledbox dlg:id="fmBroker" dlg:tab-index="12" dlg:left="7" dlg:top="169" dlg:width="208" dlg:height="17"/> - <dlg:button dlg:id="btOk" dlg:tab-index="13" dlg:left="7" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Ok" dlg:button-type="ok"> + <dlg:checkbox dlg:id="cbSaveOpen8Test" dlg:tab-index="12" dlg:left="126" dlg:top="21" dlg:width="80" dlg:height="8" dlg:value="Save / Open V8.0" dlg:checked="false"/> + <dlg:checkbox dlg:id="cbSaveOpenXMLTest" dlg:tab-index="13" dlg:left="126" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Save / Open XML" dlg:checked="false"/> + + <dlg:titledbox dlg:id="fmBroker" dlg:tab-index="15" dlg:left="7" dlg:top="169" dlg:width="208" dlg:height="17"/> + <dlg:checkbox dlg:id="cbTerminateAfterTest" dlg:tab-index="16" dlg:disabled="true" dlg:left="19" dlg:top="174" dlg:width="190" dlg:height="8" dlg:value="Terminate Office after test" dlg:checked="false"/> + + <dlg:button dlg:id="btOk" dlg:tab-index="17" dlg:left="7" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Ok" dlg:button-type="ok" dlg:default="true"> <script:event script:event-name="on-performaction" script:location="document" script:macro-name="Standard.Events.PressOk" script:language="StarBasic"/> </dlg:button> - <dlg:button dlg:id="btCancel" dlg:tab-index="14" dlg:left="80" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Cancel" dlg:button-type="ok"> + <dlg:button dlg:id="btCancel" dlg:tab-index="18" dlg:left="80" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Cancel" dlg:button-type="ok"> <script:event script:event-name="on-performaction" script:location="document" script:macro-name="Standard.Events.PressCancel" script:language="StarBasic"/> </dlg:button> - <dlg:button dlg:id="btStart" dlg:tab-index="15" dlg:left="152" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Smoketest"> + <dlg:button dlg:id="btStart" dlg:tab-index="19" dlg:left="152" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Smoketest"> <script:event script:event-name="on-performaction" script:location="vnd.sun.star.script" script:macro-name="Standard.Events.PressTest?language=Basic&location=document" script:language="Script"/> </dlg:button> - <dlg:checkbox dlg:id="cbJavaTest" dlg:tab-index="16" dlg:left="126" dlg:top="119" dlg:width="80" dlg:height="8" dlg:value="Java" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbSaveOpen8Test" dlg:tab-index="17" dlg:left="19" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Save / Open V8.0" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbDatabaseTest" dlg:tab-index="18" dlg:left="126" dlg:top="133" dlg:width="80" dlg:height="8" dlg:value="Database" dlg:checked="false"/> - <dlg:checkbox dlg:id="cbExtensionTest" dlg:tab-index="19" dlg:left="126" dlg:top="147" dlg:width="80" dlg:height="8" dlg:value="Extension" dlg:checked="false"/> </dlg:bulletinboard> </dlg:window> diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestdoc/data/Test_10er.xml index 56a8d130fc13..b929caccb1b8 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestdoc/data/Test_10er.xml @@ -30,12 +30,13 @@ 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" -const cTempFileName = "ttt" +const sTestGlueLogFileName = "testclosure.log" +const sLogFileName = "smoketest.log" +const cTempFileName = "smoketest_file" const cMessageSaveOpen8Doc = "Save/Open open Documents (8.0)" const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" @@ -44,8 +45,8 @@ const cMessageCloseDoc = "Close Document" Global sWorkPath$ Global sWorkPathURL$ -Global FileChannel% -Global MainFileChannel% +Global LocalTestLog% +Global GlobalTestLog% Sub Main call TestAllDocs() @@ -107,24 +108,21 @@ 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 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 @@ -143,15 +141,13 @@ Function OpenLogDat (sFileName as String) as Integer OpenLogDat = LocaleFileChannel% end Function -Function GetWorkPath as string - sTemp = "$(userpath)/temp/" - GetWorkPath = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function +Sub SetupWorkPath + Dim configManager as Object + configManager = CreateUnoService( "com.sun.star.config.SpecialConfigManager" ) -Function GetWorkURL as string - sTemp = "$(userurl)/temp/" - GetWorkURL = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function + sWorkPath = configManager.SubstituteVariables( "$(userpath)/temp/" ) + sWorkPathURL = configManager.SubstituteVariables( "$(userurl)/temp/" ) +End Sub Function GetSystem (sTmpWorkPath as string) as string GetSystem = "" @@ -180,100 +176,104 @@ 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 + sDocURL = gOutputDoc.URL CompatibilityMode(true) nStrPos = InStrRev (sDocURL, "/" ) CompatibilityMode(false) sExtensionURL = Left (sDocURL, nStrPos) - call DeleteAllSavedFiles() - call DeleteAllLogFiles() - MainFileChannel = OpenLogDat (sLogFileName) - call WriteTestSequence (MainFileChannel) + GlobalTestLog = OpenLogDat (sLogFileName) + call WriteTestSequence if bMakeWriterTest then - call MakeDocTest (frmWriter) + gCurrentDocTest = frmWriter + call MakeDocTest end if if bMakeCalcTest then - call MakeDocTest (frmCalc) + gCurrentDocTest = frmCalc + call MakeDocTest end if if bMakeImpressTest then - call MakeDocTest (frmImpress) + gCurrentDocTest = frmImpress + call MakeDocTest end if if bMakeDrawTest then - call MakeDocTest (frmDraw) + gCurrentDocTest = frmDraw + call MakeDocTest end if if bMakeHTMLTest then - call MakeDocTest (frmHyperText) + gCurrentDocTest = frmHyperText + call MakeDocTest end if if bMakeChartTest then - call MakeChartTest (frmChart) + gCurrentDocTest = frmChart + call MakeChartTest end if if bMakeMathTest then - call MakeNewDoc (frmMath) + gCurrentDocTest = frmMath + call MakeNewDoc end if if bMakeJavaTest then - call TestJava (frmJava) + gCurrentDocTest = frmJava + call TestJava end if if bMakeDBTest then - call Test_DB.TestDB (frmDataBase) + gCurrentDocTest = frmDataBase + call Test_DB.TestDB end if if bMakeExtensionTest then - call Test_Ext.TestExtensions (frmExtension) + gCurrentDocTest = frmExtension + call Test_Ext.TestExtensions end if - Close #MainFileChannel + Close #GlobalTestLog + GlobalTestLog = 0 end Sub -Sub WriteTestSequence (FileChannel as integer) - Print #FileChannel, "Sequence of testing" +Sub WriteTestSequence + Print #GlobalTestLog, "Sequence of testing" if bMakeWriterTest then - WriteTests ("writer : ", true, FileChannel) + WriteTests ("writer : ", true, GlobalTestLog) end if if bMakeCalcTest then - WriteTests ("calc : ", true, FileChannel) + WriteTests ("calc : ", true, GlobalTestLog) end if if bMakeImpressTest then - WriteTests ("impress : ", true, FileChannel) + WriteTests ("impress : ", true, GlobalTestLog) end if if bMakeDrawTest then - WriteTests ("draw : ", true, FileChannel) + WriteTests ("draw : ", true, GlobalTestLog) end if if bMakeHTMLTest then - WriteTests ("HTML : ", true, FileChannel) + WriteTests ("HTML : ", true, GlobalTestLog) end if if bMakeChartTest then - WriteTests ("chart : ", false, FileChannel) + WriteTests ("chart : ", false, GlobalTestLog) end if if bMakeMathTest then - WriteTests ("math : ", false, FileChannel) + WriteTests ("math : ", false, GlobalTestLog) end if if bMakeJavaTest then - WriteTests ("Java : ", false, FileChannel) + WriteTests ("Java : ", false, GlobalTestLog) end if if bMakeDBTest then - WriteDBTests ("Database : ", FileChannel) + WriteDBTests ("Database : ", GlobalTestLog) end if if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", FileChannel) - end if + WriteExtensionTests ("Extension : ", GlobalTestLog) + end if - Print #FileChannel -end Sub + Print #GlobalTestLog, "testclosure : setup, write_status" -Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) - Dim sWriteStr as string + Print #GlobalTestLog + end Sub - sWriteStr = sText - sWriteStr = sWriteStr + "new" + Sub WriteTests (sText as string, bTestAll as boolean) + Dim sWriteStr as string + + sWriteStr = sText + sWriteStr = sWriteStr + "new" if bTestAll then if bMakeSaveOpen8Test then sWriteStr = sWriteStr + ", save 8.0" @@ -291,7 +291,7 @@ Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) sWriteStr = sWriteStr + ", close" - Print #nFileChannel, sWriteStr + Print #GlobalTestLog, sWriteStr end Sub Sub WriteDBTests (sText as string, nFileChannel as integer) @@ -318,168 +318,142 @@ 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 bError as Boolean - Dim nCurrentAction as Integer + Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR - nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) - 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)) + gCurrentTestCase = cLogfileFailed + LocalTestLog% = 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 - nCurrentAction = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then - sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFlt8) - SaveDoc (sFileName8, oDoc, GetDocFilter(FilterType 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 - nCurrentAction = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then - sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFltXML) - SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType 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 -' 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) - nCurrentAction = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then + 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) - 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( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then -' oDoc.dispose - nCurrentAction = cDocClose + gCurrentTestCase = cDocClose oDoc.close (true) end If end if - nCurrentAction = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest 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( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then -' oDoc.dispose - nCurrentAction = cDocClose + gCurrentTestCase = cDocClose oDoc.close (true) end If end if end If - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error DOCTESTERROR: - If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( " ", 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) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub -Sub MakeNewDoc (FilterType as Integer) +Sub MakeNewDoc DIM oDoc as Object - Dim bError as Boolean - Dim nCurrentAction as Integer + Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR2 - nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) - 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)) + gCurrentTestCase = cLogfileFailed + LocalTestLog% = 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 - 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) + gCurrentTestCase = cDocClose + bSuccess = CloseDoc( oDoc ) + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error DOCTESTERROR2: - If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( " ", 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) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalTestLog% + LocalTestLog = 0 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 bError 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 + On Local Error GoTo CHARTTESTERROR + gCurrentTestCase = cLogfileFailed + LocalTestLog% = 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) - 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 - nCurrentAction = cDocClose + bSuccess=oCharts.HasByName(cChartName) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) + gCurrentTestCase = 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( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error CHARTTESTERROR: - If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( " ", 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) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub @@ -520,48 +494,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,25 +540,23 @@ 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 frmTestClosure + GetLogFileName = sTestGlueLogFileName ' test framework case frmDataBase GetLogFileName = sSDBLogFileName 'Database case frmExtension @@ -620,16 +588,17 @@ 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)) - oObj = createUnoService(cUnoJavaLoader) - LogState (not IsNull (oObj), "Java "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oObj), "Java "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oObj)) + gCurrentTestCase = cLogfileFailed + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew + oObj = createUnoService( cUnoJavaLoader ) + LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 TestJava = not IsNull (oObj) End Function @@ -694,4 +663,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 </script:module> diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestdoc/data/Test_DB.xml index 34ade11f75fb..1f5667cae5a5 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestdoc/data/Test_DB.xml @@ -35,59 +35,53 @@ const cMessageDatabaseDelete = "Delete record from Database" const cMessageDatabaseSeek = "Read other record from Database" const cMessageDatabaseClose = "Close Database" -Sub TestDB (FilterType as Integer) - -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" +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 - nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + gCurrentTestCase = cLogfileFailed + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - nCurrentAction = cDBService + gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext oDBContext = CreateUnoService(cUnoDatabaseContext) sDBName=oDBContext.ElementNames(0) 'Names of Databases - nCurrentAction = cDBOpen + gCurrentTestCase = cDBOpen sCurrentMessage = cMessageDatabaseOpen oDataSource = oDBContext.GetByName(sDBName) 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( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then - Close #FileChannel% + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub End If ' Database is open now - nCurrentAction = cDBService + gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet 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( "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( "Database "+ cMessageDatabaseService, TRUE ) End If - nCurrentAction = cDBInsert + gCurrentTestCase = cDBInsert sCurrentMessage = cMessageDatabaseInsert oRowSet.ActiveConnection = oDBConnection @@ -105,14 +99,12 @@ 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( "Database "+ cMessageDatabaseInsert, bResult ) 'delete only if insert passed if (bResult) Then - nCurrentAction = cDBDelete + gCurrentTestCase = cDBDelete sCurrentMessage = cMessageDatabaseDelete oRowSet.deleteRow() bResult = (nRowCount - oRowSet.RowCount = 0) @@ -120,41 +112,35 @@ 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( "Database "+ cMessageDatabaseDelete, bResult ) End If ' read other record - nCurrentAction = cDBSeek + gCurrentTestCase = cDBSeek 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( "Database "+ cMessageDatabaseSeek, bResult ) - nCurrentAction = cDBClose + gCurrentTestCase = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() - LogState (True, "Database "+ cMessageDatabaseClose, FileChannel) - LogState (True, "Database "+ cMessageDatabaseClose, MainFileChannel) - SetStatus (FilterType, cDBClose, True) + LogTestResult( "Database "+ cMessageDatabaseClose, True ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error DBERROR: - If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDBOpen, False) + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( " ", False ) Exit Sub else - LogState (False, "Database "+ sCurrentMessage, FileChannel) - LogState (False, "Database "+ sCurrentMessage, MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) - Close #FileChannel% + LogTestResult( "Database "+ sCurrentMessage, FALSE ) + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestdoc/data/Test_Ext.xml index 31d27dc7a4a7..ac39f4816d7b 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestdoc/data/Test_Ext.xml @@ -32,21 +32,20 @@ const cMessageExtensionService = "Extension Service" const cMessageExtensionInstall = "Install Extension" const cMessageExtensionUninstall = "Uninstall Extension" -Sub TestExtensions (FilterType as Integer) -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" +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 - nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + gCurrentTestCase = cLogfileFailed + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) sCurrentMessage = cMessageExtensionService - nCurrentAction = cEXTService + gCurrentTestCase = cEXTService 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for 'adding the extension. The implementation is in @@ -58,16 +57,15 @@ 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( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then - Close #FileChannel% + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub End If sCurrentMessage = cMessageExtensionInstall - nCurrentAction = cEXTInstall + gCurrentTestCase = cEXTInstall 'Add the extension. We must provide a file URL here. 'By passing "user" we determine that the actions we perform on @@ -79,16 +77,15 @@ 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( "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then - Close #FileChannel% + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub End If sCurrentMessage = cMessageExtensionUninstall - nCurrentAction = cEXTUninstall + gCurrentTestCase = cEXTUninstall 'Remove the package ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) @@ -97,23 +94,21 @@ 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( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error EXTERROR: - If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cEXTService, False) + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( " ", False ) Exit Sub else - LogState (False, "Extension "+ sCurrentMessage, FileChannel) - LogState (False, "Extension "+ sCurrentMessage, MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) - Close #FileChannel% + LogTestResult( "Extension "+ sCurrentMessage, False ) + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error diff --git a/smoketestdoc/data/content.xml b/smoketestdoc/data/content.xml new file mode 100644 index 000000000000..3c81bbfbad5e --- /dev/null +++ b/smoketestdoc/data/content.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* 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 +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> +<office:document-content xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2" grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl" office:class="text"> + <office:script/> + <office:font-decls> + <style:font-decl style:name="Arial Unicode MS" fo:font-family="'Arial Unicode MS'" style:font-pitch="variable"/> + <style:font-decl style:name="HG Mincho Light J" fo:font-family="'HG Mincho Light J', 'MS Mincho', 'HG Mincho J', 'HG Mincho L', 'HG Mincho', Mincho, 'MS PMincho', 'MS Gothic', 'HG Gothic J', 'HG Gothic B', 'HG Gothic', Gothic, 'MS PGothic', 'Andale Sans UI', 'Arial Unicode MS', 'Lucida Sans Unicode', Tahoma" style:font-pitch="variable"/> + <style:font-decl style:name="Thorndale" fo:font-family="Thorndale, 'Times New Roman', Times, 'Lucida Serif', 'Lucida Bright', Timmons, 'New York', Serif" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-decl style:name="Arial" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/> + </office:font-decls> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph"> + <style:properties fo:text-align="center"/> + </style:style> + <style:style style:name="gr1" style:family="graphics"> + <style:properties style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:forms form:automatic-focus="true" form:apply-design-mode="false"> + <form:form form:name="Standard" form:apply-filter="true" form:command-type="table" form:service-name="com.sun.star.form.component.Form" office:target-frame="" xlink:href=""> + <form:control form:name="start" form:service-name="com.sun.star.form.component.CommandButton" form:id="control1"> + <form:button form:label="start smoketest" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"> + <form:properties> + <form:property form:property-name="DefaultControl" form:property-type="string"> + <form:property-value>stardiv.one.form.control.CommandButton</form:property-value> + </form:property> + </form:properties> + <office:events> + <script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.StartTestByOptions" script:location="document" script:library="document"/> + </office:events> + </form:button> + </form:control> + <form:control form:name="options" form:service-name="com.sun.star.form.component.CommandButton" form:id="control2"> + <form:button form:label="options" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"> + <form:properties> + <form:property form:property-name="DefaultControl" form:property-type="string"> + <form:property-value>stardiv.one.form.control.CommandButton</form:property-value> + </form:property> + </form:properties> + <office:events> + <script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ShowOptionsDlg" script:location="document" script:library="document"/> + </office:events> + </form:button> + </form:control> + <form:control form:name="table" form:service-name="com.sun.star.form.component.CommandButton" form:id="control3"> + <form:button form:label="delete table" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"> + <form:properties> + <form:property form:property-name="DefaultControl" form:property-type="string"> + <form:property-value>stardiv.one.form.control.CommandButton</form:property-value> + </form:property> + </form:properties> + <office:events> + <script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ClearAllText" script:location="document" script:library="document"/> + </office:events> + </form:button> + </form:control> + </form:form> + </office:forms> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + </text:sequence-decls> + <text:user-field-decls> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Writer"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Calc"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Impress"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Draw"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="HTML"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Math"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Chart"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpenXML"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen50"/> + <text:user-field-decl text:value-type="string" text:string-value="n" text:name="Terminate"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Java"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen8"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Database"/> + <text:user-field-decl text:value-type="string" text:string-value="y" text:name="Extension"/> + </text:user-field-decls> + <text:p text:style-name="Standard"> + <draw:control text:anchor-type="page" text:anchor-page-number="1" svg:x="2cm" svg:y="2cm" draw:z-index="1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control1"/> + <draw:control text:anchor-type="page" text:anchor-page-number="1" svg:x="5cm" svg:y="2cm" draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control2"/> + <draw:control text:anchor-type="page" text:anchor-page-number="1" svg:x="8cm" svg:y="2cm" draw:z-index="2" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control3"/> + </text:p> + </office:body> +</office:document-content> diff --git a/smoketestoo_native/data/dialog-lb.xml b/smoketestdoc/data/dialog-lb.xml index 973dfe688828..973dfe688828 100644 --- a/smoketestoo_native/data/dialog-lb.xml +++ b/smoketestdoc/data/dialog-lb.xml diff --git a/smoketestoo_native/data/dialog-lc.xml b/smoketestdoc/data/dialog-lc.xml index e3a5a0e326e4..e3a5a0e326e4 100644 --- a/smoketestoo_native/data/dialog-lc.xml +++ b/smoketestdoc/data/dialog-lc.xml diff --git a/smoketestoo_native/data/makefile.mk b/smoketestdoc/data/makefile.mk index 2096d07de90e..6cf2706b52b2 100644 --- a/smoketestoo_native/data/makefile.mk +++ b/smoketestdoc/data/makefile.mk @@ -26,7 +26,7 @@ #***********************************************************************/ PRJ = .. -PRJNAME = smoketestoo_native +PRJNAME = smoketestdoc TARGET = data .INCLUDE: settings.mk @@ -50,21 +50,21 @@ $(MISC)/zip/smoketestdoc.sxw: \ 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 \ + $(COMMAND_ECHO)$(RM) -r $(MISC)/zip + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip + $(COMMAND_ECHO)$(COPY) content.xml meta.xml settings.xml styles.xml $(MISC)/zip/ + $(COMMAND_ECHO)printf application/vnd.sun.xml.writer > $(MISC)/zip/mimetype + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/META-INF + $(COMMAND_ECHO)$(COPY) manifest.xml $(MISC)/zip/META-INF/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Basic + $(COMMAND_ECHO)$(COPY) script-lc.xml $(MISC)/zip/Basic/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Basic/Standard + $(COMMAND_ECHO)$(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) . + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Dialogs + $(COMMAND_ECHO)$(COPY) dialog-lc.xml $(MISC)/zip/Dialogs/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Dialogs/Standard + $(COMMAND_ECHO)$(COPY) dialog-lb.xml OptionsDlg.xml $(MISC)/zip/Dialogs/Standard/ + $(COMMAND_ECHO)cd $(MISC)/zip && zip -rD $(@:f) . .INCLUDE: target.mk diff --git a/smoketestoo_native/data/manifest.xml b/smoketestdoc/data/manifest.xml index 48fc9ce900a0..48fc9ce900a0 100644 --- a/smoketestoo_native/data/manifest.xml +++ b/smoketestdoc/data/manifest.xml diff --git a/smoketestoo_native/data/meta.xml b/smoketestdoc/data/meta.xml index 43f14295e2b3..43f14295e2b3 100644 --- a/smoketestoo_native/data/meta.xml +++ b/smoketestdoc/data/meta.xml diff --git a/smoketestoo_native/data/script-lb.xml b/smoketestdoc/data/script-lb.xml index fc4f6c6370ba..fc4f6c6370ba 100644 --- a/smoketestoo_native/data/script-lb.xml +++ b/smoketestdoc/data/script-lb.xml diff --git a/smoketestoo_native/data/script-lc.xml b/smoketestdoc/data/script-lc.xml index e3a5a0e326e4..e3a5a0e326e4 100644 --- a/smoketestoo_native/data/script-lc.xml +++ b/smoketestdoc/data/script-lc.xml diff --git a/smoketestoo_native/data/settings.xml b/smoketestdoc/data/settings.xml index cd4524b741ff..cd4524b741ff 100644 --- a/smoketestoo_native/data/settings.xml +++ b/smoketestdoc/data/settings.xml diff --git a/smoketestoo_native/data/styles.xml b/smoketestdoc/data/styles.xml index 3f8d75fa6db3..3f8d75fa6db3 100644 --- a/smoketestoo_native/data/styles.xml +++ b/smoketestdoc/data/styles.xml diff --git a/smoketestdoc/prj/build.lst b/smoketestdoc/prj/build.lst new file mode 100755 index 000000000000..ec825ab48049 --- /dev/null +++ b/smoketestdoc/prj/build.lst @@ -0,0 +1,4 @@ +smdoc smoketestdoc :: soltools codemaker unoil javaunohelper NULL +smdoc smoketestdoc usr1 - all smdoc_mkout NULL +smdoc smoketestdoc\data nmake - all smdoc_data NULL +smdoc smoketestdoc\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL diff --git a/smoketestdoc/prj/d.lst b/smoketestdoc/prj/d.lst new file mode 100755 index 000000000000..618cd83a145b --- /dev/null +++ b/smoketestdoc/prj/d.lst @@ -0,0 +1,4 @@ +mkdir: %_DEST%\bin%_EXT% + +..\%__SRC%\bin\smoketestdoc.sxw %_DEST%\bin%_EXT%\smoketestdoc.sxw +..\%__SRC%\bin\TestExtension.oxt %_DEST%\bin%_EXT%\TestExtension.oxt diff --git a/smoketestoo_native/data/content.xml b/smoketestoo_native/data/content.xml deleted file mode 100644 index dcd31b1759e4..000000000000 --- a/smoketestoo_native/data/content.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--********************************************************************** -* -* 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 -* <http://www.openoffice.org/license.html> -* for a copy of the LGPLv3 License. -* -**********************************************************************--> -<office:document-content xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2" grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl" office:class="text"><office:script/><office:font-decls><style:font-decl style:name="Arial Unicode MS" fo:font-family="'Arial Unicode MS'" style:font-pitch="variable"/><style:font-decl style:name="HG Mincho Light J" fo:font-family="'HG Mincho Light J', 'MS Mincho', 'HG Mincho J', 'HG Mincho L', 'HG Mincho', Mincho, 'MS PMincho', 'MS Gothic', 'HG Gothic J', 'HG Gothic B', 'HG Gothic', Gothic, 'MS PGothic', 'Andale Sans UI', 'Arial Unicode MS', 'Lucida Sans Unicode', Tahoma" style:font-pitch="variable"/><style:font-decl style:name="Thorndale" fo:font-family="Thorndale, 'Times New Roman', Times, 'Lucida Serif', 'Lucida Bright', Timmons, 'New York', Serif" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-decl style:name="Arial" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-decls><office:automatic-styles><style:style style:name="P1" style:family="paragraph"><style:properties fo:text-align="center"/></style:style><style:style style:name="gr1" style:family="graphics"><style:properties style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/></style:style></office:automatic-styles><office:body><office:forms form:automatic-focus="false" form:apply-design-mode="false"><form:form form:name="Standard" form:apply-filter="true" form:command-type="table" form:service-name="com.sun.star.form.component.Form" office:target-frame="" xlink:href=""><form:control form:name="options" form:service-name="com.sun.star.form.component.CommandButton" form:id="control1"><form:button form:label="options" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ShowOptionsDlg" script:location="document" script:library="document"/></office:events></form:button></form:control><form:control form:name="start" form:service-name="com.sun.star.form.component.CommandButton" form:id="control2"><form:button form:label="start smoketest" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.StartTestByOptions" script:location="document" script:library="document"/></office:events></form:button></form:control><form:control form:name="table" form:service-name="com.sun.star.form.component.CommandButton" form:id="control3"><form:button form:label="delete table" office:target-frame="" xlink:href="" form:image-data="" form:delay-for-repeat="PT0.50S" form:image-position="center"><form:properties><form:property form:property-name="DefaultControl" form:property-type="string"><form:property-value>stardiv.one.form.control.CommandButton</form:property-value></form:property></form:properties><office:events><script:event script:language="StarBasic" script:event-name="on-performaction" script:macro-name="Standard.Global.ClearAllText" script:location="document" script:library="document"/></office:events></form:button></form:control></form:form></office:forms><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:user-field-decls><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Writer"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Calc"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Impress"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Draw"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="HTML"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Math"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Chart"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpenXML"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen50"/><text:user-field-decl text:value-type="string" text:string-value="n" text:name="Terminate"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Java"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="SaveOpen8"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Database"/><text:user-field-decl text:value-type="string" text:string-value="y" text:name="Extension"/></text:user-field-decls><text:p text:style-name="Standard"><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control2"/><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control1"/><draw:control text:anchor-type="as-char" svg:y="0cm" draw:z-index="2" draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.477cm" svg:height="0.787cm" form:id="control3"/></text:p><text:p text:style-name="Standard"/></office:body></office:document-content> diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk index 18f3a42b789f..aab245371a72 100644..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) @@ -56,18 +58,18 @@ ALLTAR : cpptest cpptest : $(SHL1TARGETN) -TEST_ARGUMENTS = smoketest.doc=$(BIN)/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 diff --git a/smoketestoo_native/prj/build.lst b/smoketestoo_native/prj/build.lst index 147a363d3da5..9527079f56d2 100644..100755 --- 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/smoketest.cxx b/smoketestoo_native/smoketest.cxx index a4e532123456..5fd16914b0d7 100644..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( diff --git a/test/prj/build.lst b/test/prj/build.lst index 7adea0c0727b..e22199a5c437 100644 --- a/test/prj/build.lst +++ b/test/prj/build.lst @@ -1,5 +1,6 @@ -te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridljar sal solenv unoil NULL +te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridljar sal solenv stlport unoil NULL te test\inc nmake - all inc NULL te test\source\cpp nmake - all source_cpp inc NULL +te test\source\cpp\unoexceptionprotector nmake - all source_cpp_unoexceptionprotector inc NULL te test\source\java\org\openoffice\test nmake - all source_java NULL te test\source\java\org\openoffice\test\tools nmake - all source_java_tools NULL diff --git a/test/prj/d.lst b/test/prj/d.lst index 54da2062a511..18a599fd5849 100644 --- a/test/prj/d.lst +++ b/test/prj/d.lst @@ -1,9 +1,12 @@ mkdir: %_DEST%\inc%_EXT%\test mkdir: %_DEST%\inc%_EXT%\test\detail ..\%__SRC%\bin\test.dll %_DEST%\bin%_EXT%\test.dll +..\%__SRC%\bin\unoexceptionprotector.dll %_DEST%\bin%_EXT%\unoexceptionprotector.dll ..\%__SRC%\lib\itest.lib %_DEST%\lib%_EXT%\itest.lib ..\%__SRC%\lib\libtest.dylib %_DEST%\lib%_EXT%\libtest.dylib ..\%__SRC%\lib\libtest.so %_DEST%\lib%_EXT%\libtest.so +..\%__SRC%\lib\unoexceptionprotector.dylib %_DEST%\lib%_EXT%\unoexceptionprotector.dylib +..\%__SRC%\lib\unoexceptionprotector.so %_DEST%\lib%_EXT%\unoexceptionprotector.so ..\inc\test\detail\testdllapi.hxx %_DEST%\inc%_EXT%\test\detail\testdllapi.hxx ..\inc\test\gettestargument.hxx %_DEST%\inc%_EXT%\test\gettestargument.hxx ..\inc\test\officeconnection.hxx %_DEST%\inc%_EXT%\test\officeconnection.hxx diff --git a/test/source/cpp/makefile.mk b/test/source/cpp/makefile.mk index 4c90dc678959..2073f1500c07 100644 --- a/test/source/cpp/makefile.mk +++ b/test/source/cpp/makefile.mk @@ -33,14 +33,11 @@ VISIBILITY_HIDDEN = TRUE .INCLUDE: settings.mk CDEFS += -DOOO_DLLIMPLEMENTATION_TEST -CFLAGSCXX += $(CPPUNIT_CFLAGS) -#building with stlport, but cppunit was not built with stlport -.IF "$(USE_SYSTEM_STL)"!="YES" -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGSCXX+=-DADAPT_EXT_STL -.ENDIF -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) +.IF "$(USE_SYSTEM_STL)" != "YES" && "$(SYSTEM_CPPUNIT)" == "YES" +CFLAGSCXX += -DADAPT_EXT_STL +.END SLOFILES = \ $(SLO)/getargument.obj \ diff --git a/test/source/cpp/unoexceptionprotector/makefile.mk b/test/source/cpp/unoexceptionprotector/makefile.mk new file mode 100644 index 000000000000..7f62199f46dc --- /dev/null +++ b/test/source/cpp/unoexceptionprotector/makefile.mk @@ -0,0 +1,56 @@ +#************************************************************************* +# 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 +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +#***********************************************************************/ + +PRJ = ../../.. +PRJNAME = test +TARGET = unoexceptionprotector + +ENABLE_EXCEPTIONS = TRUE +VISIBILITY_HIDDEN = TRUE + +.INCLUDE: settings.mk + +DLLPRE = + +CFLAGSCXX += $(CPPUNIT_CFLAGS) +.IF "$(USE_SYSTEM_STL)" != "YES" && "$(SYSTEM_CPPUNIT)" == "YES" +CFLAGSCXX += -DADAPT_EXT_STL +.END + +SLOFILES = $(SLO)/unoexceptionprotector.obj + +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLOFILES) +SHL1RPATH = NONE +SHL1STDLIBS = \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(CPPUNITLIB) \ + $(SALLIB) +SHL1TARGET = unoexceptionprotector +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) + +.INCLUDE: target.mk diff --git a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx new file mode 100644 index 000000000000..4f9ee9b198e2 --- /dev/null +++ b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx @@ -0,0 +1,98 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2011 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 +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +#include "precompiled_test.hxx" +#include "sal/config.h" + +#include <limits> +#include <string> + +#include "boost/noncopyable.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Exception.hpp" +#include "cppuhelper/exc_hlp.hxx" +#include "osl/thread.h" +#include "rtl/string.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "preextstl.h" +#include "cppunit/Message.h" +#include "cppunit/Protector.h" +#include "postextstl.h" + +namespace { + +namespace css = com::sun::star; + +// Best effort conversion: +std::string convert(rtl::OUString const & s16) { + rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding())); + return std::string( + s8.getStr(), + ((static_cast< sal_uInt32 >(s8.getLength()) + > std::numeric_limits< std::string::size_type >::max()) + ? std::numeric_limits< std::string::size_type >::max() + : static_cast< std::string::size_type >(s8.getLength()))); +} + +class Prot: public CppUnit::Protector, private boost::noncopyable { +public: + Prot() {} + + virtual ~Prot() {} + + virtual bool protect( + CppUnit::Functor const & functor, + CppUnit::ProtectorContext const & context); +}; + +bool Prot::protect( + CppUnit::Functor const & functor, CppUnit::ProtectorContext const & context) +{ + try { + return functor(); + } catch (css::uno::Exception & e) { + css::uno::Any a(cppu::getCaughtException()); + reportError( + context, + CppUnit::Message( + convert( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "uncaught exception of type ")) + + a.getValueTypeName()), + convert(e.Message))); + } + return false; +} + +} + +extern "C" SAL_DLLPUBLIC_EXPORT CppUnit::Protector * SAL_CALL +unoexceptionprotector() { + return new Prot; +} diff --git a/testautomation/graphics/required/includes/global/id_004.inc b/testautomation/graphics/required/includes/global/id_004.inc index f04a3ba5ec8f..fbcfde707710 100644 --- a/testautomation/graphics/required/includes/global/id_004.inc +++ b/testautomation/graphics/required/includes/global/id_004.inc @@ -242,8 +242,10 @@ testcase tiInsertGraphic DialogTest (GrafikEinfuegenDlg) printlog " use file: global\input\graf_inp\stabler.tif) " Dateiname.settext Convertpath (gTesttoolPath + "global\input\graf_inp\stabler.tif") + wait(1000) printlog "click 'open' " Oeffnen.click + wait(1000) catch Warnlog "Insert graphic doesn't work :-(" endcatch |