From 73ea9c43c6013659d77b0b3663452c00fad5e2a0 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Tue, 25 Sep 2012 21:46:34 +0000 Subject: [PATCH] Extract constant Label output with test case name git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1390172 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/lang3/time/FastDateFormatTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java index 8a7aa1365..e394c41b7 100644 --- a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java +++ b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java @@ -252,9 +252,10 @@ public class FastDateFormatTest { @Test public void testParseSync() throws InterruptedException { - final FastDateFormat formatter= FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss.SSS Z"); + final String pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS Z"; + final FastDateFormat formatter= FastDateFormat.getInstance(pattern); - long sdfTime= measureTime(formatter, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z") { + long sdfTime= measureTime(formatter, new SimpleDateFormat(pattern) { private static final long serialVersionUID = 1L; // because SimpleDateFormat is serializable @Override @@ -265,9 +266,9 @@ public class FastDateFormatTest { } }); - long fdfTime= measureTime(formatter, FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss.SSS Z")); + long fdfTime= measureTime(formatter, FastDateFormat.getInstance(pattern)); - String times= "FastDateParser:"+fdfTime+" SimpleDateFormat:"+sdfTime; + String times= "FastDateParserTest: FastDateParser:"+fdfTime+" SimpleDateFormat:"+sdfTime; System.out.println(times); }