This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 1cb8934269 Add ALv2 header. Formatting.
1cb8934269 is described below
commit 1cb89342692009571bf8c5e09edcb10774a86359
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Sep 20 11:53:23 2024 +0100
Add ALv2 header. Formatting.
---
.../tomcat/util/http/TestFastHttpDateFormat.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
index 0c915669f9..fca12e21b6 100644
--- a/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
+++ b/test/org/apache/tomcat/util/http/TestFastHttpDateFormat.java
@@ -1,15 +1,33 @@
+/*
+ * 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.tomcat.util.http;
import org.junit.Assert;
import org.junit.Test;
public class TestFastHttpDateFormat {
+
@Test
public void testGetCurrentDateInSameSecond() {
long now = System.currentTimeMillis();
try {
Thread.sleep(1000L - now % 1000);
} catch (InterruptedException e) {
+ // Ignore
}
now = System.currentTimeMillis();
String s1 = FastHttpDateFormat.getCurrentDate();
@@ -17,6 +35,7 @@ public class TestFastHttpDateFormat {
try {
Thread.sleep(lastMillisInSameSecond - now);
} catch (InterruptedException e) {
+ // Ignore
}
String s2 = FastHttpDateFormat.getCurrentDate();
Assert.assertEquals("Two same RFC5322 format dates are expected.", s1,
s2);
@@ -29,6 +48,7 @@ public class TestFastHttpDateFormat {
try {
Thread.sleep(2000L - now % 1000 + 500L);
} catch (InterruptedException e) {
+ // Ignore
}
now = System.currentTimeMillis();
String s1 = FastHttpDateFormat.getCurrentDate();
@@ -36,6 +56,7 @@ public class TestFastHttpDateFormat {
try {
Thread.sleep(firstMillisOfNextSecond - now);
} catch (InterruptedException e) {
+ // Ignore
}
String s2 = FastHttpDateFormat.getCurrentDate();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]