提交 6f1e47d9 authored 作者: Owner's avatar Owner

Issues#458 Reverted test script simple changes

上级 542e981f
......@@ -11,8 +11,6 @@ import java.io.LineNumberReader;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.h2.test.TestBase;
import org.h2.util.ScriptReader;
......@@ -45,7 +43,6 @@ public class TestScriptSimple extends TestBase {
InputStream is = getClass().getClassLoader().getResourceAsStream(inFile);
LineNumberReader lineReader = new LineNumberReader(
new InputStreamReader(is, "Cp1252"));
List<Throwable> exceptions = new ArrayList<>();
try (ScriptReader reader = new ScriptReader(lineReader)) {
while (true) {
String sql = reader.readStatement();
......@@ -68,22 +65,15 @@ public class TestScriptSimple extends TestBase {
} else {
conn.createStatement().execute(sql);
}
} catch (Throwable e) {
} catch (SQLException e) {
System.out.println(sql);
System.out.println(" at line#"+lineReader.getLineNumber()+" of file "+inFile);
e.printStackTrace();
exceptions.add(e);
throw e;
}
}
}
conn.close();
deleteDb("scriptSimple");
if(exceptions.size()!=0){
String message = "Failed test, detected assertions="+exceptions.size();
System.out.println(message);
throw new AssertionError(message);
}
}
private void reconnect() throws SQLException {
......
......@@ -111,7 +111,8 @@ public final class ImmutableArray<K> implements Iterable<K> {
* @param array the data
* @return the new immutable array
*/
public static <K> ImmutableArray<K> create(K... array) {
@SafeVarargs
public static <K> ImmutableArray<K> create(K... array) {
return new ImmutableArray<K>(array);
}
......
......@@ -151,7 +151,8 @@ public final class ImmutableArray2<K> implements Iterable<K> {
* @param array the data
* @return the new immutable array
*/
public static <K> ImmutableArray2<K> create(K... array) {
@SafeVarargs
public static <K> ImmutableArray2<K> create(K... array) {
return new ImmutableArray2<K>(array, array.length);
}
......
......@@ -84,7 +84,8 @@ public abstract class ImmutableArray3<K> implements Iterable<K> {
* @param array the data
* @return the new immutable array
*/
public static <K> ImmutableArray3<K> create(K... array) {
@SafeVarargs
public static <K> ImmutableArray3<K> create(K... array) {
return new Plain<K>(array);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论