Skip to content

Commit 7e95d3f

Browse files
committed
Added tests for the SQLDriverFactory
1 parent 7e7d47f commit 7e95d3f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.javawebstack.orm.test;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
import org.javawebstack.orm.wrapper.SQLDriverFactory;
6+
import org.javawebstack.orm.wrapper.SQLDriverNotFoundException;
7+
import org.junit.jupiter.api.Test;
8+
9+
import java.util.HashMap;
10+
11+
class SQLDriverFactoryTest {
12+
private SQLDriverFactory factory = new SQLDriverFactory(new HashMap<String, String>() {{
13+
put("file", "sb.sqlite");
14+
put("host", "localhost");
15+
put("port", "3306");
16+
put("name", "app");
17+
put("user", "root");
18+
put("password", "");
19+
}});
20+
21+
@Test
22+
public void testSQLite() throws SQLDriverNotFoundException {
23+
assertNotNull(factory.getDriver("sqlite"));
24+
}
25+
26+
@Test
27+
public void testMySQL() throws SQLDriverNotFoundException {
28+
assertNotNull(factory.getDriver("mysql"));
29+
}
30+
}

0 commit comments

Comments
 (0)