Commit 3946a9ce authored by rwm's avatar rwm

javadoc, resource leaks

parent 170e35c1
......@@ -30,7 +30,8 @@ import de.sekmi.histream.ontology.ValueRestriction;
/**
* Import ontology data into i2b2.
* <p>
* Use the methods in the following order: {@link #openDatabase(Map)}, {@link #loadOntology(Class, Map)}, {@link #processOntology()}, {@link #close
* Use the methods in the following order:
* constructor {@link #Import(Map)}, {@link #setOntology(Ontology)}, {@link #processOntology()}, {@link #close()}
*
* @author Raphael
*
......@@ -68,8 +69,8 @@ public class Import implements AutoCloseable{
* Any other parameters starting with {@code jdbc.} are also passed to {@link DriverManager#getConnection(String, Properties)}.
* <p>
* More parameters: {@code ont.language} and {@code ont.scheme}.
* @throws ClassNotFoundException
* @throws SQLException
* @throws ClassNotFoundException if database driver not found
* @throws SQLException for SQL errors
*/
public Import(Map<String,String> props) throws ClassNotFoundException, SQLException{
openDatabase(props);
......
package de.sekmi.histream;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.ResolverStyle;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
......@@ -26,7 +25,7 @@ public class TestDateTimeAccuracy {
public void testFormatExceedsText(){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d.M.u[ H[:m[:s]]]");
formatter.withResolverStyle(ResolverStyle.STRICT);
DateTimeFormatterBuilder b = new DateTimeFormatterBuilder();
//DateTimeFormatterBuilder b = new DateTimeFormatterBuilder();
DateTimeAccuracy a;
a = DateTimeAccuracy.parse(formatter, "01.02.2003");
Assert.assertEquals(ChronoUnit.DAYS,a.getAccuracy());
......
......@@ -3,6 +3,7 @@ package de.sekmi.histream.io;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;
......@@ -14,13 +15,17 @@ public class TransformerTest {
f.initializeObservationFactory();
Transformation t = Transformation.Identity;
try( FlatObservationSupplier sup = new FlatObservationSupplier(f.getFactory(), new FileInputStream("examples/dwh-flat.txt")) ){
PullTransformer p = new PullTransformer(sup, t);
// validate content after identity transformation
f.initializeHandler();
f.validateExample(p);
f.closeHandler();
}
InputStream in = new FileInputStream("examples/dwh-flat.txt");
FlatObservationSupplier sup = new FlatObservationSupplier(f.getFactory(),in );
PullTransformer p = new PullTransformer(sup, t);
// validate content after identity transformation
f.initializeHandler();
f.validateExample(p);
f.closeHandler();
sup.close();
in.close();
}
}
......@@ -84,6 +84,7 @@ public class ETLObservationSupplier implements ObservationSupplier{
// open all tables
wr = new ArrayList<>(wt.size());
for( WideTable t : wt ){
@SuppressWarnings("resource")
RecordSupplier<WideRow> s = t.open(factory, sourceId);
queue.addFactTable(s);
wr.add(s);
......
......@@ -2,7 +2,6 @@ package de.sekmi.histream.etl.config;
import java.io.IOException;
import java.time.Instant;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
......@@ -18,8 +17,8 @@ import de.sekmi.histream.etl.RowSupplier;
public abstract class TableSource{
/**
*
* @return
* @throws IOException
* @return row supplier
* @throws IOException IO errors during row supplier construction
*/
public abstract RowSupplier rows() throws IOException;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment