Merge pull request #1899 from jglick/PropertiesTestSuite

Verify that *.properties do not have duplicated keys
This commit is contained in:
Jesse Glick committed 2015-11-04 11:28:34 -05:00
commit 99dc53d3bb
22 files changed
+178 -124

No files matched your search

@@ -25,17 +25,20 @@ FilePath.validateAntFileMask.whitespaceSeprator=\
FilePath.validateAntFileMask.doesntMatchAndSuggest=\
''{0}'' n\u00e3o corresponde a nada, mas ''{1}'' sim. Talvez seja isto que voc\u00ea quis dizer?
FilePath.validateRelativePath.noSuchDirectory=Diret\u00f3rio n\u00e3o encontrado: ''{0}''
FilePath.TildaDoesntWork= ''~'' s\u00f3 \u00e9 suportado apenas pelo shell do Unix
# TODO pick one:
#FilePath.TildaDoesntWork= ''~'' s\u00f3 \u00e9 suportado apenas pelo shell do Unix
#FilePath.TildaDoesntWork=\u2018~\u2019 \u00e9 suportado somente em shell Unix.
FilePath.validateAntFileMask.portionMatchAndSuggest=''{0}'' n\u00e3o foi encontrado, mas ''{1}'' existe
FilePath.validateAntFileMask.doesntMatchAnything= ''{0}'' n\u00e3o foi encontrada nenhuma correspond\u00eancia
FilePath.validateAntFileMask.doesntMatchAnythingAndSuggest=''{0}'' n\u00e3o foi encontrada nenhuma correspond\u00eancia: mesmo ''{1}'' n\u00e3o existe
FilePath.validateRelativePath.wildcardNotAllowed=Curinga n\u00e3o \u00e9 permitido aqui
FilePath.validateRelativePath.notFile= ''{0}'' n\u00e3o \u00e9 um arquivo
FilePath.validateRelativePath.notDirectory= ''{0}'' n\u00e3o \u00e9 um diret\u00f3rio
FilePath.validateRelativePath.noSuchFile=''{0}'' arquivo n\u00e3o encontrado
FilePath.validateAntFileMask.portionMatchButPreviousNotMatchAndSuggest= ''{0}'' n\u00e3o encontrado: ''{1}'' existe, mas n\u00e3o ''{2}''
FilePath.validateAntFileMask.doesntMatchAnythingAndSuggest= ''{0}'' n\u00e3o localizado: mesmo ''{1}'' n\u00e3o existe
# TODO pick one:
#FilePath.validateAntFileMask.doesntMatchAnythingAndSuggest=''{0}'' n\u00e3o foi encontrada nenhuma correspond\u00eancia: mesmo ''{1}'' n\u00e3o existe
#FilePath.validateAntFileMask.doesntMatchAnythingAndSuggest=''{0}'' n\u00e3o localizado: mesmo ''{1}'' n\u00e3o existe
PluginManager.PluginDoesntSupportDynamicLoad.RestartRequired={0} plugin n\u00e3o suporta hot deploy. O Jenkins precisa ser reiniciado para efetivar a atualiza\u00e7\u00e3o
@@ -53,7 +56,6 @@ Util.year ={0} {0,choice,0#anos|1#ano|1<anos}
# another implication of this is that where we use this,
# we often want to add "ago" there
Util.pastTime={0}
FilePath.TildaDoesntWork=\u2018~\u2019 \u00e9 suportado somente em shell Unix.
# Plugin Manager
@@ -24,48 +24,3 @@ Back\ to\ Project=Voltar ao projeto
Changes=Altera\u00E7\u00F5es
Edit\ Build\ Information=Editar informa\u00E7\u00F5es de compila\u00E7\u00E3o
Status=Estado pessoal
Jenkins
\u2026
Translation Assistance Plugin
License of contribution to Jenkins translation
Edit
Add
Page
Gliffy Diagram
Comment
Attachment
Tools
Attachments (0)
Page History
Restrictions
Edit in Word
Favourite
Watch
Info
Link to this Page\u2026
View in Hierarchy
View Wiki Markup
Export to PDF
Export to Word
Import Word Document
Copy
Move
License of contribution to Jenkins translation
Added by Kohsuke Kawaguchi, last edited by Kohsuke Kawaguchi on Aug 29, 2011
Jenkins
Home
Mailing lists
Source code
Bugtracker
Security Advisories
Donation
Commercial Support
Wiki Site Map
Documents
Meet Jenkins
Use Jenkins
Extend Jenkins
Plugins
Servlet Container Notes
This page is the landing page for the translation assistance plugin''s "contribute" link
When you check the "I contribute my translations to the Jenkins project" link, you acknowledge that your submission will be licensed under the MIT license (the same license that the rest of the Jenkins core uses) and you have the rights to release them under the said license.
@@ -24,8 +24,7 @@ newJob=Por favor, <a href="newJob">crea una nueva tarea</a> para empezar.
login=<a href="{0}/{1}?from={2}">Entra</a> para crear nuevas tareas.
signup=Si no tienes una cuenta, puedes <a href="signup">crear</a> una ahora.
newJob=Por favor, <a href="newJob">crea una nueva tarea</a> para empezar.
Welcome\ to\ Jenkins!=\u00A1Bienvenido a Jenkins!
signup=Registrarse
# TODO pick one:
#signup=Si no tienes una cuenta, puedes <a href="signup">crear</a> una ahora.
#signup=Registrarse
Welcome\ to\ Jenkins!=\u00a1Bienvenido a Jenkins!
@@ -97,11 +97,11 @@ Slave.Remote.Director.Mandatory=Fjerndirektorie er obligatorisk
BallColor.Disabled=Sl\u00e5et fra
Run.InProgressDuration={0} og t\u00e6ller
UpdateCenter.Status.UnknownHostException=Ukendt v\u00e6rt undtagelse
Hudson.NotUsesUTF8ToDecodeURL=\
Din container bruger ikke UTF-8 til at afkode URLer. Hvis du bruger ikke-ASCII tegn i jobnavne etc, \
Hudson.NotUsesUTF8ToDecodeURL=\
Din container bruger ikke UTF-8 til at afkode URLer. Hvis du bruger ikke-ASCII tegn i jobnavne etc, \
vil dette skabe problemer.
UpdateCenter.Status.CheckingInternet=Checker internet forbindelse
View.DeletePermission.Description=\
View.DeletePermission.Description=\
Denne rettighed tillader brugerne at slette eksisterende visninger.
UpdateCenter.Status.CheckingJavaNet=Checker jenkins-ci.org forbindelse
UpdateCenter.PluginCategory.user=Authentificering og brugerh\u00e5ndtering
@@ -127,7 +127,7 @@ UpdateCenter.PluginCategory.buildwrapper=Byggeomslag
Hudson.ReadPermission.Description=\
L\u00e6serettigheden er n\u00f8dvendig for at se n\u00e6sten alle sider i Jenkins. \
Denne rettighed kan bruges n\u00e5r du ikke vil have uauthentificerede brugere til at \
se Jenkins sider &mdash; tilbagekald denne rettighed fra den anonyme bruger, tilf\u00f8j \
se Jenkins sider &mdash; tilbagekald denne rettighed fra den anonyme bruger, tilf\u00f8j \
derefter en "authentificeret" pseudo-bruger og giv denne l\u00e6serettigheder.
Hudson.NodeBeingRemoved=Node bliver fjernet
Hudson.ViewAlreadyExists=En visning ved navn "{0}" findes allerede
@@ -153,8 +153,8 @@ AbstractBuild.KeptBecause=beholdt pga. {0}
Hudson.NotADirectory={0} er ikke et direktorie
Cause.RemoteCause.ShortDescription=Startet af fjernv\u00e6rt {0}
Slave.WindowsSlave=Dette er en Windows slave
Run.ArtifactsPermission.Description=\
Denne rettighed g\u00f8r det muligt at hente byggeartifakter. \
Run.ArtifactsPermission.Description=\
Denne rettighed g\u00f8r det muligt at hente byggeartifakter. \
Hvis du ikke vil have at en bruger skal kunne tilg\u00e5 byggeartifakter kan \
du fratage vedkommende denne rettighed.
Computer.BadChannel=Slave node offline eller ikke en fjernkanal (f.eks. en masternode).
@@ -170,9 +170,9 @@ MyViewsProperty.DisplayName=Mine visninger
UpdateCenter.PluginCategory.must-be-labeled=Ukatagoriserede
AbstractProject.Disabled=Byg sl\u00e5et fra
MyViewsProperty.ViewExistsCheck.AlreadyExists=En visning ved navn {0} eksisterer allerede
Hudson.AdministerPermission.Description=\
Denne rettighed g\u00f8r det muligt at lave konfigurations\u00e6ndringer p\u00e5 tv\u00e6rs af hele systemet, \
s\u00e5vel som at k\u00f8re yderst f\u00f8lsomme operationer der effektivt svarer til fuld lokal system adgang \
Hudson.AdministerPermission.Description=\
Denne rettighed g\u00f8r det muligt at lave konfigurations\u00e6ndringer p\u00e5 tv\u00e6rs af hele systemet, \
s\u00e5vel som at k\u00f8re yderst f\u00f8lsomme operationer der effektivt svarer til fuld lokal system adgang \
(indenfor rettighedsrammerne af det underliggende operativsystem.)
Hudson.NotJDKDir={0} ligner ikke et JDK direktorie
AbstractProject.WorkspaceOffline=Arbejdsomr\u00e5det er offline.
@@ -223,7 +223,6 @@ UpdateCenter.PluginCategory.upload=Artifaktsendere
Permalink.LastUnstableBuild=Seneste ustabile byg
CLI.enable-job.shortDescription=Sl\u00e5r et job til
Run.Summary.Unknown=?
ParametersDefinitionProperty.DisplayName=Parametre
AbstractProject.BuildPermission.Description=\
Denne rettighed giver mulighed for at starte et nyt byg.
Job.NOfMFailed={0} af de seneste {1} byg fejlede.
@@ -86,7 +86,6 @@ CLI.disconnect-node.shortDescription=Knoten trennen.
CLI.offline-node.shortDescription=Knoten wird bis zum n\u00e4chsten "online-node"-Kommando f\u00fcr keine neuen Builds verwendet.
CLI.online-node.shortDescription=Knoten wird wieder f\u00fcr neue Builds verwendet. Hebt ein vorausgegangenes "offline-node"-Kommando auf.
CLI.safe-restart.shortDescription=Startet Jenkins neu.
MyViewsProperty.GlobalAction.DisplayName=Meine Ansichten
Queue.init=Build-Warteschlange neu initialisieren
Computer.Caption=Slave {0}
@@ -276,7 +275,6 @@ Permalink.LastUnstableBuild=Letzter instabiler Build
Permalink.LastUnsuccessfulBuild=Letzter erfolgloser Build
ParameterAction.DisplayName=Parameter
ParametersDefinitionProperty.DisplayName=Parameter
StringParameterDefinition.DisplayName=Text-Parameter
TextParameterDefinition.DisplayName=Textbox-Parameter
FileParameterDefinition.DisplayName=Datei-Parameter
@@ -214,7 +214,6 @@ Permalink.LastSuccessfulBuild=\u00daltima ejecuci\u00f3n correcta
Permalink.LastFailedBuild=\u00daltima ejecuci\u00f3n fallida
ParameterAction.DisplayName=Par\u00e1metros
ParametersDefinitionProperty.DisplayName=Par\u00e1metros
StringParameterDefinition.DisplayName=Par\u00e1metro de cadena
FileParameterDefinition.DisplayName=Par\u00e1metro de fichero
BooleanParameterDefinition.DisplayName=Valor booleano
@@ -161,7 +161,6 @@ Permalink.LastSuccessfulBuild=Dernier build avec succ\u00e8s
Permalink.LastFailedBuild=Dernier build en \u00e9chec
ParameterAction.DisplayName=Param\u00e8tres
ParametersDefinitionProperty.DisplayName=Param\u00e8tres
StringParameterDefinition.DisplayName=Param\u00e8tre String
TextParameterDefinition.DisplayName=Param\u00e8tre texte
FileParameterDefinition.DisplayName=Param\u00e8tre fichier
@@ -267,7 +267,6 @@ Permalink.LastSuccessfulBuild=Last successful build
Permalink.LastFailedBuild=Last failed build
ParameterAction.DisplayName=Parameters
ParametersDefinitionProperty.DisplayName=Parameters
StringParameterDefinition.DisplayName=String Parameter
TextParameterDefinition.DisplayName=Text Parameter
FileParameterDefinition.DisplayName=File Parameter
@@ -272,7 +272,6 @@ Permalink.LastCompletedBuild=\u6700\u65b0\u306e\u5b8c\u4e86\u30d3\u30eb\u30c9
ParameterAction.DisplayName=\u30d1\u30e9\u30e1\u30fc\u30bf
ParametersDefinitionProperty.DisplayName=\u30d1\u30e9\u30e1\u30fc\u30bf
StringParameterDefinition.DisplayName=\u6587\u5b57\u5217
TextParameterDefinition.DisplayName=\u30c6\u30ad\u30b9\u30c8
FileParameterDefinition.DisplayName=\u30d5\u30a1\u30a4\u30eb
@@ -1,3 +1,2 @@
ManageJenkinsAction.DisplayName=Konfigurer Jenkins
ManageJenkinsAction.DisplayName=Konfigurer Jenkins
ParametersDefinitionProperty.DisplayName=Denne build har parametre
@@ -368,7 +368,6 @@ CLI.enable-job.shortDescription=Habilita um job
# ?
Run.Summary.Unknown=?
# Parameters
ParametersDefinitionProperty.DisplayName=Par\u00e2metros
# \
# This permission grants the ability to start a new build.
AbstractProject.BuildPermission.Description=Permiss\u00e3o para iniciar um novo build
@@ -228,7 +228,6 @@ Permalink.LastSuccessfulBuild=Last successful build
Permalink.LastFailedBuild=Last failed build
ParameterAction.DisplayName=Parameters
ParametersDefinitionProperty.DisplayName=Parameters
StringParameterDefinition.DisplayName=String Parameter
FileParameterDefinition.DisplayName=File Parameter
BooleanParameterDefinition.DisplayName=Boolean Value
@@ -276,7 +276,6 @@ Permalink.LastSuccessfulBuild=\u6700\u65b0\u6210\u529f\u5efa\u7f6e
Permalink.LastFailedBuild=\u6700\u65b0\u5931\u6557\u5efa\u7f6e
ParameterAction.DisplayName=\u53c3\u6578
ParametersDefinitionProperty.DisplayName=\u53c3\u6578
StringParameterDefinition.DisplayName=\u5b57\u4e32\u53c3\u6578
TextParameterDefinition.DisplayName=\u6587\u5b57\u53c3\u6578
FileParameterDefinition.DisplayName=\u6a94\u6848\u53c3\u6578
@@ -23,13 +23,8 @@
Build\ History=Istoric build-uri
Check\ File\ Fingerprint=verifica amprenta fisierului
Delete\ View=Sterge Fereastra
(view is not necessarily fereastra but i think this is what i understand )
(view is not necessarily fereastra but i think this is what i understand )
(view is not necessarily fereastra but i think this is what i understand )
# (view is not necessarily fereastra but i think this is what i understand)
Edit\ View=Editare Fereastra
(view is not necessarily fereastra but i think this is what i understand )
(view is not necessarily fereastra but i think this is what i understand )
(view is not necessarily fereastra but i think this is what i understand )
NewJob={0} nou
People=Persoane
Project\ Relationship=Relatiile proiectului
@@ -21,7 +21,6 @@
# THE SOFTWARE.
clogged=Er zijn meer versiebeheersbemonsteringen gepland dan er behandeld kunnen worden, dus de draden kunnen de vraag niet bijhouden. Kijk na of je bemonstering blijft hangen en/of verhoog het aantal draden indien nodig.
Current\ SCM\ Polling\ Activities=Huidige versiebeheersbemonsteringen.
clogged=Er zijn meer versiebeheersbemonsteringen gepland dan er behandeld kunnen worden, dus de draden kunnen de vraag niet bijhouden. Kijk na of je bemonstering blijft hangen en/of verhoog het aantal draden indien nodig.
No\ polling\ activity\ is\ in\ progress.=Geen versiecontrolebemonsteringen actief.
The\ following\ polling\ activities\ are\ currently\ in\ progress\:=Volgende versiecontrolebemonsteringen zijn actief:
Project=Project
@@ -574,8 +574,6 @@ error273= \
\u672A\u77E5\u306E\u30A8\u30E9\u30FC (0x111)
error274= \
\u672A\u77E5\u306E\u30A8\u30E9\u30FC (0x112)
error267= \
\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540D\u304C\u7121\u52B9\u3067\u3059\u3002
error275= \
\u62E1\u5F35\u5C5E\u6027\u304C\u30D0\u30C3\u30D5\u30A1\u306B\u304A\u3055\u307E\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002
error276= \
@@ -4,6 +4,6 @@ Check=Kontrolli
Check\ File\ Fingerprint=Kontrolli Faili Signatuuri
File\ to\ check=Kontrolli faili
description=Sul on jar fail aga sa ei tea tema versiooninumbrit? <br />Leia see kontrollides faili signatuuri Jenkinsi andmebaasist.
<br /> Leia see Jenkinsi s\u00F5rmej\u00E4lgede andmebaasist.
<br /> Leia see Jenkinsi s\u00F5rmej\u00E4lgede andmebaasist.
# TODO was this supposed to be part of the previous description?
# <br /> Leia see Jenkinsi s\u00F5rmej\u00E4lgede andmebaasist.
more\ details=lisadetailid
@@ -22,12 +22,8 @@
Build\ Executor\ Status=Starea builder-ului Executant
Idle=\u00CEn a\u0219teptare
(need to specify the context)
(need to specify the context)
(need to specify the context)
# (need to specify the context)
Status=Stare
offline=oprit
terminate\ this\ build=opreste build-ul
(i think in Romania build is called build)
(i think in Romania build is called build)
(i think in Romania build is called build)
# (i think in Romania build is called build)
@@ -35,9 +35,11 @@ import org.kohsuke.stapler.MetaClassLoader;
import org.kohsuke.stapler.jelly.JellyClassLoaderTearOff;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
@@ -48,29 +50,37 @@ import java.util.jar.JarFile;
* @author Kohsuke Kawaguchi
*/
public class JellyTestSuiteBuilder {
static Map<URL,String> scan(File resources, String extension) throws IOException {
Map<URL,String> result = new HashMap<>();
if (resources.isDirectory()) {
for (File f : FileUtils.listFiles(resources, new String[] {extension}, true)) {
result.put(f.toURI().toURL(), f.getAbsolutePath().substring((resources.getAbsolutePath() + File.separator).length()));
}
} else if (resources.getName().endsWith(".jar")) {
String jarUrl = resources.toURI().toURL().toExternalForm();
JarFile jf = new JarFile(resources);
Enumeration<JarEntry> e = jf.entries();
while (e.hasMoreElements()) {
JarEntry ent = e.nextElement();
if (ent.getName().endsWith("." + extension)) {
result.put(new URL("jar:" + jarUrl + "!/" + ent.getName()), ent.getName());
}
}
jf.close();
}
return result;
}
/**
* Given a jar file or a class file directory, recursively search all the Jelly files and build a {@link TestSuite}
* that performs static syntax checks.
*/
public static TestSuite build(File res, boolean requirePI) throws Exception {
TestSuite ts = new JellyTestSuite();
final JellyClassLoaderTearOff jct = new MetaClassLoader(JellyTestSuiteBuilder.class.getClassLoader()).loadTearOff(JellyClassLoaderTearOff.class);
if (res.isDirectory()) {
for (final File jelly : (Collection <File>)FileUtils.listFiles(res,new String[]{"jelly"},true))
ts.addTest(new JellyCheck(jelly.toURI().toURL(), jelly.getAbsolutePath().substring((res.getAbsolutePath() + File.separator).length()), jct, requirePI));
}
if (res.getName().endsWith(".jar")) {
String jarUrl = res.toURI().toURL().toExternalForm();
JarFile jf = new JarFile(res);
Enumeration<JarEntry> e = jf.entries();
while (e.hasMoreElements()) {
JarEntry ent = e.nextElement();
if (ent.getName().endsWith(".jelly"))
ts.addTest(new JellyCheck(new URL("jar:"+jarUrl+"!/"+ent.getName()), ent.getName(), jct, requirePI));
}
jf.close();
for (Map.Entry<URL,String> entry : scan(res, "jelly").entrySet()) {
ts.addTest(new JellyCheck(entry.getKey(), entry.getValue(), jct, requirePI));
}
return ts;
}
@@ -52,17 +52,16 @@ public class PluginAutomaticTestBuilder {
* testOutputDirectory (String) : target/test-classes.
*/
public static TestSuite build(Map<String,?> params) throws Exception {
// automatic Jelly tests
if (params.containsKey("outputDirectory") // shouldn't happen, but be defensive
|| notSkipTests("JellyTest")) { // TODO this is probably obsolete given -Dmaven-hpi-plugin.disabledTestInjection
TestSuite master = new TestSuite();
if (params.containsKey("outputDirectory")) { // shouldn't happen, but be defensive
File outputDirectory = new File((String)params.get("outputDirectory"));
TestSuite suite = JellyTestSuiteBuilder.build(outputDirectory,toBoolean(params.get("requirePI")));
suite.addTest(new OtherTests("testCliSanity", params));
suite.addTest(new OtherTests("testPluginActive", params));
return suite;
} else {
return new TestSuite();
TestSuite inJenkins = JellyTestSuiteBuilder.build(outputDirectory,toBoolean(params.get("requirePI")));
inJenkins.addTest(new OtherTests("testCliSanity", params));
inJenkins.addTest(new OtherTests("testPluginActive", params));
master.addTest(inJenkins);
master.addTest(new PropertiesTestSuite(outputDirectory));
}
return master;
}
private static boolean toBoolean(Object requirePI) {
@@ -71,13 +70,6 @@ public class PluginAutomaticTestBuilder {
return Boolean.parseBoolean(requirePI.toString());
}
/**
* Provides an escape hatch for plugin developers to skip auto-generated tests.
*/
private static boolean notSkipTests(String propertyName) {
return !Boolean.getBoolean("hpiTest.skip"+propertyName);
}
public static class OtherTests extends TestCase {
private final Map<String,?> params;
@@ -0,0 +1,79 @@
/*
* The MIT License
*
* Copyright 2015 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.jvnet.hudson.test;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Map;
import java.util.Properties;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import static org.jvnet.hudson.test.JellyTestSuiteBuilder.scan;
/**
* Checks things about {@code *.properties}.
*/
public class PropertiesTestSuite extends TestSuite {
public PropertiesTestSuite(File resources) throws IOException {
for (Map.Entry<URL,String> entry : scan(resources, "properties").entrySet()) {
addTest(new PropertiesTest(entry.getKey(), entry.getValue()));
}
}
private static class PropertiesTest extends TestCase {
private final URL resource;
private PropertiesTest(URL resource, String name) {
super(name);
this.resource = resource;
}
@Override
protected void runTest() throws Throwable {
Properties props = new Properties() {
@Override
public synchronized Object put(Object key, Object value) {
Object old = super.put(key, value);
if (old != null) {
throw new AssertionError("Two values for `" + key + "` (`" + old + "` vs. `" + value + "`) in " + resource);
}
return null;
}
};
InputStream is = resource.openStream();
try {
props.load(is);
} finally {
is.close();
}
}
}
}
@@ -0,0 +1,40 @@
/*
* The MIT License
*
* Copyright 2015 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import hudson.remoting.Which;
import jenkins.model.Jenkins;
import junit.framework.Test;
import junit.framework.TestCase;
import org.jvnet.hudson.test.PropertiesTestSuite;
/**
* Runs checks on properties files in core.
*/
public class CorePropertiesTest extends TestCase {
public static Test suite() throws Exception {
return new PropertiesTestSuite(Which.jarFile(Jenkins.class));
}
}