ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/http/TestConcurrentDateFormat.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/http/TestConcurrentDateFormat.java
Status
scanned
Type
file
Name
TestConcurrentDateFormat.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
1947 (1.9 KB)
MD5
3e5eb23da942cb2c722fabe055e4fe69
SHA1
ebd7f19b6277a0d4a7722943e233fec1d339bb7b
SHA256
99d77bde58b6b300749efd0faae9ae9f3d15a4f9d15d997e02a2d736bc6e807e
SHA512

      
    
SHA1_git
7ede836550d5477f039e118647f76f9f8a815c47
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestConcurrentDateFormat.java | 1.9 KB |

/* * 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 java.util.Date; import java.util.Locale; import java.util.TimeZone; import org.junit.Assert; import org.junit.Test; public class TestConcurrentDateFormat { private static final String DATE_RFC5322 = "EEE, dd MMM yyyy HH:mm:ss z"; TimeZone tz = TimeZone.getTimeZone("GMT"); @Test public void testFormatReturnsGMT() { ConcurrentDateFormat format = createConcurrentDateFormat(); Date date = new Date(); String formattedDate = format.format(date); Assert.assertTrue(formattedDate.endsWith("GMT")); } @Test public void testFormatReturnsGMTAfterParseCET() throws Exception { ConcurrentDateFormat format = createConcurrentDateFormat(); format.parse("Thu, 12 Mar 2020 14:40:22 CET"); Date date = new Date(); String formattedDate = format.format(date); Assert.assertTrue(formattedDate.endsWith("GMT")); } private ConcurrentDateFormat createConcurrentDateFormat() { return new ConcurrentDateFormat(DATE_RFC5322, Locale.US, tz); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
51.52
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9