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

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

      
    
Rootfs path

      
    
Size
1771 (1.7 KB)
MD5
dbc674c44fca42a79413dc0c070bb4e7
SHA1
b5f5c4ec659983909f804ae4750ed17cdbeca7dc
SHA256
342caf45dda1e286fd6cacf83990c9a8e024c95ab28618d769480931865319f8
SHA512

      
    
SHA1_git
65c892e92468be94128b6fc0ea27002f40c227b1
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestMethod.java | 1.7 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.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; import org.junit.Assert; import org.junit.Test; public class TestMethod { /* * Not testing performance. Just checking that there are no errors in the parsing code. */ @Test public void testHttpMethodParsing() { List<String> methods = Arrays.asList(Method.GET, Method.POST, Method.PUT, Method.PATCH, Method.HEAD, Method.OPTIONS, Method.DELETE, Method.TRACE, Method.PROPPATCH, Method.PROPFIND, Method.MKCOL, Method.COPY, Method.MOVE, Method.LOCK, Method.UNLOCK, Method.CONNECT); for (String method : methods) { byte[] bytes = method.getBytes(StandardCharsets.ISO_8859_1); String result = Method.bytesToString(bytes, 0, bytes.length); Assert.assertEquals(method, result); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
52.42
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