1
1
package de .goldendeveloper .mysql ;
2
2
3
+ import de .goldendeveloper .mysql .exceptions .NoConnectionException ;
3
4
import org .junit .jupiter .api .Test ;
4
5
5
6
import java .io .FileInputStream ;
6
7
import java .io .IOException ;
8
+ import java .sql .SQLException ;
7
9
import java .util .Properties ;
8
10
9
11
import static org .junit .jupiter .api .Assertions .*;
@@ -71,7 +73,7 @@ void getUsers() {
71
73
}
72
74
73
75
@ Test
74
- void existsDatabase () {
76
+ void existsDatabase () throws NoConnectionException , SQLException {
75
77
if (!setupTest ().existsDatabase ("test_mysql_api" ))
76
78
setupTest ().createDatabase ("test_mysql_api" );
77
79
assertTrue (setupTest ().existsDatabase ("test_mysql_api" ));
@@ -88,14 +90,14 @@ void customExecute() {
88
90
}
89
91
90
92
@ Test
91
- void getDatabase () {
93
+ void getDatabase () throws NoConnectionException , SQLException {
92
94
if (!setupTest ().existsDatabase ("test_mysql_api" ))
93
95
setupTest ().createDatabase ("test_mysql_api" );
94
96
assertNotNull (setupTest ().getDatabase ("test_mysql_api" ));
95
97
}
96
98
97
99
@ Test
98
- void createDatabase () {
100
+ void createDatabase () throws NoConnectionException , SQLException {
99
101
if (!setupTest ().existsDatabase ("test_mysql_api" ))
100
102
setupTest ().createDatabase ("test_mysql_api" );
101
103
assertTrue (setupTest ().existsDatabase ("test_mysql_api" ));
@@ -107,7 +109,7 @@ void onFlushPrivileges() {
107
109
}
108
110
109
111
@ Test
110
- void switchDatabase () {
112
+ void switchDatabase () throws NoConnectionException , SQLException {
111
113
MYSQL mysql = setupTest ();
112
114
if (!mysql .existsDatabase ("test_mysql_api" ))
113
115
mysql .createDatabase ("test_mysql_api" );
@@ -123,7 +125,7 @@ void createUser() {
123
125
}
124
126
125
127
@ Test
126
- void getDatabases () {
128
+ void getDatabases () throws NoConnectionException , SQLException {
127
129
MYSQL mysql = setupTest ();
128
130
if (!mysql .existsDatabase ("test_mysql_api" ))
129
131
mysql .createDatabase ("test_mysql_api" );
0 commit comments