-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gary Gregory wrote: > Hello Tom: > > Please provide unit tests. I want to see this code in action in order to > figure out what the intent of the class really is. > > Thanks, > Gary > >
No. A very limited one but the idea should be clear ;-) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iD8DBQFDAlHXkVPeOFLgZFIRAqbuAJ4ulPg3hGUkiCbWNunfNW+mtEUN0wCfQM/Q XEZ2JafiiJF66IDnlfJ5adg= =tD9P -----END PGP SIGNATURE-----
import java.util.Date; import java.util.HashMap; import java.util.Locale; import org.apache.commons.lang.text.VariableFormatterWithFormating; import junit.framework.TestCase; public class VariableFormatterWithFormatingTest extends TestCase { /* * Test method for 'org.apache.commons.lang.text.VariableFormatterWithFormating.replace(Map, Object)' */ public void testReplaceMapObject() { HashMap map = new HashMap(); map.put("date",new Date(0)); map.put("number",new Double(100.2)); Locale.setDefault(Locale.US); String message = new String("On ${date,date,yyyy-mm-dd} I earned ${number,number,currency}"); assertEquals("On 1970-00-01 I earned $100.20",VariableFormatterWithFormating.replace(map,message)); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]