ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/security/TestEscape.java

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

      
    
Rootfs path

      
    
Size
1787 (1.7 KB)
MD5
6a15830e7f0fc4b111f6c0f8ff1bc600
SHA1
8b617abd43a7ba7dab56dd16be32619a14d2b5ee
SHA256
6c5994f1bf8203665d13e70926ba378536406ac8bc2988f4db6ba4f490120684
SHA512

      
    
SHA1_git
b1792ee30b3bd42d728d4280b55d6b0a4d653ccd
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestEscape.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.security; import org.junit.Assert; import org.junit.Test; public class TestEscape { @Test public void testHtmlContent() { Assert.assertEquals("&lt;&gt;&amp;&#39;&quot;&#47;", Escape.htmlElementContent("<>&'\"/")); } @Test public void testHtmlContentNullString() { Assert.assertEquals(null, Escape.htmlElementContent((String) null)); } @Test public void testHtmlContentNullObject() { Assert.assertEquals("?", Escape.htmlElementContent((Object) null)); } @Test public void testHtmlContentObject() { StringBuilder sb = new StringBuilder("test"); Assert.assertEquals("test", Escape.htmlElementContent(sb)); } @Test public void testHtmlContentObjectException() { StringBuilder sb = new StringBuilder("test"); Assert.assertEquals("test", Escape.htmlElementContent(sb)); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
60.71
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