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

Issues#458 Reverted test script simple changes

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