Line 0
Link Here
|
|
|
1 |
/* |
2 |
* Licensed to the Apache Software Foundation (ASF) under one or more |
3 |
* contributor license agreements. See the NOTICE file distributed with |
4 |
* this work for additional information regarding copyright ownership. |
5 |
* The ASF licenses this file to You under the Apache License, Version 2.0 |
6 |
* (the "License"); you may not use this file except in compliance with |
7 |
* the License. You may obtain a copy of the License at |
8 |
* |
9 |
* http://www.apache.org/licenses/LICENSE-2.0 |
10 |
* |
11 |
* Unless required by applicable law or agreed to in writing, software |
12 |
* distributed under the License is distributed on an "AS IS" BASIS, |
13 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 |
* See the License for the specific language governing permissions and |
15 |
* limitations under the License. |
16 |
*/ |
17 |
|
18 |
// |
19 |
// Log4j uses the JUnit framework for internal unit testing. JUnit |
20 |
// available from |
21 |
// |
22 |
// http://www.junit.org |
23 |
|
24 |
|
25 |
package org.apache.log4j.helpers; |
26 |
|
27 |
import java.util.Date; |
28 |
import java.util.TimeZone; |
29 |
|
30 |
import junit.framework.TestCase; |
31 |
|
32 |
public class AbsoluteTimeDateFormatTest extends TestCase { |
33 |
|
34 |
public void testDateFormatingUsingDifferentTimeZone() { |
35 |
AbsoluteTimeDateFormat f1 = new AbsoluteTimeDateFormat(); |
36 |
AbsoluteTimeDateFormat f2 = new AbsoluteTimeDateFormat(); |
37 |
f1.setTimeZone(TimeZone.getTimeZone("GMT")); |
38 |
f2.setTimeZone(TimeZone.getTimeZone("GMT+1:00")); |
39 |
Date date = new Date(900000); |
40 |
|
41 |
StringBuffer sbuf = new StringBuffer(); |
42 |
f1.format(date, sbuf, null); |
43 |
assertEquals("00:15:00,000", sbuf.toString()); |
44 |
|
45 |
sbuf = new StringBuffer(); |
46 |
f2.format(date, sbuf, null); |
47 |
assertEquals("01:15:00,000", sbuf.toString()); |
48 |
|
49 |
} |
50 |
} |
0 |
+ Author Date Id Revision |
51 |
+ Author Date Id Revision |
1 |
+ native |
52 |
+ native |