r52148 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52147‎ | r52148 | r52149 >
Date:22:50, 18 June 2009
Author:daniel
Status:deferred
Tags:
Comment:
testing infrastructure
Modified paths:
  • /trunk/WikiWord/WikiWordIntegrator/pom.xml (modified) (history)
  • /trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java
@@ -1,7 +1,6 @@
22 package de.brightbyte.wikiword.integrator;
33
44 import java.beans.IntrospectionException;
5 -import java.io.File;
65 import java.io.IOException;
76 import java.io.InputStream;
87 import java.lang.reflect.InvocationTargetException;
@@ -17,7 +16,6 @@
1817
1918 import de.brightbyte.data.Functor;
2019 import de.brightbyte.data.cursor.DataCursor;
21 -import de.brightbyte.db.DatabaseConnectionInfo;
2220 import de.brightbyte.db.SqlScriptRunner;
2321 import de.brightbyte.io.IOUtil;
2422 import de.brightbyte.text.Chunker;
@@ -51,6 +49,7 @@
5250 protected FeatureSetSourceDescriptor sourceDescriptor;
5351 private DataSource configuredDataSource;
5452 private DatasetIdentifier configuredDataset;
 53+ private String targetTableName;
5554
5655 public AbstractIntegratorApp() {
5756 super(true, true);
@@ -70,13 +69,14 @@
7170 return configuredDataset;
7271 }
7372
74 - public void testInit(DataSource dataSource, DatasetIdentifier dataset, TweakSet tweaks, FeatureSetSourceDescriptor sourceDescriptor) {
 73+ public void testInit(DataSource dataSource, DatasetIdentifier dataset, TweakSet tweaks, FeatureSetSourceDescriptor sourceDescriptor, String targetTableName) {
7574 if (this.tweaks!=null || this.sourceDescriptor!=null) throw new IllegalStateException("application already initialized");
7675
7776 this.configuredDataSource = dataSource;
7877 this.configuredDataset = dataset;
7978 this.tweaks = tweaks;
8079 this.sourceDescriptor = sourceDescriptor;
 80+ this.targetTableName = targetTableName;
8181 }
8282
8383 public void testLaunch() throws Exception {
@@ -91,12 +91,17 @@
9292 }
9393
9494 protected String getTargetTableName() throws IOException {
95 - if (args.getParameterCount() > 2) return args.getParameter(2);
 95+ if (targetTableName!=null) return targetTableName;
9696
97 - String authority = getSourceDescriptor().getAuthorityName();
98 - authority = authority.replaceAll("[^\\w\\d]", "_").toLowerCase();
 97+ if (args.getParameterCount() > 2) targetTableName = args.getParameter(2);
 98+ else {
 99+ String authority = getSourceDescriptor().getAuthorityName();
 100+ authority = authority.replaceAll("[^\\w\\d]", "_").toLowerCase();
 101+
 102+ targetTableName= authority+"_property";
 103+ }
99104
100 - return authority+"_property";
 105+ return targetTableName;
101106 }
102107
103108 protected String getSourceFileName() {
Index: trunk/WikiWord/WikiWordIntegrator/pom.xml
@@ -51,6 +51,12 @@
5252 <scope>test</scope>
5353 </dependency>
5454 <dependency>
 55+ <groupId>hsqldb</groupId>
 56+ <artifactId>hsqldb</artifactId>
 57+ <version>1.8.0.7</version>
 58+ <scope>test</scope>
 59+ </dependency>
 60+ <dependency>
5561 <groupId>org.beanshell</groupId>
5662 <artifactId>bsh-core</artifactId>
5763 <version>2.0b4</version>

Status & tagging log