summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2003-11-18 15:12:27 +0000
committerKurt Zenker <kz@openoffice.org>2003-11-18 15:12:27 +0000
commit134f3be0e38b082b249e9b0b664a2d6696f219f6 (patch)
tree0ca391708ab3ce01dbcbc9079104ebf49ce15a80
parent0636cd46d8143de806dfe8be271b5b67a4d83cbd (diff)
INTEGRATION: CWS qadev13 (1.2.2); FILE MERGED
2003/10/22 15:45:16 sw 1.2.2.1: #112770#
-rw-r--r--qadevOOo/runner/base/basic_fat.java203
1 files changed, 152 insertions, 51 deletions
diff --git a/qadevOOo/runner/base/basic_fat.java b/qadevOOo/runner/base/basic_fat.java
index c155939c4c51..c05f609d5007 100644
--- a/qadevOOo/runner/base/basic_fat.java
+++ b/qadevOOo/runner/base/basic_fat.java
@@ -2,9 +2,9 @@
*
* $RCSfile: basic_fat.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change:$Date: 2003-10-06 12:36:44 $
+ * last change:$Date: 2003-11-18 16:12:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,34 +58,45 @@
*
*
************************************************************************/
-
package base;
import base.TestBase;
-import stats.OutProducerFactory;
-import lib.TestParameters;
+
+import basicrunner.BasicIfcTest;
+import basicrunner.BasicTestCase;
+
+import com.sun.star.lang.XMultiServiceFactory;
+
+import helper.APIDescGetter;
+import helper.OfficeProvider;
+import helper.ProcessHandler;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.PrintWriter;
+
+import java.util.Vector;
+
import lib.TestCase;
import lib.TestEnvironment;
-import util.DynamicClassLoader;
+import lib.TestParameters;
+
import share.DescEntry;
import share.DescGetter;
import share.LogWriter;
-import helper.APIDescGetter;
-import helper.OfficeProvider;
-import helper.ProcessHandler;
+
+import stats.OutProducerFactory;
import stats.Summarizer;
-import basicrunner.BasicTestCase;
-import basicrunner.BasicIfcTest;
-import java.io.PrintWriter;
+import util.DynamicClassLoader;
-import com.sun.star.lang.XMultiServiceFactory;
/**
* The testbase for executing basic tests.
* @see lib.TestBase
*/
-public class basic_fat implements TestBase{
+public class basic_fat implements TestBase {
+ public static boolean debug = false;
/**
* Execute a test.
@@ -97,32 +108,50 @@ public class basic_fat implements TestBase{
String job = (String) param.get("TestJob");
OfficeProvider office = null;
+
//get Job-Descriptions
- System.out.print("Getting Descriptions for Job: "+job+" from ");
+ System.out.print("Getting Descriptions for Job: " + job + " from ");
+
DescEntry[] entries = dg.getDescriptionFor(job,
- (String) param.get("DescriptionPath"),true);
+ (String) param.get(
+ "DescriptionPath"),
+ true);
- if (entries == null ) {
+ if (entries == null) {
System.out.println("Couldn't get Description for Job");
+
return false;
}
+ String ExclusionFile = (String) param.get("ExclusionList");
+ Vector exclusions = null;
+ debug = param.getBool("DebugIsActive");
+
+ if (ExclusionFile != null) {
+ exclusions = getExclusionList(ExclusionFile, debug);
+ }
+
String conStr = (String) param.get("ConnectionString");
System.out.print("> Connecting the Office ");
- System.out.println("With "+conStr);
+ System.out.println("With " + conStr);
- for (int l=0;l<entries.length;l++) {
+ for (int l = 0; l < entries.length; l++) {
if (entries[l].hasErrorMsg) {
System.out.println(entries[l].ErrorMsg);
+
continue;
}
office = new OfficeProvider();
- XMultiServiceFactory msf = (XMultiServiceFactory)
- office.getManager(param);
- if (msf == null) return false;
- param.put("ServiceFactory",msf);
+ XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(
+ param);
+
+ if (msf == null) {
+ return false;
+ }
+
+ param.put("ServiceFactory", msf);
DescEntry entry = entries[l];
@@ -132,87 +161,159 @@ public class basic_fat implements TestBase{
TestCase tCase = null;
- tCase = (TestCase)
- new BasicTestCase(entry);
+ tCase = (TestCase) new BasicTestCase(entry);
if (tCase == null) {
- sumIt.summarizeDown(entry,entry.ErrorMsg);
+ sumIt.summarizeDown(entry, entry.ErrorMsg);
+
LogWriter sumObj = (LogWriter) dcl.getInstance(
- (String)param.get("OutProducer"));
- sumObj.initialize(entry,true);
+ (String) param.get("OutProducer"));
+ sumObj.initialize(entry, true);
sumObj.summary(entry);
+
return true;
}
- System.out.println("Creating: "+tCase.getObjectName());
+ System.out.println("Creating: " + tCase.getObjectName());
+
LogWriter log = (LogWriter) dcl.getInstance(
- (String)param.get("LogWriter"));
- log.initialize(entry,true);
+ (String) param.get("LogWriter"));
+ log.initialize(entry, true);
entry.UserDefinedParams = param;
tCase.setLogWriter((PrintWriter) log);
tCase.initializeTestCase(param);
+
TestEnvironment tEnv = tCase.getTestEnvironment(param);
- System.out.println("created "+tCase.getObjectName());
- for (int j=0;j<entry.SubEntryCount;j++) {
+ System.out.println("created " + tCase.getObjectName());
+
+ for (int j = 0; j < entry.SubEntryCount; j++) {
if (!entry.SubEntries[j].isToTest) {
- Summarizer.summarizeDown(entry.SubEntries[j],"not part of the job");
+ Summarizer.summarizeDown(entry.SubEntries[j],
+ "not part of the job");
+
continue;
}
- System.out.println("running: "+entry.SubEntries[j].entryName);
+
+ if ((exclusions != null) &&
+ (exclusions.contains(entry.SubEntries[j].longName))) {
+ Summarizer.summarizeDown(entry.SubEntries[j],
+ "known issue");
+
+ continue;
+ }
+
+ System.out.println("running: " +
+ entry.SubEntries[j].entryName);
+
LogWriter ifclog = (LogWriter) dcl.getInstance(
- (String)param.get("LogWriter"));
- ifclog.initialize(entry.SubEntries[j],true);
+ (String) param.get("LogWriter"));
+ ifclog.initialize(entry.SubEntries[j], true);
entry.SubEntries[j].UserDefinedParams = param;
entry.SubEntries[j].Logger = ifclog;
if (tEnv.isDisposed()) {
tEnv = tCase.getTestEnvironment(param);
- System.out.println("created "+tCase.getObjectName());
+ System.out.println("created " + tCase.getObjectName());
}
+
BasicIfcTest ifc = null;
lib.TestResult res = null;
ifc = new BasicIfcTest(entry.SubEntries[j].longName);
- res = ifc.run(entry.SubEntries[j],tEnv,param);
+ res = ifc.run(entry.SubEntries[j], tEnv, param);
sumIt.summarizeUp(entry.SubEntries[j]);
+
LogWriter sumIfc = (LogWriter) dcl.getInstance(
- (String)param.get("OutProducer"));
+ (String) param.get("OutProducer"));
- sumIfc.initialize(entry.SubEntries[j],true);
+ sumIfc.initialize(entry.SubEntries[j], true);
sumIfc.summary(entry.SubEntries[j]);
}
+
try {
tCase.cleanupTestCase(param);
} catch (Exception e) {
log.println("TestCase already gone");
}
+
sumIt.summarizeUp(entry);
+
LogWriter sumObj = OutProducerFactory.createOutProducer(param);
- sumObj.initialize(entry,true);
+ sumObj.initialize(entry, true);
sumObj.summary(entry);
}
if (entries.length > 1) {
System.out.println();
+
int counter = 0;
- System.out.println("Failures that appeared during scenario execution:");
- for (int i=0;i<entries.length;i++) {
- if (! entries[i].State.endsWith("OK")) {
- System.out.println("\t "+entries[i].longName);
+ System.out.println(
+ "Failures that appeared during scenario execution:");
+
+ for (int i = 0; i < entries.length; i++) {
+ if (!entries[i].State.endsWith("OK")) {
+ System.out.println("\t " + entries[i].longName);
counter++;
}
}
- System.out.println(counter +" of "+entries.length + " tests failed" );
+
+ System.out.println(counter + " of " + entries.length +
+ " tests failed");
}
- helper.ProcessHandler ph =
- (helper.ProcessHandler) param.get("AppProvider");
+ helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
+ "AppProvider");
if (ph != null) {
office.closeExistingOffice(param, true);
-// ph.kill();
}
+
return true;
}
-}
+
+ protected Vector getExclusionList(String url, boolean debug) {
+ Vector entryList = new Vector();
+ String line = "#";
+ BufferedReader exclusion = null;
+
+ try {
+ exclusion = new BufferedReader(new FileReader(url));
+ } catch (java.io.FileNotFoundException fnfe) {
+ if (debug) {
+ System.out.println("Couldn't find file " + url);
+ }
+
+ return entryList;
+ }
+
+ while (line != null) {
+ try {
+ if (!line.startsWith("#")) {
+ entryList.add(line);
+ }
+
+ line = exclusion.readLine();
+ } catch (java.io.IOException ioe) {
+ if (debug) {
+ System.out.println(
+ "Exception while reading exclusion list");
+ }
+
+ return entryList;
+ }
+ }
+
+ try {
+ exclusion.close();
+ } catch (java.io.IOException ioe) {
+ if (debug) {
+ System.out.println("Couldn't close file " + url);
+ }
+
+ return entryList;
+ }
+
+ return entryList;
+ }
+} \ No newline at end of file