ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/buildutil/translate/TestFixedStrings.java

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

      
    
Rootfs path

      
    
Size
2559 (2.5 KB)
MD5
b646d713ce5fe8f93ba3e55c62a14f81
SHA1
7c4d39e3216b48b692704f5acef2ed9135b9e2db
SHA256
67f02e9a48635ba91006ee66dfd4439733ffae94d3999623979fbe69e8ffdc3d
SHA512

      
    
SHA1_git
4b999e66a9df39972a09121e9157e3f5f6d7f032
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestFixedStrings.java | 2.5 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.buildutil.translate; import java.io.File; import java.util.Properties; import org.junit.Assert; import org.junit.Test; public class TestFixedStrings { @Test public void testManagerApps() { doTestStartsWith("org.apache.catalina.manager", "OK -"); doTestStartsWith("org.apache.catalina.manager.host", "OK -"); } private void doTestStartsWith(String packageName, String text) { File dir = new File("java/" + packageName.replace('.', '/')); // English File fileEn = new File(dir, Constants.L10N_PREFIX + Constants.L10N_SUFFIX); Properties propsEn = Utils.load(fileEn); File[] files = dir.listFiles(); if (files != null) { for (File file : files) { String fileName = file.getName(); if (fileName.startsWith(Constants.L10N_PREFIX)) { if (!Utils.getLanguage(fileName).equals("en")) { doTestStartsFile(file, propsEn, text); } } } } } private void doTestStartsFile(File fileTranslated, Properties propsEn, String text) { Properties propsTranslated = Utils.load(fileTranslated); for (Object key : propsEn.keySet()) { String value = (String) propsEn.get(key); if (value != null && value.startsWith(text)) { String valueTranslated = (String) propsTranslated.get(key); if (valueTranslated != null && !valueTranslated.startsWith(text)) { Assert.fail(fileTranslated.getPath() + " : " + key); } } } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
44.07
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