commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r1099414 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
Date Wed, 04 May 2011 11:13:51 GMT
Author: scolebourne
Date: Wed May  4 11:13:51 2011
New Revision: 1099414

URL: http://svn.apache.org/viewvc?rev=1099414&view=rev
Log:
Test impact on Pair of being Formattable

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/tuple/PairTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/tuple/PairTest.java?rev=1099414&r1=1099413&r2=1099414&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/tuple/PairTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/tuple/PairTest.java Wed
May  4 11:13:51 2011
@@ -105,5 +105,17 @@ public class PairTest {
         Pair<String, Calendar> pair = Pair.of("DOB", date);
         assertEquals("Test created on " + "04-25-2011", pair.toString("Test created on %2$tm-%2$td-%2$tY"));
     }
-    
+
+    @Test
+    public void testFormattable_simple() throws Exception {
+        Pair<String, String> pair = Pair.of("Key", "Value");
+        assertEquals("(Key,Value)", String.format("%1$s", pair));
+    }
+
+    @Test
+    public void testFormattable_padded() throws Exception {
+        Pair<String, String> pair = Pair.of("Key", "Value");
+        assertEquals("         (Key,Value)", String.format("%1$20s", pair));
+    }
+
 }



Mime
View raw message