commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r949864 [39/48] - in /websites/production/commons/content/proper/commons-lang: ./ apidocs/ apidocs/org/apache/commons/lang3/ apidocs/org/apache/commons/lang3/builder/ apidocs/org/apache/commons/lang3/time/ apidocs/src-html/org/apache/common...
Date Fri, 01 May 2015 20:55:53 GMT
Modified: websites/production/commons/content/proper/commons-lang/xref-test/org/apache/commons/lang3/time/DurationFormatUtilsTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-lang/xref-test/org/apache/commons/lang3/time/DurationFormatUtilsTest.html
(original)
+++ websites/production/commons/content/proper/commons-lang/xref-test/org/apache/commons/lang3/time/DurationFormatUtilsTest.html
Fri May  1 20:55:51 2015
@@ -244,11 +244,11 @@
 <a class="jxr_linenumber" name="L236" href="#L236">236</a>         assertEquals(<span
class="jxr_string">"01:00"</span>, DurationFormatUtils.formatDuration(duration, <span
class="jxr_string">"mm:ss"</span>));
 <a class="jxr_linenumber" name="L237" href="#L237">237</a> 
 <a class="jxr_linenumber" name="L238" href="#L238">238</a>         <strong
class="jxr_keyword">final</strong> Calendar base = Calendar.getInstance();
-<a class="jxr_linenumber" name="L239" href="#L239">239</a>         base.set(2000,
0, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L239" href="#L239">239</a>         base.set(2000,
Calendar.JANUARY, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L240" href="#L240">240</a>         base.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L241" href="#L241">241</a> 
 <a class="jxr_linenumber" name="L242" href="#L242">242</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance();
-<a class="jxr_linenumber" name="L243" href="#L243">243</a>         cal.set(2003,
1, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L243" href="#L243">243</a>         cal.set(2003,
Calendar.FEBRUARY, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L244" href="#L244">244</a>         cal.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L245" href="#L245">245</a>         duration =
cal.getTime().getTime() - base.getTime().getTime(); <em class="jxr_comment">// duration
from 2000-01-01 to cal</em>
 <a class="jxr_linenumber" name="L246" href="#L246">246</a>         <em class="jxr_comment">//
don't use 1970 in test as time zones were less reliable in 1970 than now</em>
@@ -266,22 +266,22 @@
 <a class="jxr_linenumber" name="L258" href="#L258">258</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testFormatPeriodISO() {
 <a class="jxr_linenumber" name="L259" href="#L259">259</a>         <strong
class="jxr_keyword">final</strong> TimeZone timeZone = TimeZone.getTimeZone(<span
class="jxr_string">"GMT-3"</span>);
 <a class="jxr_linenumber" name="L260" href="#L260">260</a>         <strong
class="jxr_keyword">final</strong> Calendar base = Calendar.getInstance(timeZone);
-<a class="jxr_linenumber" name="L261" href="#L261">261</a>         base.set(1970,
0, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L261" href="#L261">261</a>         base.set(1970,
Calendar.JANUARY, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L262" href="#L262">262</a>         base.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L263" href="#L263">263</a> 
 <a class="jxr_linenumber" name="L264" href="#L264">264</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance(timeZone);
-<a class="jxr_linenumber" name="L265" href="#L265">265</a>         cal.set(2002,
1, 23, 9, 11, 12);
+<a class="jxr_linenumber" name="L265" href="#L265">265</a>         cal.set(2002,
Calendar.FEBRUARY, 23, 9, 11, 12);
 <a class="jxr_linenumber" name="L266" href="#L266">266</a>         cal.set(Calendar.MILLISECOND,
1);
 <a class="jxr_linenumber" name="L267" href="#L267">267</a>         String text;
 <a class="jxr_linenumber" name="L268" href="#L268">268</a>         <em class="jxr_comment">//
repeat a test from testDateTimeISO to compare extended and not extended.</em>
-<a class="jxr_linenumber" name="L269" href="#L269">269</a>         text = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(cal);
+<a class="jxr_linenumber" name="L269" href="#L269">269</a>         text = DateFormatUtils.format(cal,
DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern(), timeZone);
 <a class="jxr_linenumber" name="L270" href="#L270">270</a>         assertEquals(<span
class="jxr_string">"2002-02-23T09:11:12-03:00"</span>, text);
 <a class="jxr_linenumber" name="L271" href="#L271">271</a>         <em class="jxr_comment">//
test fixture is the same as above, but now with extended format.</em>
 <a class="jxr_linenumber" name="L272" href="#L272">272</a>         text = DurationFormatUtils.formatPeriod(base.getTime().getTime(),
cal.getTime().getTime(),
 <a class="jxr_linenumber" name="L273" href="#L273">273</a>                 DurationFormatUtils.ISO_EXTENDED_FORMAT_PATTERN,
false, timeZone);
 <a class="jxr_linenumber" name="L274" href="#L274">274</a>         assertEquals(<span
class="jxr_string">"P32Y1M22DT9H11M12.001S"</span>, text);
 <a class="jxr_linenumber" name="L275" href="#L275">275</a>         <em class="jxr_comment">//
test fixture from example in http://www.w3.org/TR/xmlschema-2/#duration</em>
-<a class="jxr_linenumber" name="L276" href="#L276">276</a>         cal.set(1971,
1, 3, 10, 30, 0);
+<a class="jxr_linenumber" name="L276" href="#L276">276</a>         cal.set(1971,
Calendar.FEBRUARY, 3, 10, 30, 0);
 <a class="jxr_linenumber" name="L277" href="#L277">277</a>         cal.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L278" href="#L278">278</a>         text = DurationFormatUtils.formatPeriod(base.getTime().getTime(),
cal.getTime().getTime(),
 <a class="jxr_linenumber" name="L279" href="#L279">279</a>                 DurationFormatUtils.ISO_EXTENDED_FORMAT_PATTERN,
false, timeZone);
@@ -305,7 +305,7 @@
 <a class="jxr_linenumber" name="L297" href="#L297">297</a>     @Test
 <a class="jxr_linenumber" name="L298" href="#L298">298</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testFormatPeriod() {
 <a class="jxr_linenumber" name="L299" href="#L299">299</a>         <strong
class="jxr_keyword">final</strong> Calendar cal1970 = Calendar.getInstance();
-<a class="jxr_linenumber" name="L300" href="#L300">300</a>         cal1970.set(1970,
0, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L300" href="#L300">300</a>         cal1970.set(1970,
Calendar.JANUARY, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L301" href="#L301">301</a>         cal1970.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L302" href="#L302">302</a>         <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>
time1970 = cal1970.getTime().getTime();
 <a class="jxr_linenumber" name="L303" href="#L303">303</a> 
@@ -331,21 +331,21 @@
 <a class="jxr_linenumber" name="L323" href="#L323">323</a>         assertEquals(<span
class="jxr_string">"01:00"</span>, DurationFormatUtils.formatPeriod(time1970, time,
<span class="jxr_string">"mm:ss"</span>));
 <a class="jxr_linenumber" name="L324" href="#L324">324</a> 
 <a class="jxr_linenumber" name="L325" href="#L325">325</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance();
-<a class="jxr_linenumber" name="L326" href="#L326">326</a>         cal.set(1973,
6, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L326" href="#L326">326</a>         cal.set(1973,
Calendar.JULY, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L327" href="#L327">327</a>         cal.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L328" href="#L328">328</a>         time = cal.getTime().getTime();
 <a class="jxr_linenumber" name="L329" href="#L329">329</a>         assertEquals(<span
class="jxr_string">"36"</span>, DurationFormatUtils.formatPeriod(time1970, time,
<span class="jxr_string">"yM"</span>));
 <a class="jxr_linenumber" name="L330" href="#L330">330</a>         assertEquals(<span
class="jxr_string">"3 years 6 months"</span>, DurationFormatUtils.formatPeriod(time1970,
time, <span class="jxr_string">"y' years 'M' months'"</span>));
 <a class="jxr_linenumber" name="L331" href="#L331">331</a>         assertEquals(<span
class="jxr_string">"03/06"</span>, DurationFormatUtils.formatPeriod(time1970, time,
<span class="jxr_string">"yy/MM"</span>));
 <a class="jxr_linenumber" name="L332" href="#L332">332</a> 
-<a class="jxr_linenumber" name="L333" href="#L333">333</a>         cal.set(1973,
10, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L333" href="#L333">333</a>         cal.set(1973,
Calendar.NOVEMBER, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L334" href="#L334">334</a>         cal.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L335" href="#L335">335</a>         time = cal.getTime().getTime();
 <a class="jxr_linenumber" name="L336" href="#L336">336</a>         assertEquals(<span
class="jxr_string">"310"</span>, DurationFormatUtils.formatPeriod(time1970, time,
<span class="jxr_string">"yM"</span>));
 <a class="jxr_linenumber" name="L337" href="#L337">337</a>         assertEquals(<span
class="jxr_string">"3 years 10 months"</span>, DurationFormatUtils.formatPeriod(time1970,
time, <span class="jxr_string">"y' years 'M' months'"</span>));
 <a class="jxr_linenumber" name="L338" href="#L338">338</a>         assertEquals(<span
class="jxr_string">"03/10"</span>, DurationFormatUtils.formatPeriod(time1970, time,
<span class="jxr_string">"yy/MM"</span>));
 <a class="jxr_linenumber" name="L339" href="#L339">339</a> 
-<a class="jxr_linenumber" name="L340" href="#L340">340</a>         cal.set(1974,
0, 1, 0, 0, 0);
+<a class="jxr_linenumber" name="L340" href="#L340">340</a>         cal.set(1974,
Calendar.JANUARY, 1, 0, 0, 0);
 <a class="jxr_linenumber" name="L341" href="#L341">341</a>         cal.set(Calendar.MILLISECOND,
0);
 <a class="jxr_linenumber" name="L342" href="#L342">342</a>         time = cal.getTime().getTime();
 <a class="jxr_linenumber" name="L343" href="#L343">343</a>         assertEquals(<span
class="jxr_string">"40"</span>, DurationFormatUtils.formatPeriod(time1970, time,
<span class="jxr_string">"yM"</span>));
@@ -431,10 +431,10 @@
 <a class="jxr_linenumber" name="L423" href="#L423">423</a>     @Test
 <a class="jxr_linenumber" name="L424" href="#L424">424</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testLANG815() {
 <a class="jxr_linenumber" name="L425" href="#L425">425</a>         <strong
class="jxr_keyword">final</strong> Calendar calendar = Calendar.getInstance();
-<a class="jxr_linenumber" name="L426" href="#L426">426</a>         calendar.set(2012,
6, 30, 0, 0, 0);
+<a class="jxr_linenumber" name="L426" href="#L426">426</a>         calendar.set(2012,
Calendar.JULY, 30, 0, 0, 0);
 <a class="jxr_linenumber" name="L427" href="#L427">427</a>         <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>
startMillis = calendar.getTimeInMillis();
 <a class="jxr_linenumber" name="L428" href="#L428">428</a> 
-<a class="jxr_linenumber" name="L429" href="#L429">429</a>         calendar.set(2012,
8, 8);
+<a class="jxr_linenumber" name="L429" href="#L429">429</a>         calendar.set(2012,
Calendar.SEPTEMBER, 8);
 <a class="jxr_linenumber" name="L430" href="#L430">430</a>         <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>
endMillis = calendar.getTimeInMillis();
 <a class="jxr_linenumber" name="L431" href="#L431">431</a> 
 <a class="jxr_linenumber" name="L432" href="#L432">432</a>         assertEquals(<span
class="jxr_string">"1 9"</span>, DurationFormatUtils.formatPeriod(startMillis, endMillis,
<span class="jxr_string">"M d"</span>));

Modified: websites/production/commons/content/proper/commons-lang/xref-test/org/apache/commons/lang3/time/FastDateParserTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-lang/xref-test/org/apache/commons/lang3/time/FastDateParserTest.html
(original)
+++ websites/production/commons/content/proper/commons-lang/xref-test/org/apache/commons/lang3/time/FastDateParserTest.html
Fri May  1 20:55:51 2015
@@ -125,7 +125,7 @@
 <a class="jxr_linenumber" name="L117" href="#L117">117</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testParseZone() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L118" href="#L118">118</a>         <strong
class="jxr_keyword">final</strong> Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L119" href="#L119">119</a>         cal.clear();
-<a class="jxr_linenumber" name="L120" href="#L120">120</a>         cal.set(2003,
6, 10, 16, 33, 20);
+<a class="jxr_linenumber" name="L120" href="#L120">120</a>         cal.set(2003,
Calendar.JULY, 10, 16, 33, 20);
 <a class="jxr_linenumber" name="L121" href="#L121">121</a> 
 <a class="jxr_linenumber" name="L122" href="#L122">122</a>         <strong
class="jxr_keyword">final</strong> DateParser fdf = getInstance(yMdHmsSZ, NEW_YORK,
Locale.US);
 <a class="jxr_linenumber" name="L123" href="#L123">123</a> 
@@ -135,12 +135,12 @@
 <a class="jxr_linenumber" name="L127" href="#L127">127</a>         assertEquals(cal.getTime(),
fdf.parse(<span class="jxr_string">"2003-07-10T16:33:20.000 EDT"</span>));
 <a class="jxr_linenumber" name="L128" href="#L128">128</a> 
 <a class="jxr_linenumber" name="L129" href="#L129">129</a>         cal.setTimeZone(TimeZone.getTimeZone(<span
class="jxr_string">"GMT-3"</span>));
-<a class="jxr_linenumber" name="L130" href="#L130">130</a>         cal.set(2003,
1, 10, 9, 0, 0);
+<a class="jxr_linenumber" name="L130" href="#L130">130</a>         cal.set(2003,
Calendar.FEBRUARY, 10, 9, 0, 0);
 <a class="jxr_linenumber" name="L131" href="#L131">131</a> 
 <a class="jxr_linenumber" name="L132" href="#L132">132</a>         assertEquals(cal.getTime(),
fdf.parse(<span class="jxr_string">"2003-02-10T09:00:00.000 -0300"</span>));
 <a class="jxr_linenumber" name="L133" href="#L133">133</a> 
 <a class="jxr_linenumber" name="L134" href="#L134">134</a>         cal.setTimeZone(TimeZone.getTimeZone(<span
class="jxr_string">"GMT+5"</span>));
-<a class="jxr_linenumber" name="L135" href="#L135">135</a>         cal.set(2003,
1, 10, 15, 5, 6);
+<a class="jxr_linenumber" name="L135" href="#L135">135</a>         cal.set(2003,
Calendar.FEBRUARY, 10, 15, 5, 6);
 <a class="jxr_linenumber" name="L136" href="#L136">136</a> 
 <a class="jxr_linenumber" name="L137" href="#L137">137</a>         assertEquals(cal.getTime(),
fdf.parse(<span class="jxr_string">"2003-02-10T15:05:06.000 +0500"</span>));
 <a class="jxr_linenumber" name="L138" href="#L138">138</a>     }
@@ -149,7 +149,7 @@
 <a class="jxr_linenumber" name="L141" href="#L141">141</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testParseLongShort() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L142" href="#L142">142</a>         <strong
class="jxr_keyword">final</strong> Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L143" href="#L143">143</a>         cal.clear();
-<a class="jxr_linenumber" name="L144" href="#L144">144</a>         cal.set(2003,
1, 10, 15, 33, 20);
+<a class="jxr_linenumber" name="L144" href="#L144">144</a>         cal.set(2003,
Calendar.FEBRUARY, 10, 15, 33, 20);
 <a class="jxr_linenumber" name="L145" href="#L145">145</a>         cal.set(Calendar.MILLISECOND,
989);
 <a class="jxr_linenumber" name="L146" href="#L146">146</a>         cal.setTimeZone(NEW_YORK);
 <a class="jxr_linenumber" name="L147" href="#L147">147</a> 
@@ -178,25 +178,25 @@
 <a class="jxr_linenumber" name="L170" href="#L170">170</a>         <strong
class="jxr_keyword">final</strong> DateParser k = getInstance(<span class="jxr_string">"yyyy-MM-dd
kk:mm:ss"</span>, NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L171" href="#L171">171</a>         <strong
class="jxr_keyword">final</strong> DateParser H = getInstance(<span class="jxr_string">"yyyy-MM-dd
HH:mm:ss"</span>, NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L172" href="#L172">172</a> 
-<a class="jxr_linenumber" name="L173" href="#L173">173</a>         cal.set(2010,
7, 1, 0, 33, 20);
+<a class="jxr_linenumber" name="L173" href="#L173">173</a>         cal.set(2010,
Calendar.AUGUST, 1, 0, 33, 20);
 <a class="jxr_linenumber" name="L174" href="#L174">174</a>         assertEquals(cal.getTime(),
h.parse(<span class="jxr_string">"2010-08-01 12 AM 33:20"</span>));
 <a class="jxr_linenumber" name="L175" href="#L175">175</a>         assertEquals(cal.getTime(),
K.parse(<span class="jxr_string">"2010-08-01 0 AM 33:20"</span>));
 <a class="jxr_linenumber" name="L176" href="#L176">176</a>         assertEquals(cal.getTime(),
k.parse(<span class="jxr_string">"2010-08-01 00:33:20"</span>));
 <a class="jxr_linenumber" name="L177" href="#L177">177</a>         assertEquals(cal.getTime(),
H.parse(<span class="jxr_string">"2010-08-01 00:33:20"</span>));
 <a class="jxr_linenumber" name="L178" href="#L178">178</a> 
-<a class="jxr_linenumber" name="L179" href="#L179">179</a>         cal.set(2010,
7, 1, 3, 33, 20);
+<a class="jxr_linenumber" name="L179" href="#L179">179</a>         cal.set(2010,
Calendar.AUGUST, 1, 3, 33, 20);
 <a class="jxr_linenumber" name="L180" href="#L180">180</a>         assertEquals(cal.getTime(),
h.parse(<span class="jxr_string">"2010-08-01 3 AM 33:20"</span>));
 <a class="jxr_linenumber" name="L181" href="#L181">181</a>         assertEquals(cal.getTime(),
K.parse(<span class="jxr_string">"2010-08-01 3 AM 33:20"</span>));
 <a class="jxr_linenumber" name="L182" href="#L182">182</a>         assertEquals(cal.getTime(),
k.parse(<span class="jxr_string">"2010-08-01 03:33:20"</span>));
 <a class="jxr_linenumber" name="L183" href="#L183">183</a>         assertEquals(cal.getTime(),
H.parse(<span class="jxr_string">"2010-08-01 03:33:20"</span>));
 <a class="jxr_linenumber" name="L184" href="#L184">184</a> 
-<a class="jxr_linenumber" name="L185" href="#L185">185</a>         cal.set(2010,
7, 1, 15, 33, 20);
+<a class="jxr_linenumber" name="L185" href="#L185">185</a>         cal.set(2010,
Calendar.AUGUST, 1, 15, 33, 20);
 <a class="jxr_linenumber" name="L186" href="#L186">186</a>         assertEquals(cal.getTime(),
h.parse(<span class="jxr_string">"2010-08-01 3 PM 33:20"</span>));
 <a class="jxr_linenumber" name="L187" href="#L187">187</a>         assertEquals(cal.getTime(),
K.parse(<span class="jxr_string">"2010-08-01 3 PM 33:20"</span>));
 <a class="jxr_linenumber" name="L188" href="#L188">188</a>         assertEquals(cal.getTime(),
k.parse(<span class="jxr_string">"2010-08-01 15:33:20"</span>));
 <a class="jxr_linenumber" name="L189" href="#L189">189</a>         assertEquals(cal.getTime(),
H.parse(<span class="jxr_string">"2010-08-01 15:33:20"</span>));
 <a class="jxr_linenumber" name="L190" href="#L190">190</a> 
-<a class="jxr_linenumber" name="L191" href="#L191">191</a>         cal.set(2010,
7, 1, 12, 33, 20);
+<a class="jxr_linenumber" name="L191" href="#L191">191</a>         cal.set(2010,
Calendar.AUGUST, 1, 12, 33, 20);
 <a class="jxr_linenumber" name="L192" href="#L192">192</a>         assertEquals(cal.getTime(),
h.parse(<span class="jxr_string">"2010-08-01 12 PM 33:20"</span>));
 <a class="jxr_linenumber" name="L193" href="#L193">193</a>         assertEquals(cal.getTime(),
K.parse(<span class="jxr_string">"2010-08-01 0 PM 33:20"</span>));
 <a class="jxr_linenumber" name="L194" href="#L194">194</a>         assertEquals(cal.getTime(),
k.parse(<span class="jxr_string">"2010-08-01 12:33:20"</span>));
@@ -330,7 +330,7 @@
 <a class="jxr_linenumber" name="L322" href="#L322">322</a> 
 <a class="jxr_linenumber" name="L323" href="#L323">323</a>         <strong
class="jxr_keyword">final</strong> Calendar cal= Calendar.getInstance(GMT);
 <a class="jxr_linenumber" name="L324" href="#L324">324</a>         cal.clear();
-<a class="jxr_linenumber" name="L325" href="#L325">325</a>         cal.set(2003,
1, 10);
+<a class="jxr_linenumber" name="L325" href="#L325">325</a>         cal.set(2003,
Calendar.FEBRUARY, 10);
 <a class="jxr_linenumber" name="L326" href="#L326">326</a>         <strong
class="jxr_keyword">if</strong> (eraBC) {
 <a class="jxr_linenumber" name="L327" href="#L327">327</a>             cal.set(Calendar.ERA,
GregorianCalendar.BC);
 <a class="jxr_linenumber" name="L328" href="#L328">328</a>         }
@@ -378,7 +378,7 @@
 <a class="jxr_linenumber" name="L370" href="#L370">370</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testParseNumerics() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L371" href="#L371">371</a>         <strong
class="jxr_keyword">final</strong> Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L372" href="#L372">372</a>         cal.clear();
-<a class="jxr_linenumber" name="L373" href="#L373">373</a>         cal.set(2003,
1, 10, 15, 33, 20);
+<a class="jxr_linenumber" name="L373" href="#L373">373</a>         cal.set(2003,
Calendar.FEBRUARY, 10, 15, 33, 20);
 <a class="jxr_linenumber" name="L374" href="#L374">374</a>         cal.set(Calendar.MILLISECOND,
989);
 <a class="jxr_linenumber" name="L375" href="#L375">375</a> 
 <a class="jxr_linenumber" name="L376" href="#L376">376</a>         <strong
class="jxr_keyword">final</strong> DateParser fdf = getInstance(<span class="jxr_string">"yyyyMMddHHmmssSSS"</span>,
NEW_YORK, Locale.US);
@@ -389,7 +389,7 @@
 <a class="jxr_linenumber" name="L381" href="#L381">381</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testQuotes() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L382" href="#L382">382</a>         <strong
class="jxr_keyword">final</strong> Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L383" href="#L383">383</a>         cal.clear();
-<a class="jxr_linenumber" name="L384" href="#L384">384</a>         cal.set(2003,
1, 10, 15, 33, 20);
+<a class="jxr_linenumber" name="L384" href="#L384">384</a>         cal.set(2003,
Calendar.FEBRUARY, 10, 15, 33, 20);
 <a class="jxr_linenumber" name="L385" href="#L385">385</a>         cal.set(Calendar.MILLISECOND,
989);
 <a class="jxr_linenumber" name="L386" href="#L386">386</a> 
 <a class="jxr_linenumber" name="L387" href="#L387">387</a>         <strong
class="jxr_keyword">final</strong> DateParser fdf = getInstance(<span class="jxr_string">"''yyyyMMdd'A''B'HHmmssSSS''"</span>,
NEW_YORK, Locale.US);
@@ -467,7 +467,7 @@
 <a class="jxr_linenumber" name="L459" href="#L459">459</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testDayOf() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L460" href="#L460">460</a>         <strong
class="jxr_keyword">final</strong> Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L461" href="#L461">461</a>         cal.clear();
-<a class="jxr_linenumber" name="L462" href="#L462">462</a>         cal.set(2003,
1, 10);
+<a class="jxr_linenumber" name="L462" href="#L462">462</a>         cal.set(2003,
Calendar.FEBRUARY, 10);
 <a class="jxr_linenumber" name="L463" href="#L463">463</a> 
 <a class="jxr_linenumber" name="L464" href="#L464">464</a>         <strong
class="jxr_keyword">final</strong> DateParser fdf = getInstance(<span class="jxr_string">"W
w F D y"</span>, NEW_YORK, Locale.US);
 <a class="jxr_linenumber" name="L465" href="#L465">465</a>         assertEquals(cal.getTime(),
fdf.parse(<span class="jxr_string">"3 7 2 41 03"</span>));
@@ -483,7 +483,7 @@
 <a class="jxr_linenumber" name="L475" href="#L475">475</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance();
 <a class="jxr_linenumber" name="L476" href="#L476">476</a>         cal.clear();
 <a class="jxr_linenumber" name="L477" href="#L477">477</a> 
-<a class="jxr_linenumber" name="L478" href="#L478">478</a>         cal.set(2004,
1, 3);
+<a class="jxr_linenumber" name="L478" href="#L478">478</a>         cal.set(2004,
Calendar.FEBRUARY, 3);
 <a class="jxr_linenumber" name="L479" href="#L479">479</a>         assertEquals(cal.getTime(),
fdf.parse(<span class="jxr_string">"2/3/04"</span>));
 <a class="jxr_linenumber" name="L480" href="#L480">480</a> 
 <a class="jxr_linenumber" name="L481" href="#L481">481</a>         fdf = getDateInstance(FastDateFormat.SHORT,
SWEDEN);
@@ -500,13 +500,13 @@
 <a class="jxr_linenumber" name="L492" href="#L492">492</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance();
 <a class="jxr_linenumber" name="L493" href="#L493">493</a>         cal.clear();
 <a class="jxr_linenumber" name="L494" href="#L494">494</a> 
-<a class="jxr_linenumber" name="L495" href="#L495">495</a>         cal.set(1,0,1);
+<a class="jxr_linenumber" name="L495" href="#L495">495</a>         cal.set(1,
Calendar.JANUARY, 1);
 <a class="jxr_linenumber" name="L496" href="#L496">496</a>         assertEquals(cal.getTime(),
parser.parse(<span class="jxr_string">"0001/01/01"</span>));
-<a class="jxr_linenumber" name="L497" href="#L497">497</a>         cal.set(10,0,1);
+<a class="jxr_linenumber" name="L497" href="#L497">497</a>         cal.set(10,
Calendar.JANUARY, 1);
 <a class="jxr_linenumber" name="L498" href="#L498">498</a>         assertEquals(cal.getTime(),
parser.parse(<span class="jxr_string">"0010/01/01"</span>));
-<a class="jxr_linenumber" name="L499" href="#L499">499</a>         cal.set(100,0,1);
+<a class="jxr_linenumber" name="L499" href="#L499">499</a>         cal.set(100,
Calendar.JANUARY, 1);
 <a class="jxr_linenumber" name="L500" href="#L500">500</a>         assertEquals(cal.getTime(),
parser.parse(<span class="jxr_string">"0100/01/01"</span>));
-<a class="jxr_linenumber" name="L501" href="#L501">501</a>         cal.set(999,0,1);
+<a class="jxr_linenumber" name="L501" href="#L501">501</a>         cal.set(999,
Calendar.JANUARY, 1);
 <a class="jxr_linenumber" name="L502" href="#L502">502</a>         assertEquals(cal.getTime(),
parser.parse(<span class="jxr_string">"0999/01/01"</span>));
 <a class="jxr_linenumber" name="L503" href="#L503">503</a>     }
 <a class="jxr_linenumber" name="L504" href="#L504">504</a> 
@@ -516,7 +516,7 @@
 <a class="jxr_linenumber" name="L508" href="#L508">508</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance();
 <a class="jxr_linenumber" name="L509" href="#L509">509</a>         cal.clear();
 <a class="jxr_linenumber" name="L510" href="#L510">510</a> 
-<a class="jxr_linenumber" name="L511" href="#L511">511</a>         cal.set(1000,0,1);
+<a class="jxr_linenumber" name="L511" href="#L511">511</a>         cal.set(1000,
Calendar.JANUARY, 1);
 <a class="jxr_linenumber" name="L512" href="#L512">512</a>         assertEquals(cal.getTime(),
parser.parse(<span class="jxr_string">"01.01.1000"</span>));
 <a class="jxr_linenumber" name="L513" href="#L513">513</a>     }
 <a class="jxr_linenumber" name="L514" href="#L514">514</a> 
@@ -524,7 +524,7 @@
 <a class="jxr_linenumber" name="L516" href="#L516">516</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testLang303() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L517" href="#L517">517</a>         DateParser
parser = getInstance(YMD_SLASH);
 <a class="jxr_linenumber" name="L518" href="#L518">518</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance();
-<a class="jxr_linenumber" name="L519" href="#L519">519</a>         cal.set(2004,
11, 31);
+<a class="jxr_linenumber" name="L519" href="#L519">519</a>         cal.set(2004,
Calendar.DECEMBER, 31);
 <a class="jxr_linenumber" name="L520" href="#L520">520</a> 
 <a class="jxr_linenumber" name="L521" href="#L521">521</a>         <strong
class="jxr_keyword">final</strong> Date date = parser.parse(<span class="jxr_string">"2004/11/31"</span>);
 <a class="jxr_linenumber" name="L522" href="#L522">522</a> 
@@ -538,7 +538,7 @@
 <a class="jxr_linenumber" name="L530" href="#L530">530</a> 
 <a class="jxr_linenumber" name="L531" href="#L531">531</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(<span
class="jxr_string">"GMT-8"</span>));
 <a class="jxr_linenumber" name="L532" href="#L532">532</a>         cal.clear();
-<a class="jxr_linenumber" name="L533" href="#L533">533</a>         cal.set(2009,
9, 16, 8, 42, 16);
+<a class="jxr_linenumber" name="L533" href="#L533">533</a>         cal.set(2009,
Calendar.OCTOBER, 16, 8, 42, 16);
 <a class="jxr_linenumber" name="L534" href="#L534">534</a> 
 <a class="jxr_linenumber" name="L535" href="#L535">535</a>         assertEquals(cal.getTime(),
parser.parse(<span class="jxr_string">"2009-10-16T16:42:16.000Z"</span>));
 <a class="jxr_linenumber" name="L536" href="#L536">536</a>     }
@@ -582,7 +582,7 @@
 <a class="jxr_linenumber" name="L574" href="#L574">574</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testLang996() <strong class="jxr_keyword">throws</strong>
ParseException {
 <a class="jxr_linenumber" name="L575" href="#L575">575</a>         <strong
class="jxr_keyword">final</strong> Calendar expected = Calendar.getInstance(NEW_YORK,
Locale.US);
 <a class="jxr_linenumber" name="L576" href="#L576">576</a>         expected.clear();
-<a class="jxr_linenumber" name="L577" href="#L577">577</a>         expected.set(2014,
4, 14);
+<a class="jxr_linenumber" name="L577" href="#L577">577</a>         expected.set(2014,
Calendar.MAY, 14);
 <a class="jxr_linenumber" name="L578" href="#L578">578</a> 
 <a class="jxr_linenumber" name="L579" href="#L579">579</a>         <strong
class="jxr_keyword">final</strong> DateParser fdp = getInstance(<span class="jxr_string">"ddMMMyyyy"</span>,
NEW_YORK, Locale.US);        
 <a class="jxr_linenumber" name="L580" href="#L580">580</a>         assertEquals(expected.getTime(),
fdp.parse(<span class="jxr_string">"14may2014"</span>));
@@ -647,7 +647,35 @@
 <a class="jxr_linenumber" name="L639" href="#L639">639</a>             assertEquals(message+trial.three,
cal.getTime(), parser.parse(dateStub+trial.three));
 <a class="jxr_linenumber" name="L640" href="#L640">640</a>         }
 <a class="jxr_linenumber" name="L641" href="#L641">641</a>     }
-<a class="jxr_linenumber" name="L642" href="#L642">642</a> }
+<a class="jxr_linenumber" name="L642" href="#L642">642</a> 
+<a class="jxr_linenumber" name="L643" href="#L643">643</a>     @Test
+<a class="jxr_linenumber" name="L644" href="#L644">644</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testLang1121() <strong class="jxr_keyword">throws</strong>
ParseException {
+<a class="jxr_linenumber" name="L645" href="#L645">645</a>         TimeZone kst
= TimeZone.getTimeZone(<span class="jxr_string">"KST"</span>);
+<a class="jxr_linenumber" name="L646" href="#L646">646</a>         <strong
class="jxr_keyword">final</strong> DateParser fdp = FastDateFormat.getInstance(<span
class="jxr_string">"yyyyMMdd"</span>, kst, Locale.KOREA);
+<a class="jxr_linenumber" name="L647" href="#L647">647</a> 
+<a class="jxr_linenumber" name="L648" href="#L648">648</a>         <strong
class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="L649" href="#L649">649</a>             fdp.parse(<span
class="jxr_string">"2015"</span>);
+<a class="jxr_linenumber" name="L650" href="#L650">650</a>             Assert.fail(<span
class="jxr_string">"expected parse exception"</span>);
+<a class="jxr_linenumber" name="L651" href="#L651">651</a>         } <strong
class="jxr_keyword">catch</strong> (ParseException pe) {
+<a class="jxr_linenumber" name="L652" href="#L652">652</a>         }
+<a class="jxr_linenumber" name="L653" href="#L653">653</a> 
+<a class="jxr_linenumber" name="L654" href="#L654">654</a>         <em class="jxr_comment">//
Wed Apr 29 00:00:00 KST 2015</em>
+<a class="jxr_linenumber" name="L655" href="#L655">655</a>         Date actual
= fdp.parse(<span class="jxr_string">"20150429"</span>);
+<a class="jxr_linenumber" name="L656" href="#L656">656</a>         <strong
class="jxr_keyword">final</strong> Calendar cal = Calendar.getInstance(kst, Locale.KOREA);
+<a class="jxr_linenumber" name="L657" href="#L657">657</a>         cal.clear();
+<a class="jxr_linenumber" name="L658" href="#L658">658</a>         cal.set(2015,
3, 29);
+<a class="jxr_linenumber" name="L659" href="#L659">659</a>         Date expected
= cal.getTime();
+<a class="jxr_linenumber" name="L660" href="#L660">660</a>         Assert.assertEquals(expected,
actual);
+<a class="jxr_linenumber" name="L661" href="#L661">661</a> 
+<a class="jxr_linenumber" name="L662" href="#L662">662</a>         SimpleDateFormat
df = <strong class="jxr_keyword">new</strong> SimpleDateFormat(<span class="jxr_string">"yyyyMMdd"</span>,
Locale.KOREA);
+<a class="jxr_linenumber" name="L663" href="#L663">663</a>         df.setTimeZone(kst);
+<a class="jxr_linenumber" name="L664" href="#L664">664</a>         expected =
df.parse(<span class="jxr_string">"20150429113100"</span>);
+<a class="jxr_linenumber" name="L665" href="#L665">665</a> 
+<a class="jxr_linenumber" name="L666" href="#L666">666</a>         <em class="jxr_comment">//
Thu Mar 16 00:00:00 KST 81724</em>
+<a class="jxr_linenumber" name="L667" href="#L667">667</a>         actual = fdp.parse(<span
class="jxr_string">"20150429113100"</span>);
+<a class="jxr_linenumber" name="L668" href="#L668">668</a>         Assert.assertEquals(expected,
actual);
+<a class="jxr_linenumber" name="L669" href="#L669">669</a>     }
+<a class="jxr_linenumber" name="L670" href="#L670">670</a> }
 </pre>
 <hr/>
 <div id="footer">Copyright &#169; 2001&#x2013;2015 <a href="http://www.apache.org/">The
Apache Software Foundation</a>. All rights reserved.</div>



Mime
View raw message