jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] 31/32: Fix Groovy Spec code
Date Sat, 21 Aug 2021 12:10:53 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 71f989fb1bb3dc502b97662ff58060b5f03e0860
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Sat Aug 14 18:08:11 2021 +0200

    Fix Groovy Spec code
---
 .../src/test/groovy/org/apache/jorphan/util/ConverterSpec.groovy     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/jorphan/src/test/groovy/org/apache/jorphan/util/ConverterSpec.groovy b/src/jorphan/src/test/groovy/org/apache/jorphan/util/ConverterSpec.groovy
index 604dc2b..54ac0b3 100644
--- a/src/jorphan/src/test/groovy/org/apache/jorphan/util/ConverterSpec.groovy
+++ b/src/jorphan/src/test/groovy/org/apache/jorphan/util/ConverterSpec.groovy
@@ -94,6 +94,9 @@ class ConverterSpec extends Specification {
 
     def "Convert '#value' to #type"() {
         expect:
+            if (value == "OBJECT_WITH_BROKEN_TO_STRING") {
+                value = new Object() { String toString() { 1/0 } }
+            }
             Converter.convert(value, type) == expected
         where:
             value                | type            | expected
@@ -114,7 +117,7 @@ class ConverterSpec extends Specification {
             ''                   | char.class      | ' '
             Character.valueOf((char) 65)       | char.class | 'A'
             Byte.valueOf((byte)65)             | char.class | 'A'
-            new Object() { String toString() {1/0}} | char.class | ' '
+            "OBJECT_WITH_BROKEN_TO_STRING" | char.class | ' '
     }
 
     def "Convert to date from '#value'"() {

Mime
View raw message