Skip to content

Commit 08e247f

Browse files
committed
test: some errors on rerun tests
1 parent 8a39da8 commit 08e247f

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

src/main/scala/dev/mongocamp/driver/mongodb/jdbc/MongoDatabaseMetaData.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ class MongoDatabaseMetaData(connection: MongoJdbcConnection) extends DatabaseMet
345345
case "double" =>
346346
decimalDigits = Some(Int.MaxValue)
347347
Types.DOUBLE
348-
case "array" => Types.ARRAY
349-
case "bool" => Types.BOOLEAN
350-
case "object" => Types.JAVA_OBJECT
348+
case "array" => Types.ARRAY
349+
case "bool" => Types.BOOLEAN
350+
case "object" => Types.JAVA_OBJECT
351351
case _ =>
352352
Types.VARCHAR
353353
}

src/test/scala/dev/mongocamp/driver/mongodb/gridfs/GridfsDatabaseFunctions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ trait GridfsDatabaseFunctions extends MongoImplicits {
1616

1717
def deleteImage(id: ObjectId): Unit = ImageFilesDAO.deleteOne(id)
1818

19-
def dropImages(): Unit = ImageFilesDAO.drop()
19+
def dropImages(): Unit = ImageFilesDAO.drop().result(60)
2020

21-
def imagesCount: Long = ImageFilesDAO.count()
21+
def imagesCount: Long = ImageFilesDAO.count().result(60)
2222

2323
def insertImage(path: String, metadata: AnyRef): ObjectId = {
2424
val file = File(path)

src/test/scala/dev/mongocamp/driver/mongodb/jdbc/ExploreJdbcSpec.scala

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
package dev.mongocamp.driver.mongodb.jdbc
22

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
214

225
class ExploreJdbcSpec extends BaseJdbcSpec {
236

7+
val schemaPattern: String = "mongocamp-unit-test$"
8+
249
"Jdbc Connection" should {
2510

2611
"get table names" in {
27-
val tableNames = connection.getMetaData.getTables("%", "mongocamp-unit-test", "", Array.empty)
12+
val tableNames = connection.getMetaData.getTables("%", schemaPattern, "", Array.empty)
2813
var tables = 0
2914
var tablePersonFound = false
3015
while (tableNames.next()) {
@@ -40,8 +25,8 @@ class ExploreJdbcSpec extends BaseJdbcSpec {
4025
tables += 1
4126
}
4227
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
4530
while (columnNames.next()) {
4631
columnNames.getString("TABLE_CAT") must beEqualTo("mongodb")
4732
columnNames.getString("TABLE_NAME") must beEqualTo("people")

0 commit comments

Comments
 (0)