ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/scan/TestClassParser.java

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

      
    
Rootfs path

      
    
Size
1986 (1.9 KB)
MD5
0478e903632fc68ecba95217d76e2625
SHA1
9c68c2a42559bb42c29b2ab1d19336a04fd3ecd8
SHA256
8966ffb55e1525c3e899f180c404e04979bfb839d600977f8962d54c3b4cf9fc
SHA512

      
    
SHA1_git
e995bd3ac8d952d6efeacb99c9386f4d126465d4
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestClassParser.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.scan; import java.io.File; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.junit.Assert; import org.junit.Test; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; public class TestClassParser extends TomcatBaseTest { @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Foo { } /** and beans */ @Foo public class OnClass { } public class OnField { @Foo private String name; } @Test public void testAnnotations() throws Exception { Tomcat tomcat = getTomcatInstance(); File appDir = new File("test/webapp-sci"); tomcat.addWebapp("", appDir.getAbsolutePath()); tomcat.start(); Assert.assertTrue(FooSCI.classSet.size() == 2); Assert.assertTrue(FooSCI.classSet.contains(OnClass.class)); Assert.assertTrue(FooSCI.classSet.contains(OnField.class)); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
50.64
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