summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/share/DescGetter.java
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-27 11:04:04 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-27 11:04:04 +0000
commit4b2c03843e0e559d1c849f4f201f53072be7fe14 (patch)
tree6eaa15fed72820ca6957377c2fee5b85e8dd8e58 /qadevOOo/runner/share/DescGetter.java
parentd583ae1561d6289256bcf332c0205c8890fdc4fc (diff)
INTEGRATION: CWS qadev6 (1.1.8); FILE MERGED
2003/05/21 10:10:40 sg 1.1.8.1: #109369#: scenarios are loaded in this class, so derived classes can use it.
Diffstat (limited to 'qadevOOo/runner/share/DescGetter.java')
-rw-r--r--qadevOOo/runner/share/DescGetter.java46
1 files changed, 42 insertions, 4 deletions
diff --git a/qadevOOo/runner/share/DescGetter.java b/qadevOOo/runner/share/DescGetter.java
index 0b15013cadfa..8e13f38575a2 100644
--- a/qadevOOo/runner/share/DescGetter.java
+++ b/qadevOOo/runner/share/DescGetter.java
@@ -2,9 +2,9 @@
*
* $RCSfile: DescGetter.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change:$Date: 2003-01-27 16:27:48 $
+ * last change:$Date: 2003-05-27 12:04:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,14 +62,52 @@
package share;
+import java.util.Vector;
+import java.io.BufferedReader;
+import java.io.FileReader;
+
/**
*
* Base Interface to get a description for a given TestJob
*
*/
-public interface DescGetter {
+public abstract class DescGetter {
+
+ public abstract DescEntry[] getDescriptionFor(String entry,
+ String DescPath, boolean debug);
+
+ protected abstract DescEntry getDescriptionForSingleJob(
+ String job, String descPath, boolean debug);
+
+ protected DescEntry[] getScenario(String url, String descPath,
+ boolean debug) {
+ Vector entryList = new Vector();
+ String line = "";
+ BufferedReader scenario = null;
+ DescEntry[] entries = null;
+ try {
+ scenario = new BufferedReader(new FileReader(url));
+ } catch (java.io.FileNotFoundException fnfe) {
+ System.out.println("Couldn't find file "+url);
+ return entries;
+ }
+ while (line != null) {
+ try {
+ if (line.startsWith("-o")) {
+ entryList.add(getDescriptionForSingleJob(
+ line.substring(3).trim(), descPath, debug));
+ }
+ line = scenario.readLine();
+ } catch (java.io.IOException ioe) {
+ if (debug)
+ System.out.println("Exception while reading scenario");
+ }
+ }
- public DescEntry[] getDescriptionFor(String entry, String DescPath, boolean debug);
+ entries = new DescEntry[entryList.size()];
+ entries = (DescEntry[])entryList.toArray(entries);
+ return entries;
+ }
}