Revision: 672
http://stripes.svn.sourceforge.net/stripes/?rev=672&view=rev
Author: bengunter
Date: 2007-12-12 04:46:27 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
Test to ensure that a cached null formatter is not used as the best match
Modified Paths:
--------------
trunk/tests/src/net/sourceforge/stripes/format/DefaultFormatterFactoryTest.java
Modified:
trunk/tests/src/net/sourceforge/stripes/format/DefaultFormatterFactoryTest.java
===================================================================
---
trunk/tests/src/net/sourceforge/stripes/format/DefaultFormatterFactoryTest.java
2007-12-12 05:29:33 UTC (rev 671)
+++
trunk/tests/src/net/sourceforge/stripes/format/DefaultFormatterFactoryTest.java
2007-12-12 12:46:27 UTC (rev 672)
@@ -92,6 +92,24 @@
Assert.assertEquals(ZTC.class, formatter.getClass());
}
+ @Test(groups = "fast")
+ public void testNullFormatterIsNeverBestMatch() throws Exception {
+ DefaultFormatterFactory factory = new DefaultFormatterFactory();
+ factory.init(new DefaultConfiguration());
+
+ Locale locale = Locale.getDefault();
+ Formatter<?> formatter;
+
+ // cause null formatter to be cached for B
+ formatter = factory.getFormatter(B.class, locale, null, null);
+ Assert.assertNull(formatter);
+
+ // then try to get a formatter for C
+ factory.add(C.class, CTC.class);
+ formatter = factory.getFormatter(C.class, locale, null, null);
+ Assert.assertEquals(CTC.class, formatter.getClass());
+ }
+
public static class A {
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development