[Libreoffice-commits] .: 2 commits - test-bugzilla-files/test-bugzilla-files.py
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Feb 21 12:00:55 PST 2013
test-bugzilla-files/test-bugzilla-files.py | 46 +++++++++++++++++------------
1 file changed, 28 insertions(+), 18 deletions(-)
New commits:
commit 5ab748ed8492bdab166706d175144100e338eb3f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Feb 21 21:00:24 2013 +0100
lets differentiate between DisposedException and UnkownPropertyException
diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index 32fa3c2..cd41795 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -281,10 +281,12 @@ def loadFromURL(xContext, url):
if xListener:
xGEB.removeDocumentEventListener(xListener)
-def handleCrash(file):
+def handleCrash(file, disposed):
print("File: " + file + " crashed")
crashLog = open("crashlog.txt", "a")
- crashLog.write('Crash:' + file + '\n')
+ crashLog.write('Crash:' + file + ' ')
+ if disposed == 1:
+ crashLog.write('through disposed\n')
crashLog.close()
# crashed_files.append(file)
# add here the remaining handling code for crashed files
@@ -315,8 +317,8 @@ class LoadFileTest:
self.state.timeoutFiles.append(self.file)
else:
t.cancel()
- handleCrash(self.file)
- self.state.badFiles.append(self.file)
+ handleCrash(self.file, 0)
+ self.state.badPropertyFiles.append(self.file)
connection.tearDown()
connection.setUp()
except pyuno.getClass("com.sun.star.lang.DisposedException"):
@@ -326,8 +328,8 @@ class LoadFileTest:
self.state.timeoutFiles.append(self.file)
else:
t.cancel()
- handleCrash(self.file)
- self.state.badFiles.append(self.file)
+ handleCrash(self.file, 1)
+ self.state.badDisposedFiles.append(self.file)
connection.tearDown()
connection.setUp()
finally:
@@ -338,12 +340,12 @@ class LoadFileTest:
xDoc.close(True)
except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
print("caught UnknownPropertyException while closing")
- self.state.badFiles.append(self.file)
+ self.state.badPropertyFiles.append(self.file)
connection.tearDown()
connection.setUp()
except pyuno.getClass("com.sun.star.lang.DisposedException"):
print("caught DisposedException while closing")
- self.state.badFiles.append(self.file)
+ self.state.badDisposedFiles.append(self.file)
connection.tearDown()
connection.setUp()
print("...done with: " + self.file)
@@ -351,7 +353,8 @@ class LoadFileTest:
class State:
def __init__(self):
self.goodFiles = []
- self.badFiles = []
+ self.badDisposedFiles = []
+ self.badPropertyFiles = []
self.timeoutFiles = []
@@ -363,13 +366,20 @@ def writeReport(state, startTime):
goodFiles.write(file)
goodFiles.write("\n")
goodFiles.close()
- badFiles = open("badFiles.log", "w")
- badFiles.write("All files tested which crashed:\n")
- badFiles.write("Starttime: " + startTime.isoformat() + "\n")
- for file in state.badFiles:
- badFiles.write(file)
- badFiles.write("\n")
- badFiles.close()
+ badDisposedFiles = open("badDisposedFiles.log", "w")
+ badDisposedFiles.write("All files tested which crashed:\n")
+ badDisposedFiles.write("Starttime: " + startTime.isoformat() + "\n")
+ for file in state.badDisposedFiles:
+ badDisposedFiles.write(file)
+ badDisposedFiles.write("\n")
+ badDisposedFiles.close()
+ badPropertyFiles = open("badPropertyFiles.log", "w")
+ badPropertyFiles.write("All files tested which crashed:\n")
+ badPropertyFiles.write("Starttime: " + startTime.isoformat() + "\n")
+ for file in state.badPropertyFiles:
+ badPropertyFiles.write(file)
+ badPropertyFiles.write("\n")
+ badPropertyFiles.close()
timeoutFiles = open("timeoutFiles.log", "w")
timeoutFiles.write("All files tested which timed out:\n")
timeoutFiles.write("Starttime: " + startTime.isoformat() + "\n")
commit 04c423912ebc63ba2923e91a9580bf526fc490e1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Feb 19 03:42:44 2013 +0100
remove unused parameter
diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index 7a12dc2..32fa3c2 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -245,7 +245,7 @@ def mkPropertyValue(name, value):
### tests ###
-def loadFromURL(xContext, url, connection):
+def loadFromURL(xContext, url):
xDesktop = xContext.ServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext)
props = [("Hidden", True), ("ReadOnly", True)] # FilterName?
@@ -305,7 +305,7 @@ class LoadFileTest:
args = [connection]
t = threading.Timer(45, alarm_handler, args)
t.start()
- xDoc = loadFromURL(xContext, url, connection)
+ xDoc = loadFromURL(xContext, url)
self.state.goodFiles.append(self.file)
t.cancel()
except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
More information about the Libreoffice-commits
mailing list