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

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

      
    
Rootfs path

      
    
Size
2877 (2.8 KB)
MD5
e3bdadbf2a04bd3710f4436510167e28
SHA1
b413a931c87f8a8232d1a9befd2545eed3ebc41c
SHA256
7236ad930f2be103056841d3538aa91adce57bf25cedc4b0bd38b306fa3da71f
SHA512

      
    
SHA1_git
d2b3bc3678b05e40ae0b86dd55741e5f0186c0c9
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestAbstractAccessLogValveEscape.java | 2.8 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 java.util.ArrayList; import java.util.Collection; import java.util.List; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class TestAbstractAccessLogValveEscape { @Parameters(name = "{index}: [{0}]") public static Collection<Object[]> parameters() { List<Object[]> parameters = new ArrayList<>(); parameters.add(new String[] { null, "-" }); parameters.add(new String[] { "", "-" }); parameters.add(new String[] { "ok", "ok" }); parameters.add(new String[] { "o\fk", "o\\fk" }); parameters.add(new String[] { "o k", "o\ k" }); parameters.add(new String[] { "o k", "o\ k" }); parameters.add(new String[] { "o k", "o\ k" }); parameters.add(new String[] { "o\"k", "o\\\"k" }); parameters.add(new String[] { "o\\k", "o\\\\k" }); parameters.add(new String[] { "o\u0002k", "o\\u0002k" }); parameters.add(new String[] { "o\u007fk", "o\\u007fk" }); parameters.add(new String[] { "o\u0080k", "o\\u0080k" }); parameters.add(new String[] { "o\u00ffk", "o\\u00ffk" }); parameters.add(new String[] { "o\u8765k", "o\\u8765k" }); parameters.add(new String[] { "12345\u0002\u00036 789\"", "12345\\u0002\\u00036\ 789\\\"" }); parameters.add(new String[] { "\u0002\u00036 789\"12345", "\\u0002\\u00036\ 789\\\"12345" }); return parameters; } @Parameter(0) public String input; @Parameter(1) public String expected; @Test public void testEscape() { CharArrayWriter actual = new CharArrayWriter(); AbstractAccessLogValve.escapeAndAppend(input, actual); Assert.assertEquals(expected, actual.toString()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
34.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