summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/share
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2009-07-06 10:30:52 +0000
committerVladimir Glazounov <vg@openoffice.org>2009-07-06 10:30:52 +0000
commit91ab2cabe11981d03007616f55acb0119b0435d7 (patch)
treebc1fa4dd94212de4fae7f10762f44f831ebace26 /qadevOOo/runner/share
parent4910706670c8a17c46347fa22c63d5779d50fbcc (diff)
CWS-TOOLING: integrate CWS unoapi04
2009-06-26 14:00:27 +0200 lla r273410 : #i102248# cleanups 2009-06-26 13:36:44 +0200 lla r273407 : #i102248# fix problem with too long sleeps and waits 2009-06-26 08:34:17 +0200 lla r273393 : #i102248# cleanups 2009-06-26 08:28:43 +0200 lla r273392 : #i102248# cleanups 2009-06-25 13:17:19 +0200 lla r273379 : #i102248# add prototypes 2009-06-25 11:31:02 +0200 lla r273371 : #i102248# cleanups 2009-06-25 11:15:18 +0200 lla r273370 : #i102248# add a selftest for demonstration. 2009-06-25 10:53:35 +0200 lla r273369 : #i102248# add a selftest for demonstration. 2009-06-25 10:38:10 +0200 lla r273368 : #i102248# add a selftest for demonstration. 2009-06-23 11:09:35 +0200 lla r273266 : #i102248# cleanup 2009-06-23 11:00:15 +0200 lla r273265 : #i10i108248# add cwstestresult to cwscheckapi 2009-06-23 10:59:50 +0200 lla r273264 : #i10i108248# add cwstestresult to cwscheckapi 2009-06-23 10:58:47 +0200 lla r273263 : #i102248# add selftest
Diffstat (limited to 'qadevOOo/runner/share')
-rw-r--r--qadevOOo/runner/share/DescGetter.java117
1 files changed, 75 insertions, 42 deletions
diff --git a/qadevOOo/runner/share/DescGetter.java b/qadevOOo/runner/share/DescGetter.java
index 3b038e5ab090..dc6ac351ccb1 100644
--- a/qadevOOo/runner/share/DescGetter.java
+++ b/qadevOOo/runner/share/DescGetter.java
@@ -36,62 +36,76 @@ import java.util.StringTokenizer;
import java.util.Vector;
-
/**
*
* Base Interface to get a description for a given TestJob
*
*/
-public abstract class DescGetter {
+public abstract class DescGetter
+{
+
public abstract DescEntry[] getDescriptionFor(String entry,
- String DescPath,
- boolean debug);
+ String DescPath,
+ boolean debug);
protected abstract DescEntry getDescriptionForSingleJob(String job,
- String descPath,
- boolean debug);
+ String descPath,
+ boolean debug);
protected abstract String[] createScenario(String descPath, String job,
- boolean debug);
+ boolean debug);
protected DescEntry[] getScenario(String url, String descPath,
- boolean debug) {
+ boolean debug)
+ {
Vector entryList = new Vector();
String line = "";
BufferedReader scenario = null;
DescEntry[] entries = null;
- try {
+ try
+ {
scenario = new BufferedReader(new FileReader(url));
- } catch (java.io.FileNotFoundException fnfe) {
+ }
+ catch (java.io.FileNotFoundException fnfe)
+ {
System.out.println("Couldn't find file " + url);
return entries;
}
- while (line != null) {
- try {
- if (line.startsWith("-o")) {
+ while (line != null)
+ {
+ try
+ {
+ if (line.startsWith("-o"))
+ {
String job = line.substring(3, line.length()).trim();
- DescEntry aEntry ;
+ DescEntry aEntry;
// special in case several Interfaces are given comma separated
- if (job.indexOf(",") < 0) {
+ if (job.indexOf(",") < 0)
+ {
aEntry = getDescriptionForSingleJob(job, descPath,
- debug);
- } else {
+ debug);
+ }
+ else
+ {
ArrayList subs = getSubInterfaces(job);
String partjob = job.substring(0, job.indexOf(",")).trim();
aEntry = getDescriptionForSingleJob(partjob, descPath,
- debug);
+ debug);
- if (aEntry != null) {
- for (int i = 0; i < aEntry.SubEntryCount; i++) {
+ if (aEntry != null)
+ {
+ for (int i = 0; i < aEntry.SubEntryCount; i++)
+ {
String subEntry = aEntry.SubEntries[i].longName;
int cpLength = aEntry.longName.length();
subEntry = subEntry.substring(cpLength + 2,
- subEntry.length());
+ subEntry.length());
- if (subs.contains(subEntry)) {
+ if (subs.contains(subEntry))
+ {
aEntry.SubEntries[i].isToTest = true;
}
}
@@ -101,63 +115,82 @@ public abstract class DescGetter {
// line.substring(3).trim(), descPath,
// debug);
if (aEntry != null)
+ {
entryList.add(aEntry);
- } else if (line.startsWith("-sce")) {
+ }
+ }
+ else if (line.startsWith("-sce"))
+ {
DescEntry[] subs = getScenario(line.substring(5,
- line.length())
- .trim(), descPath,
- debug);
+ line.length()).trim(), descPath,
+ debug);
- for (int i = 0; i < subs.length; i++) {
+ for (int i = 0; i < subs.length; i++)
+ {
entryList.add(subs[i]);
}
- } else if (line.startsWith("-p")) {
+ }
+ else if (line.startsWith("-p"))
+ {
String[] perModule = createScenario(descPath,
- line.substring(3)
- .trim(), debug);
+ line.substring(3).trim(), debug);
- for (int i = 0; i < perModule.length; i++) {
+ for (int i = 0; i < perModule.length; i++)
+ {
DescEntry aEntry = getDescriptionForSingleJob(
- perModule[i].substring(3)
- .trim(),
- descPath, debug);
+ perModule[i].substring(3).trim(),
+ descPath, debug);
if (aEntry != null)
+ {
entryList.add(aEntry);
+ }
}
}
line = scenario.readLine();
- } catch (java.io.IOException ioe) {
- if (debug) {
+ }
+ catch (java.io.IOException ioe)
+ {
+ if (debug)
+ {
System.out.println("Exception while reading scenario");
}
}
}
- try {
+ try
+ {
scenario.close();
- } catch (java.io.IOException ioe) {
- if (debug) {
+ }
+ catch (java.io.IOException ioe)
+ {
+ if (debug)
+ {
System.out.println("Exception while closeing scenario");
}
}
if (entryList.size() == 0)
+ {
return null;
+ }
entries = new DescEntry[entryList.size()];
entries = (DescEntry[]) entryList.toArray(entries);
return entries;
}
- protected ArrayList getSubInterfaces(String job) {
+ protected ArrayList getSubInterfaces(String job)
+ {
ArrayList namesList = new ArrayList();
StringTokenizer st = new StringTokenizer(job, ",");
- for (int i = 0; st.hasMoreTokens(); i++) {
+ for (int i = 0; st.hasMoreTokens(); i++)
+ {
String token = st.nextToken();
- if (token.indexOf(".") < 0) {
+ if (token.indexOf(".") < 0)
+ {
namesList.add(token);
}
}