ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/el/parser/TestAstInteger.java

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

      
    
Rootfs path

      
    
Size
1692 (1.7 KB)
MD5
81d33a401fdf1e10bf68e0324001c007
SHA1
732bea589eb37dfecab46ab8f7ceac566f5a5bcb
SHA256
41b37ccdf5f278c8cd52369e5b91231cbcf4d5180d9aae677ee5c9b0fc6281f6
SHA512

      
    
SHA1_git
e01c55ad0ebc5eb4790175a809158dfc85e8693d
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestAstInteger.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.el.parser; import java.math.BigInteger; import jakarta.el.ELProcessor; import org.junit.Assert; import org.junit.Test; import org.apache.el.lang.ELSupport; public class TestAstInteger { @Test public void testValidLong() { doTestValid("1234"); } @Test public void testValidBigInteger() { doTestValid("12345678901234567890"); } private void doTestValid(String value) { ELProcessor processor = new ELProcessor(); Number result = processor.eval(value); Assert.assertTrue(ELSupport.equals(null, new BigInteger(value), result)); } // Note: Testing an invalid integer would require a number larger than // 2^Integer.MAX_VALUE. It is not practical to test with a String of // digits representing a number that large. }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
56.4
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