This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b2a8ced Better test failure messages
     new 9a4a51eb Merge branch 'master' of 
https://gitbox.apache.org/repos/asf/commons-beanutils.git
1b2a8ced is described below

commit 1b2a8cedc216440fa29e0ba896a3b9fa2cb989b7
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Feb 12 11:13:14 2023 -0500

    Better test failure messages
---
 .../beanutils2/converters/BaseLocaleConverterTestCase.java | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/beanutils2/converters/BaseLocaleConverterTestCase.java
 
b/src/test/java/org/apache/commons/beanutils2/converters/BaseLocaleConverterTestCase.java
index 0f8a632c..f91d2336 100644
--- 
a/src/test/java/org/apache/commons/beanutils2/converters/BaseLocaleConverterTestCase.java
+++ 
b/src/test/java/org/apache/commons/beanutils2/converters/BaseLocaleConverterTestCase.java
@@ -134,7 +134,7 @@ public class BaseLocaleConverterTestCase<T> extends 
TestCase {
         try {
             result = converter.convert(value, pattern);
         } catch (final Exception e) {
-            fail("Pattern conversion threw " + msgId + " threw " + e);
+            fail("Pattern conversion threw '" + msgId + "' threw " + e);
         }
         assertEquals("Check conversion value with pattern " + msgId, 
expectedValue, result);
     }
@@ -154,7 +154,7 @@ public class BaseLocaleConverterTestCase<T> extends 
TestCase {
         try {
             result = converter.convert(value);
         } catch (final Exception e) {
-            fail("No Pattern conversion threw " + msgId + " threw " + e);
+            fail("No Pattern conversion threw '" + msgId + "' threw " + e);
         }
         assertEquals("Check conversion value without pattern " + msgId, 
expectedValue, result);
 
@@ -175,7 +175,7 @@ public class BaseLocaleConverterTestCase<T> extends 
TestCase {
         try {
             result = converter.convert(clazz, value, pattern);
         } catch (final Exception e) {
-            fail("Type  conversion threw " + msgId + " threw " + e);
+            fail("Type  conversion threw '" + msgId + "' threw " + e);
         }
         assertEquals("Check conversion value to type " + msgId, expectedValue, 
result);
     }
@@ -199,7 +199,7 @@ public class BaseLocaleConverterTestCase<T> extends 
TestCase {
         }
 
         if (expectedValue == null) {
-            assertNull("Check null conversion is null " + msgId + " 
result="+result, result);
+            assertNull("Check null conversion is null '" + msgId + "' 
result="+result, result);
         } else {
             assertEquals("Check null conversion is default " + msgId, 
expectedValue, result);
         }
@@ -220,11 +220,11 @@ public class BaseLocaleConverterTestCase<T> extends 
TestCase {
         try {
             result = converter.convert("xyz");
             if (expectedValue == null) {
-                fail("Expected ConversionException if no default value " + 
msgId);
+                fail("Expected ConversionException if no default value " + 
msgId + ", converter = " + converter);
             }
         } catch (final Exception e) {
             if (expectedValue != null) {
-                fail("Expected default value " + msgId + " threw " + e);
+                fail("Expected default value '" + msgId + "' threw " + e);
             }
         }
 
@@ -235,7 +235,7 @@ public class BaseLocaleConverterTestCase<T> extends 
TestCase {
 
     /**
      * This class isn't intended to perform any real tests; it just provides
-     * methods for the real test cases to inherit. However junit complains
+     * methods for the real test cases to inherit. However JUnit complains
      * if a class named ..TestCase contains no test methods, so here we
      * define a dummy one to keep it happy.
      */

Reply via email to