commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CODEC-246) ColognePhoneticTest.testIsEncodeEquals missing assertions
Date Tue, 29 May 2018 14:37:00 GMT

    [ https://issues.apache.org/jira/browse/CODEC-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493580#comment-16493580
] 

Gary Gregory edited comment on CODEC-246 at 5/29/18 2:36 PM:
-------------------------------------------------------------

I see now, sorry. If we use:
{noformat}
Index: src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java
===================================================================
--- src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java	(revision 1832403)
+++ src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java	(working copy)
@@ -19,6 +19,7 @@
 
 import org.apache.commons.codec.EncoderException;
 import org.apache.commons.codec.StringEncoderAbstractTest;
+import org.junit.Assert;
 import org.junit.Test;
 
 /**
@@ -142,7 +143,7 @@
             {"ganz", "G\u00e4nse"}, // Gänse
             {"Miyagi", "Miyako"}};
         for (final String[] element : data) {
-            this.getStringEncoder().isEncodeEqual(element[1], element[0]);
+            Assert.assertTrue(element[1] + " != " + element[0], this.getStringEncoder().isEncodeEqual(element[1],
element[0]));
         }
     }
{noformat}

Then the test fails.

Feel free to provide a PR with the latest from svn trunk: 
- I just added comments to the unit test
- I also split up the test method for this ticket between what works and what does not.

We clearly need more test fixtures.


was (Author: garydgregory):
I see now, sorry. If we use:
{noformat}
Index: src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java
===================================================================
--- src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java	(revision 1832403)
+++ src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java	(working copy)
@@ -19,6 +19,7 @@
 
 import org.apache.commons.codec.EncoderException;
 import org.apache.commons.codec.StringEncoderAbstractTest;
+import org.junit.Assert;
 import org.junit.Test;
 
 /**
@@ -142,7 +143,7 @@
             {"ganz", "G\u00e4nse"}, // Gänse
             {"Miyagi", "Miyako"}};
         for (final String[] element : data) {
-            this.getStringEncoder().isEncodeEqual(element[1], element[0]);
+            Assert.assertTrue(element[1] + " != " + element[0], this.getStringEncoder().isEncodeEqual(element[1],
element[0]));
         }
     }
{noformat}

Then the test fails.

Feel free to provide a PR with the latest from svn trunk (I just added comments to the unit
test.)

> ColognePhoneticTest.testIsEncodeEquals missing assertions
> ---------------------------------------------------------
>
>                 Key: CODEC-246
>                 URL: https://issues.apache.org/jira/browse/CODEC-246
>             Project: Commons Codec
>          Issue Type: Improvement
>            Reporter: Oscar Luis Vera Pérez
>            Priority: Trivial
>
> The test method ColognePhoneticTest.isEncodeEquals  misses an assertion to properly
verify the ColognePhonetic.isEncodeEquals method. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message