ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/catalina/valves/TestExtendedAccessLogValveWrap.java

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

      
    
Rootfs path

      
    
Size
2743 (2.7 KB)
MD5
54590de01d62129ad0621271e7039f8e
SHA1
ff5a7974d543a5bc525d808b2bbcbfe2b7715428
SHA256
d6aa60023997ea4e2fe7b7da1f0736d3753eaf0f55e1d2882910a8fd6d6238f3
SHA512

      
    
SHA1_git
b99336f160da2c5ef302cfca95141e97538b93a2
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestExtendedAccessLogValveWrap.java | 2.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.catalina.valves; import java.io.CharArrayWriter; import org.junit.Assert; import org.junit.Test; public class TestExtendedAccessLogValveWrap { @Test public void alpha() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("foo", buf); Assert.assertEquals("\"foo\"", buf.toString()); } @Test public void testNull() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap(null, buf); Assert.assertEquals("-", buf.toString()); } @Test public void empty() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("", buf); Assert.assertEquals("\"\"", buf.toString()); } @Test public void singleQuoteMiddle() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("foo'bar", buf); Assert.assertEquals("\"foo'bar\"", buf.toString()); } @Test public void doubleQuoteMiddle() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("foo\"bar", buf); Assert.assertEquals("\"foo\"\"bar\"", buf.toString()); } @Test public void doubleQuoteStart() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("\"foobar", buf); Assert.assertEquals("\"\"\"foobar\"", buf.toString()); } @Test public void doubleQuoteEnd() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("foobar\"", buf); Assert.assertEquals("\"foobar\"\"\"", buf.toString()); } @Test public void doubleQuote() { CharArrayWriter buf = new CharArrayWriter(); ExtendedAccessLogValve.wrap("\"", buf); Assert.assertEquals("\"\"\"\"", buf.toString()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
43.59
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