public Object execute(NamedValue[] args) { // construct valid arguments from the given stuff int arg_length=args.length;
String[] arguments = new String[arg_length*2]; for ( int i=0; i< arg_length; i++ ) {
arguments[i*2] = args[i].Name;
Object o = args[i].Value;
arguments[i*2+1] = o.toString();
}
TestParameters param = new TestParameters();
DynamicClassLoader dcl = new DynamicClassLoader();
// take the standard log writer
String standardLogWriter = (String) param.get(PropertyName.LOG_WRITER);
String standardOutProducer = (String) param.get(PropertyName.OUT_PRODUCER);
ClParser cli = new ClParser();
//parse the commandline arguments
cli.getCommandLineParameter(param,arguments);
// now compare the standard log writer with the parameters: // if we have a new one, use the new, else use the internal // log writer if (((String)param.get("LogWriter")).equals(standardLogWriter))
param.put("LogWriter", "stats.InternalLogWriter"); if (((String)param.get("OutProducer")).equals(standardOutProducer))
param.put("OutProducer", "stats.InternalLogWriter");
LogWriter log = (LogWriter) dcl.getInstance(
(String)param.get("LogWriter"));
/** *Getallimplementedtypesofthisclass. *@returnAnarrayofimplementedinterfacetypes. *@seecom.sun.star.lang.XTypeProvider
*/ public Type[] getTypes() {
Type[] type = new Type[5];
type[0] = new Type(XInterface.class);
type[1] = new Type(XTypeProvider.class);
type[2] = new Type(XJob.class);
type[3] = new Type(XServiceInfo.class);
type[4] = new Type(XPropertyAccess.class); return type;
}
/** *Returnallvalidtestcasesfromtheobjectdescriptions *@returnThevalidtestcasesaspropertyvalues
*/ public PropertyValue[] getPropertyValues() {
PropertyValue[] pVal = null;
java.net.URL url = this.getClass().getResource("/objdsc"); if (url == null) {
pVal = new PropertyValue[1];
pVal[0] = new PropertyValue();
pVal[0].Name = "Error";
pVal[0].Value = "OOoRunner.jar file doesn't contain object " + "descriptions: don't know what to test."; return pVal;
}
ArrayList<String> v = new ArrayList<String>(600); try { // open connection to Jar
java.net.JarURLConnection con =
(java.net.JarURLConnection)url.openConnection(); // get Jar file from connection
java.util.jar.JarFile f = con.getJarFile(); // Enumerate over all entries
java.util.Enumeration<JarEntry> aEnum = f.entries();
while (aEnum.hasMoreElements()) {
String entry = aEnum.nextElement().toString(); if (entry.endsWith(".csv")) {
String module = null;
String object = null;
int startIndex = entry.indexOf("objdsc/") + 7; int endIndex = entry.lastIndexOf('/');
module = entry.substring(startIndex, endIndex);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.