+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.unit;\r
-\r
-import static junit.framework.Assert.assertEquals;\r
-import static junit.framework.Assert.assertNotNull;\r
-import static junit.framework.Assert.assertNull;\r
-\r
-import java.util.Calendar;\r
-import java.util.Date;\r
-import java.util.GregorianCalendar;\r
-\r
-public abstract class UnitUtils {\r
- public static void assertDateSec(Date expected, Date reached) {\r
- if (expected == null) {\r
- assertNull(reached);\r
- return;\r
- } else {\r
- assertNotNull(reached);\r
- }\r
-\r
- Calendar expectedCal = new GregorianCalendar();\r
- expectedCal.setTime(expected);\r
- Calendar reachedCal = new GregorianCalendar();\r
- reachedCal.setTime(reached);\r
- assertEquals(expectedCal.get(Calendar.YEAR), reachedCal\r
- .get(Calendar.YEAR));\r
- assertEquals(expectedCal.get(Calendar.MONTH), reachedCal\r
- .get(Calendar.MONTH));\r
- assertEquals(expectedCal.get(Calendar.DATE), reachedCal\r
- .get(Calendar.DATE));\r
- assertEquals(expectedCal.get(Calendar.HOUR_OF_DAY), reachedCal\r
- .get(Calendar.HOUR_OF_DAY));\r
- assertEquals(expectedCal.get(Calendar.MINUTE), reachedCal\r
- .get(Calendar.MINUTE));\r
- assertEquals(expectedCal.get(Calendar.SECOND), reachedCal\r
- .get(Calendar.SECOND));\r
- }\r
-\r
- private UnitUtils() {\r
-\r
- }\r
-\r
-}\r