View Javadoc

1   /**
2    * Copyright 2012 The Kuali Foundation
3    *
4    * Licensed under the the Educational Community License, Version 1.0
5    * (the "License"); you may not use this file except in compliance
6    * with the License.  You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.common.test.util;
17  
18  import java.sql.Timestamp;
19  import java.util.Date;
20  
21  import org.junit.Assert;
22  
23  /**
24   * @author ocleirig
25   *
26   */
27  public class TimeTester {
28  
29  	/**
30  	 * 
31  	 */
32  	public TimeTester() {
33  	}
34  	
35  	public void check (Date expected, Date actual) {
36  		if (expected == null && actual == null) {
37                      return;
38                  }
39  		Assert.assertNotNull(expected);
40  		Assert.assertNotNull(actual);
41  		
42  		Timestamp ts1 = new Timestamp (expected.getTime());
43  		Timestamp ts2 = new Timestamp (actual.getTime());
44  		
45  		Assert.assertEquals(ts1, ts2);
46  		
47  		
48  	}
49  
50  }