1
1
package dev .mongocamp .driver .mongodb .jdbc
2
2
3
- import dev .mongocamp .driver .mongodb .MongoDAO
4
- import dev .mongocamp .driver .mongodb .dao .PersonSpecification
5
- import dev .mongocamp .driver .mongodb .model .{Grade , Score }
6
- import dev .mongocamp .driver .mongodb .test .TestDatabase
7
- import org .bson .types .ObjectId
8
-
9
- import java .sql .{DriverManager , ResultSet , Types }
10
- import java .util .Properties
11
- import scala .collection .mutable .ArrayBuffer
12
- import better .files .{File , Resource }
13
- import dev .mongocamp .driver .mongodb .{GenericObservable , MongoDAO }
14
- import dev .mongocamp .driver .mongodb .dao .PersonSpecification
15
- import dev .mongocamp .driver .mongodb .model .{Grade , Score }
16
- import dev .mongocamp .driver .mongodb .test .TestDatabase
17
- import dev .mongocamp .driver .mongodb .test .TestDatabase .PersonDAO
18
- import org .bson .types .ObjectId
19
- import org .specs2 .mutable .Specification
20
- import org .specs2 .specification .{BeforeAll , BeforeEach }
3
+ import java .sql .Types
21
4
22
5
class ExploreJdbcSpec extends BaseJdbcSpec {
23
6
7
+ val schemaPattern : String = " mongocamp-unit-test$"
8
+
24
9
" Jdbc Connection" should {
25
10
26
11
" get table names" in {
27
- val tableNames = connection.getMetaData.getTables(" %" , " mongocamp-unit-test " , " " , Array .empty)
12
+ val tableNames = connection.getMetaData.getTables(" %" , schemaPattern , " " , Array .empty)
28
13
var tables = 0
29
14
var tablePersonFound = false
30
15
while (tableNames.next()) {
@@ -40,8 +25,8 @@ class ExploreJdbcSpec extends BaseJdbcSpec {
40
25
tables += 1
41
26
}
42
27
tables must beGreaterThanOrEqualTo(1 )
43
- val columnNames = connection.getMetaData.getColumns(" %" , " mongocamp-unit-test " , " people" , " " )
44
- var columns = 0
28
+ val columnNames = connection.getMetaData.getColumns(" %" , schemaPattern , " people" , " " )
29
+ var columns = 0
45
30
while (columnNames.next()) {
46
31
columnNames.getString(" TABLE_CAT" ) must beEqualTo(" mongodb" )
47
32
columnNames.getString(" TABLE_NAME" ) must beEqualTo(" people" )
0 commit comments