ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/jakarta/el/TestMethodReference.java

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

      
    
Rootfs path

      
    
Size
2640 (2.6 KB)
MD5
ffe2ce65e34acc6a9db5b2b111a2d988
SHA1
3f997e930443a3c0dcdb04b3f30b216e1cc588d4
SHA256
f7bd12a03dffdb48b9f45719c835a7253f788309ef1236fabc756dff9b287e75
SHA512

      
    
SHA1_git
d50f474aa1300eed69fd3607347152dbd7f0b50f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestMethodReference.java | 2.6 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 jakarta.el; import java.beans.BeanProperty; import org.junit.Assert; import org.junit.Test; import org.apache.jasper.el.ELContextImpl; public class TestMethodReference { @Test public void testGetAnnotationInfo01() { // None ExpressionFactory factory = ExpressionFactory.newInstance(); ELContext context = new ELContextImpl(); TesterBean bean = new TesterBean("myBean"); ValueExpression var = factory.createValueExpression(bean, TesterBean.class); context.getVariableMapper().setVariable("bean", var); MethodExpression me = factory.createMethodExpression(context, "${bean.getName()}", String.class, null); MethodReference result = me.getMethodReference(context); Assert.assertNotNull(result); Assert.assertNotNull(result.getAnnotations()); Assert.assertEquals(0, result.getAnnotations().length); } @Test public void testGetAnnotationInfo02() { // @BeanProperty with defaults ExpressionFactory factory = ExpressionFactory.newInstance(); ELContext context = new ELContextImpl(); TesterBean bean = new TesterBean("myBean"); ValueExpression var = factory.createValueExpression(bean, TesterBean.class); context.getVariableMapper().setVariable("bean", var); MethodExpression me = factory.createMethodExpression(context, "${bean.getValueD()}", String.class, null); MethodReference result = me.getMethodReference(context); Assert.assertNotNull(result); Assert.assertNotNull(result.getAnnotations()); Assert.assertEquals(1, result.getAnnotations().length); Assert.assertEquals(BeanProperty.class, result.getAnnotations()[0].annotationType()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.25
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