Skip to content

Commit 4f56506

Browse files
committed
fix test, removed the catch block
1 parent b15d079 commit 4f56506

File tree

1 file changed

+2
-11
lines changed
  • src/test/java/org/apache/ibatis/submitted/parent_reference_3level

1 file changed

+2
-11
lines changed

src/test/java/org/apache/ibatis/submitted/parent_reference_3level/BlogTest.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import static org.junit.Assert.assertEquals;
1919
import static org.junit.Assert.assertNotNull;
20-
import static org.junit.Assert.fail;
2120

2221
import java.io.Reader;
2322
import java.sql.Connection;
@@ -45,10 +44,8 @@ public void setUp() throws Exception {
4544

4645
try {
4746
Class.forName("org.hsqldb.jdbcDriver");
48-
conn = DriverManager.getConnection(
49-
"jdbc:hsqldb:mem:parent_reference_3level", "sa", "");
50-
Reader reader = Resources
51-
.getResourceAsReader("org/apache/ibatis/submitted/parent_reference_3level/CreateDB.sql");
47+
conn = DriverManager.getConnection("jdbc:hsqldb:mem:parent_reference_3level", "sa", "");
48+
Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/parent_reference_3level/CreateDB.sql");
5249
ScriptRunner runner = new ScriptRunner(conn);
5350
runner.setLogWriter(null);
5451
runner.setErrorLogWriter(null);
@@ -75,9 +72,6 @@ public void testSelectBlogWithPosts() {
7572
Blog result = mapper.selectBlogByPrimaryKey(1);
7673
assertNotNull(result);
7774
assertEquals("Blog with posts", result.getTitle());
78-
} catch (Exception e) {
79-
e.printStackTrace();
80-
fail("testSelectBlogWithChildrens");
8175
} finally {
8276
session.close();
8377
}
@@ -91,9 +85,6 @@ public void testSelectBlogWithoutPosts() {
9185
Blog result = mapper.selectBlogByPrimaryKey(2);
9286
assertNotNull(result);
9387
assertEquals("Blog without posts", result.getTitle());
94-
} catch (Exception e) {
95-
e.printStackTrace();
96-
fail("testSelectBlogWithoutChildrens");
9788
} finally {
9889
session.close();
9990
}

0 commit comments

Comments
 (0)