17
17
18
18
import static org .junit .Assert .assertEquals ;
19
19
import static org .junit .Assert .assertNotNull ;
20
- import static org .junit .Assert .fail ;
21
20
22
21
import java .io .Reader ;
23
22
import java .sql .Connection ;
@@ -45,10 +44,8 @@ public void setUp() throws Exception {
45
44
46
45
try {
47
46
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" );
52
49
ScriptRunner runner = new ScriptRunner (conn );
53
50
runner .setLogWriter (null );
54
51
runner .setErrorLogWriter (null );
@@ -75,9 +72,6 @@ public void testSelectBlogWithPosts() {
75
72
Blog result = mapper .selectBlogByPrimaryKey (1 );
76
73
assertNotNull (result );
77
74
assertEquals ("Blog with posts" , result .getTitle ());
78
- } catch (Exception e ) {
79
- e .printStackTrace ();
80
- fail ("testSelectBlogWithChildrens" );
81
75
} finally {
82
76
session .close ();
83
77
}
@@ -91,9 +85,6 @@ public void testSelectBlogWithoutPosts() {
91
85
Blog result = mapper .selectBlogByPrimaryKey (2 );
92
86
assertNotNull (result );
93
87
assertEquals ("Blog without posts" , result .getTitle ());
94
- } catch (Exception e ) {
95
- e .printStackTrace ();
96
- fail ("testSelectBlogWithoutChildrens" );
97
88
} finally {
98
89
session .close ();
99
90
}
0 commit comments