ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/4] ant git commit: line ends
Date Sat, 30 Sep 2017 04:44:24 GMT
line ends


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/3a5bf997
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/3a5bf997
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/3a5bf997

Branch: refs/heads/master
Commit: 3a5bf997b7aae95f707ac0df562fd8ea05be6bb3
Parents: 3522f74
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sat Sep 30 06:40:37 2017 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sat Sep 30 06:40:37 2017 +0200

----------------------------------------------------------------------
 .../apache/tools/ant/util/DateUtilsTest.java    | 212 +++++++++----------
 1 file changed, 106 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/3a5bf997/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java b/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java
index 8a0a8dc..4f5aa84 100644
--- a/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java
@@ -1,106 +1,106 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-package org.apache.tools.ant.util;
-
-import java.util.Calendar;
-import java.util.TimeZone;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * TestCase for DateUtils.
- *
- */
-public class DateUtilsTest {
-
-
-    @Test
-    public void testElapsedTime(){
-        String text = DateUtils.formatElapsedTime(50*1000);
-        assertEquals("50 seconds", text);
-        text = DateUtils.formatElapsedTime(65*1000);
-        assertEquals("1 minute 5 seconds", text);
-        text = DateUtils.formatElapsedTime(120*1000);
-        assertEquals("2 minutes 0 seconds", text);
-        text = DateUtils.formatElapsedTime(121*1000);
-        assertEquals("2 minutes 1 second", text);
-    }
-
-    // https://issues.apache.org/bugzilla/show_bug.cgi?id=44659
-    @Test
-    public void testLongElapsedTime(){
-        assertEquals("2926 minutes 13 seconds",
-                     DateUtils.formatElapsedTime(1000 * 175573));
-        assertEquals("153722867280912 minutes 55 seconds",
-                     DateUtils.formatElapsedTime(Long.MAX_VALUE));
-    }
-
-    @Test
-    public void testDateTimeISO(){
-        TimeZone timeZone = TimeZone.getTimeZone("GMT+1");
-        Calendar cal = Calendar.getInstance(timeZone);
-        cal.set(2002,1,23,10,11,12);
-        String text = DateUtils.format(cal.getTime(),
-                DateUtils.ISO8601_DATETIME_PATTERN);
-        assertEquals("2002-02-23T09:11:12", text);
-    }
-
-    @Test
-    public void testDateISO(){
-        TimeZone timeZone = TimeZone.getTimeZone("GMT");
-        Calendar cal = Calendar.getInstance(timeZone);
-        cal.set(2002,1,23);
-        String text = DateUtils.format(cal.getTime(),
-                DateUtils.ISO8601_DATE_PATTERN);
-        assertEquals("2002-02-23", text);
-    }
-
-    @Test
-    public void testTimeISODate(){
-        // make sure that elapsed time in set via date works
-        TimeZone timeZone = TimeZone.getTimeZone("GMT+1");
-        Calendar cal = Calendar.getInstance(timeZone);
-        cal.set(2002,1,23, 21, 11, 12);
-        String text = DateUtils.format(cal.getTime(),
-                DateUtils.ISO8601_TIME_PATTERN);
-        assertEquals("20:11:12", text);
-    }
-
-    @Test
-    public void testTimeISO(){
-        // make sure that elapsed time in ms works
-        long ms = (20*3600 + 11*60 + 12)*1000;
-        String text = DateUtils.format(ms,
-                DateUtils.ISO8601_TIME_PATTERN);
-        assertEquals("20:11:12", text);
-    }
-
-    @Test
-    public void testPhaseOfMoon() {
-        TimeZone timeZone = TimeZone.getTimeZone("GMT");
-        Calendar cal = Calendar.getInstance(timeZone);
-        // should be full moon
-        cal.set(2002, 2, 27);
-        assertEquals(4, DateUtils.getPhaseOfMoon(cal));
-        // should be new moon
-        cal.set(2002, 2, 12);
-        assertEquals(0, DateUtils.getPhaseOfMoon(cal));
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.tools.ant.util;
+
+import java.util.Calendar;
+import java.util.TimeZone;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * TestCase for DateUtils.
+ *
+ */
+public class DateUtilsTest {
+
+
+    @Test
+    public void testElapsedTime(){
+        String text = DateUtils.formatElapsedTime(50*1000);
+        assertEquals("50 seconds", text);
+        text = DateUtils.formatElapsedTime(65*1000);
+        assertEquals("1 minute 5 seconds", text);
+        text = DateUtils.formatElapsedTime(120*1000);
+        assertEquals("2 minutes 0 seconds", text);
+        text = DateUtils.formatElapsedTime(121*1000);
+        assertEquals("2 minutes 1 second", text);
+    }
+
+    // https://issues.apache.org/bugzilla/show_bug.cgi?id=44659
+    @Test
+    public void testLongElapsedTime(){
+        assertEquals("2926 minutes 13 seconds",
+                     DateUtils.formatElapsedTime(1000 * 175573));
+        assertEquals("153722867280912 minutes 55 seconds",
+                     DateUtils.formatElapsedTime(Long.MAX_VALUE));
+    }
+
+    @Test
+    public void testDateTimeISO(){
+        TimeZone timeZone = TimeZone.getTimeZone("GMT+1");
+        Calendar cal = Calendar.getInstance(timeZone);
+        cal.set(2002,1,23,10,11,12);
+        String text = DateUtils.format(cal.getTime(),
+                DateUtils.ISO8601_DATETIME_PATTERN);
+        assertEquals("2002-02-23T09:11:12", text);
+    }
+
+    @Test
+    public void testDateISO(){
+        TimeZone timeZone = TimeZone.getTimeZone("GMT");
+        Calendar cal = Calendar.getInstance(timeZone);
+        cal.set(2002,1,23);
+        String text = DateUtils.format(cal.getTime(),
+                DateUtils.ISO8601_DATE_PATTERN);
+        assertEquals("2002-02-23", text);
+    }
+
+    @Test
+    public void testTimeISODate(){
+        // make sure that elapsed time in set via date works
+        TimeZone timeZone = TimeZone.getTimeZone("GMT+1");
+        Calendar cal = Calendar.getInstance(timeZone);
+        cal.set(2002,1,23, 21, 11, 12);
+        String text = DateUtils.format(cal.getTime(),
+                DateUtils.ISO8601_TIME_PATTERN);
+        assertEquals("20:11:12", text);
+    }
+
+    @Test
+    public void testTimeISO(){
+        // make sure that elapsed time in ms works
+        long ms = (20*3600 + 11*60 + 12)*1000;
+        String text = DateUtils.format(ms,
+                DateUtils.ISO8601_TIME_PATTERN);
+        assertEquals("20:11:12", text);
+    }
+
+    @Test
+    public void testPhaseOfMoon() {
+        TimeZone timeZone = TimeZone.getTimeZone("GMT");
+        Calendar cal = Calendar.getInstance(timeZone);
+        // should be full moon
+        cal.set(2002, 2, 27);
+        assertEquals(4, DateUtils.getPhaseOfMoon(cal));
+        // should be new moon
+        cal.set(2002, 2, 12);
+        assertEquals(0, DateUtils.getPhaseOfMoon(cal));
+    }
+}


Mime
View raw message