@@ -51,7 +51,8 @@ fun doTest(testName: String, shell: MongoShell, testDataPath: String, db: String
51
51
val checkResultClass = properties.any { (key, _) -> key == " checkResultClass" }
52
52
val dontReplaceId = properties.any { (key, _) -> key == " dontReplaceId" }
53
53
val dontCheckValue = properties.any { (key, _) -> key == " dontCheckValue" }
54
- val options = CompareOptions (checkResultClass, dontCheckValue, dontReplaceId, properties.mapNotNull { (key, value) ->
54
+ val printStackTrace = properties.any { (key, _) -> key == " printStackTrace" }
55
+ val options = CompareOptions (checkResultClass, dontCheckValue, dontReplaceId, printStackTrace, properties.mapNotNull { (key, value) ->
55
56
when (key) {
56
57
" getArrayItem" -> GetArrayItemCommand (value.toInt())
57
58
" extractProperty" -> ExtractPropertyCommand (value)
@@ -89,7 +90,7 @@ fun doTest(testName: String, shell: MongoShell, testDataPath: String, db: String
89
90
System .err.println (" IGNORED:" )
90
91
e.printStackTrace()
91
92
val message = e.message
92
- val msg = if (message != null && message.contains(' \n ' )) message.substring(0 , message.indexOf(' \n ' )) else message
93
+ val msg = if (message != null && message.contains(' \n ' ) && ! cmd.options.printStackTrace ) message.substring(0 , message.indexOf(' \n ' )) else message
93
94
sb.append(e.javaClass.name).append(" : " ).append(msg?.trim())
94
95
}
95
96
}
@@ -152,7 +153,7 @@ private object AllTypesComparator : Comparator<Any?> {
152
153
}
153
154
154
155
private class Command (val command : String , val options : CompareOptions )
155
- private class CompareOptions (val checkResultClass : Boolean , val dontCheckValue : Boolean , val dontReplaceId : Boolean , val commands : List <CompareCommand >)
156
+ private class CompareOptions (val checkResultClass : Boolean , val dontCheckValue : Boolean , val dontReplaceId : Boolean , val printStackTrace : Boolean , val commands : List <CompareCommand >)
156
157
private sealed class CompareCommand
157
158
private class GetArrayItemCommand (val index : Int ) : CompareCommand()
158
159
private class ExtractPropertyCommand (val property : String ) : CompareCommand()
0 commit comments