Skip to content

Commit 9aaa4f4

Browse files
committed
Upgrade to latest HSQLDB and fix related issues, let the build run offline without SVN installed
1 parent 87cca9e commit 9aaa4f4

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@
235235
<forkMode>pertest</forkMode>
236236
</configuration>
237237
</plugin>
238+
<plugin>
239+
<groupId>org.codehaus.mojo</groupId>
240+
<artifactId>buildnumber-maven-plugin</artifactId>
241+
<configuration>
242+
<revisionOnScmFailure>local-dev</revisionOnScmFailure>
243+
</configuration>
244+
</plugin>
238245
</plugins>
239246
<resources>
240247
<resource>
@@ -309,7 +316,7 @@
309316
<dependency>
310317
<groupId>org.hsqldb</groupId>
311318
<artifactId>hsqldb</artifactId>
312-
<version>2.0.0</version>
319+
<version>2.2.4</version>
313320
<scope>test</scope>
314321
</dependency>
315322
<dependency>

src/test/java/com/ddl/hsql/jpetstore-hsqldb-schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ create table account (
4040
email varchar(80) not null,
4141
firstname varchar(80) not null,
4242
lastname varchar(80) not null,
43-
status varchar(2) null,
43+
status varchar(10) null,
4444
addr1 varchar(80) not null,
4545
addr2 varchar(40) null,
4646
city varchar(80) not null,

src/test/java/org/apache/ibatis/jdbc/SqlRunnerTest.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package org.apache.ibatis.jdbc;
22

3-
import org.apache.ibatis.BaseDataTest;
43
import static org.junit.Assert.assertEquals;
54
import static org.junit.Assert.assertTrue;
6-
import org.junit.Test;
75

8-
import javax.sql.DataSource;
96
import java.sql.Connection;
107
import java.util.List;
118
import java.util.Map;
129

10+
import javax.sql.DataSource;
11+
12+
import org.apache.ibatis.BaseDataTest;
13+
import org.junit.Test;
14+
1315
public class SqlRunnerTest extends BaseDataTest {
1416

1517
@Test
@@ -20,6 +22,7 @@ public void shouldSelectOne() throws Exception {
2022
Connection connection = ds.getConnection();
2123
SqlRunner exec = new SqlRunner(connection);
2224
Map row = exec.selectOne("SELECT * FROM PRODUCT WHERE PRODUCTID = ?", "FI-SW-01");
25+
connection.close();
2326
assertEquals("FI-SW-01", row.get("PRODUCTID"));
2427
}
2528

@@ -31,6 +34,7 @@ public void shouldSelectList() throws Exception {
3134
Connection connection = ds.getConnection();
3235
SqlRunner exec = new SqlRunner(connection);
3336
List rows = exec.selectAll("SELECT * FROM PRODUCT");
37+
connection.close();
3438
assertEquals(16, rows.size());
3539
}
3640

@@ -44,6 +48,7 @@ public void shouldInsert() throws Exception {
4448
int id = exec.insert("INSERT INTO author (username, password, email, bio) VALUES (?,?,?,?)", "someone", "******", "[email protected]", Null.LONGVARCHAR);
4549
Map row = exec.selectOne("SELECT * FROM author WHERE username = ?", "someone");
4650
connection.rollback();
51+
connection.close();
4752
assertTrue(SqlRunner.NO_GENERATED_KEY != id);
4853
assertEquals("someone", row.get("USERNAME"));
4954
}
@@ -57,6 +62,7 @@ public void shouldUpdateCategory() throws Exception {
5762
SqlRunner exec = new SqlRunner(connection);
5863
int count = exec.update("update product set category = ? where productid = ?", "DOGS", "FI-SW-01");
5964
Map row = exec.selectOne("SELECT * FROM PRODUCT WHERE PRODUCTID = ?", "FI-SW-01");
65+
connection.close();
6066
assertEquals("DOGS", row.get("CATEGORY"));
6167
assertEquals(1, count);
6268
}
@@ -70,6 +76,7 @@ public void shouldDeleteOne() throws Exception {
7076
SqlRunner exec = new SqlRunner(connection);
7177
int count = exec.delete("delete from item");
7278
List rows = exec.selectAll("SELECT * FROM ITEM");
79+
connection.close();
7380
assertEquals(28, count);
7481
assertEquals(0, rows.size());
7582
}
@@ -83,8 +90,7 @@ public void shouldDemonstrateDDLThroughRunMethod() throws Exception {
8390
exec.run("insert into BLAH values (1)");
8491
List rows = exec.selectAll("SELECT * FROM BLAH");
8592
exec.run("DROP TABLE BLAH");
93+
connection.close();
8694
assertEquals(1, rows.size());
8795
}
88-
89-
9096
}

src/test/java/org/apache/ibatis/submitted/sptests/SPTest.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ public void testAdderAsUpdateWithParameterMap() {
210210
* This test shows using a single value parameter.
211211
*/
212212
@Test
213-
@Ignore("until hsqldb 2.0.1 is released")
214213
public void testCallWithResultSet1() {
215214
SqlSession sqlSession = sqlSessionFactory.openSession();
216215
try {
@@ -231,7 +230,6 @@ public void testCallWithResultSet1() {
231230
* This test shows using a single value parameter.
232231
*/
233232
@Test
234-
@Ignore("until hsqldb 2.0.1 is released")
235233
public void testCallWithResultSet2() {
236234
SqlSession sqlSession = sqlSessionFactory.openSession();
237235
try {
@@ -254,7 +252,6 @@ public void testCallWithResultSet2() {
254252
* This test shows using a Map parameter.
255253
*/
256254
@Test
257-
@Ignore("until hsqldb 2.0.1 is released")
258255
public void testCallWithResultSet3() {
259256
SqlSession sqlSession = sqlSessionFactory.openSession();
260257
try {
@@ -283,7 +280,6 @@ public void testCallWithResultSet3() {
283280
* This test shows using a Map parameter.
284281
*/
285282
@Test
286-
@Ignore("until hsqldb 2.0.1 is released")
287283
public void testCallWithResultSet4() {
288284
SqlSession sqlSession = sqlSessionFactory.openSession();
289285
try {
@@ -312,7 +308,6 @@ public void testCallWithResultSet4() {
312308
* @throws SQLException
313309
*/
314310
@Test
315-
@Ignore("until hsqldb 2.0.1 is released")
316311
public void testGetNamesWithArray() throws SQLException {
317312
SqlSession sqlSession = sqlSessionFactory.openSession();
318313
try {
@@ -340,7 +335,6 @@ public void testGetNamesWithArray() throws SQLException {
340335
* @throws SQLException
341336
*/
342337
@Test
343-
@Ignore("until hsqldb 2.0.1 is released")
344338
public void testGetNamesAndItems() throws SQLException {
345339
SqlSession sqlSession = sqlSessionFactory.openSession();
346340
try {
@@ -492,7 +486,6 @@ public void testAdderAsUpdateAnnotated() {
492486
* This test shows using annotations for stored procedures
493487
*/
494488
@Test
495-
@Ignore("until hsqldb 2.0.1 is released")
496489
public void testCallWithResultSet1Annotated() {
497490
SqlSession sqlSession = sqlSessionFactory.openSession();
498491
try {
@@ -516,7 +509,6 @@ public void testCallWithResultSet1Annotated() {
516509
* and using a resultMap in XML
517510
*/
518511
@Test
519-
@Ignore("until hsqldb 2.0.1 is released")
520512
public void testCallWithResultSet1_a2() {
521513
SqlSession sqlSession = sqlSessionFactory.openSession();
522514
try {
@@ -539,7 +531,6 @@ public void testCallWithResultSet1_a2() {
539531
* This test shows using annotations for stored procedures
540532
*/
541533
@Test
542-
@Ignore("until hsqldb 2.0.1 is released")
543534
public void testCallWithResultSet2_a1() {
544535
SqlSession sqlSession = sqlSessionFactory.openSession();
545536
try {
@@ -565,7 +556,6 @@ public void testCallWithResultSet2_a1() {
565556
* and using a resultMap in XML
566557
*/
567558
@Test
568-
@Ignore("until hsqldb 2.0.1 is released")
569559
public void testCallWithResultSet2_a2() {
570560
SqlSession sqlSession = sqlSessionFactory.openSession();
571561
try {
@@ -590,7 +580,6 @@ public void testCallWithResultSet2_a2() {
590580
* This test shows using annotations for stored procedures
591581
*/
592582
@Test
593-
@Ignore("until hsqldb 2.0.1 is released")
594583
public void testCallWithResultSet3_a1() {
595584
SqlSession sqlSession = sqlSessionFactory.openSession();
596585
try {
@@ -622,7 +611,6 @@ public void testCallWithResultSet3_a1() {
622611
* and using a resultMap in XML
623612
*/
624613
@Test
625-
@Ignore("until hsqldb 2.0.1 is released")
626614
public void testCallWithResultSet3_a2() {
627615
SqlSession sqlSession = sqlSessionFactory.openSession();
628616
try {
@@ -653,7 +641,6 @@ public void testCallWithResultSet3_a2() {
653641
* This test shows using annotations for stored procedures
654642
*/
655643
@Test
656-
@Ignore("until hsqldb 2.0.1 is released")
657644
public void testCallWithResultSet4_a1() {
658645
SqlSession sqlSession = sqlSessionFactory.openSession();
659646
try {
@@ -685,7 +672,6 @@ public void testCallWithResultSet4_a1() {
685672
* and using a resultMap in XML
686673
*/
687674
@Test
688-
@Ignore("until hsqldb 2.0.1 is released")
689675
public void testCallWithResultSet4_a2() {
690676
SqlSession sqlSession = sqlSessionFactory.openSession();
691677
try {
@@ -716,7 +702,6 @@ public void testCallWithResultSet4_a2() {
716702
* @throws SQLException
717703
*/
718704
@Test
719-
@Ignore("until hsqldb 2.0.1 is released")
720705
public void testGetNamesWithArray_a1() throws SQLException {
721706
SqlSession sqlSession = sqlSessionFactory.openSession();
722707
try {
@@ -747,7 +732,6 @@ public void testGetNamesWithArray_a1() throws SQLException {
747732
* @throws SQLException
748733
*/
749734
@Test
750-
@Ignore("until hsqldb 2.0.1 is released")
751735
public void testGetNamesWithArray_a2() throws SQLException {
752736
SqlSession sqlSession = sqlSessionFactory.openSession();
753737
try {
@@ -778,7 +762,6 @@ public void testGetNamesWithArray_a2() throws SQLException {
778762
* @throws SQLException
779763
*/
780764
@Test
781-
@Ignore("until hsqldb 2.0.1 is released")
782765
public void testGetNamesAndItems_a2() throws SQLException {
783766
SqlSession sqlSession = sqlSessionFactory.openSession();
784767
try {

0 commit comments

Comments
 (0)