diff --git a/core/src/main/resources/hudson/Messages_pt_BR.properties b/core/src/main/resources/hudson/Messages_pt_BR.properties index 21b4e0b23f..eb8bfb29f7 100644 --- a/core/src/main/resources/hudson/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/Messages_pt_BR.properties @@ -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|1crea una nueva tarea para empezar. login=Entra para crear nuevas tareas. -signup=Si no tienes una cuenta, puedes crear una ahora. -newJob=Por favor, crea una nueva tarea para empezar. -Welcome\ to\ Jenkins!=\u00A1Bienvenido a Jenkins! -signup=Registrarse - +# TODO pick one: +#signup=Si no tienes una cuenta, puedes crear una ahora. +#signup=Registrarse +Welcome\ to\ Jenkins!=\u00a1Bienvenido a Jenkins! diff --git a/core/src/main/resources/hudson/model/Messages_da.properties b/core/src/main/resources/hudson/model/Messages_da.properties index 1ff2ebb813..0d56bd9348 100644 --- a/core/src/main/resources/hudson/model/Messages_da.properties +++ b/core/src/main/resources/hudson/model/Messages_da.properties @@ -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 — tilbagekald denne rettighed fra den anonyme bruger, tilf\u00f8j \ +se Jenkins sider — 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. diff --git a/core/src/main/resources/hudson/model/Messages_de.properties b/core/src/main/resources/hudson/model/Messages_de.properties index 89b4ea70ef..224c57120b 100644 --- a/core/src/main/resources/hudson/model/Messages_de.properties +++ b/core/src/main/resources/hudson/model/Messages_de.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_es.properties b/core/src/main/resources/hudson/model/Messages_es.properties index 366ccfd159..80298ea215 100644 --- a/core/src/main/resources/hudson/model/Messages_es.properties +++ b/core/src/main/resources/hudson/model/Messages_es.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_fr.properties b/core/src/main/resources/hudson/model/Messages_fr.properties index 035343bf8c..8808e4727c 100644 --- a/core/src/main/resources/hudson/model/Messages_fr.properties +++ b/core/src/main/resources/hudson/model/Messages_fr.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_it.properties b/core/src/main/resources/hudson/model/Messages_it.properties index c975784188..e4fcfab23f 100644 --- a/core/src/main/resources/hudson/model/Messages_it.properties +++ b/core/src/main/resources/hudson/model/Messages_it.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_ja.properties b/core/src/main/resources/hudson/model/Messages_ja.properties index d10ef2c92f..688164d11f 100644 --- a/core/src/main/resources/hudson/model/Messages_ja.properties +++ b/core/src/main/resources/hudson/model/Messages_ja.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_nb_NO.properties b/core/src/main/resources/hudson/model/Messages_nb_NO.properties index e475df644f..fe7187183a 100644 --- a/core/src/main/resources/hudson/model/Messages_nb_NO.properties +++ b/core/src/main/resources/hudson/model/Messages_nb_NO.properties @@ -1,3 +1,2 @@ ManageJenkinsAction.DisplayName=Konfigurer Jenkins -ManageJenkinsAction.DisplayName=Konfigurer Jenkins ParametersDefinitionProperty.DisplayName=Denne build har parametre diff --git a/core/src/main/resources/hudson/model/Messages_pt_BR.properties b/core/src/main/resources/hudson/model/Messages_pt_BR.properties index f02d007044..b3c522587d 100644 --- a/core/src/main/resources/hudson/model/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/model/Messages_pt_BR.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_zh_CN.properties b/core/src/main/resources/hudson/model/Messages_zh_CN.properties index cf982c020e..cb2ea0fdf6 100644 --- a/core/src/main/resources/hudson/model/Messages_zh_CN.properties +++ b/core/src/main/resources/hudson/model/Messages_zh_CN.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/Messages_zh_TW.properties b/core/src/main/resources/hudson/model/Messages_zh_TW.properties index d3058a2b70..87a733d27b 100644 --- a/core/src/main/resources/hudson/model/Messages_zh_TW.properties +++ b/core/src/main/resources/hudson/model/Messages_zh_TW.properties @@ -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 diff --git a/core/src/main/resources/hudson/model/View/sidepanel_ro.properties b/core/src/main/resources/hudson/model/View/sidepanel_ro.properties index 8aad505ecc..1969405cf2 100644 --- a/core/src/main/resources/hudson/model/View/sidepanel_ro.properties +++ b/core/src/main/resources/hudson/model/View/sidepanel_ro.properties @@ -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 diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/DescriptorImpl/index_nl.properties b/core/src/main/resources/hudson/triggers/SCMTrigger/DescriptorImpl/index_nl.properties index 4471513f78..53a87ca60e 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/DescriptorImpl/index_nl.properties +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/DescriptorImpl/index_nl.properties @@ -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 diff --git a/core/src/main/resources/hudson/win32errors_ja.properties b/core/src/main/resources/hudson/win32errors_ja.properties index e5332c5903..3fec9b845e 100644 --- a/core/src/main/resources/hudson/win32errors_ja.properties +++ b/core/src/main/resources/hudson/win32errors_ja.properties @@ -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= \ diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_et.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_et.properties index a34ae03918..3c4ef25a96 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_et.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_et.properties @@ -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?
Leia see kontrollides faili signatuuri Jenkinsi andmebaasist. -
Leia see Jenkinsi s\u00F5rmej\u00E4lgede andmebaasist. -
Leia see Jenkinsi s\u00F5rmej\u00E4lgede andmebaasist. +# TODO was this supposed to be part of the previous description? +#
Leia see Jenkinsi s\u00F5rmej\u00E4lgede andmebaasist. more\ details=lisadetailid diff --git a/core/src/main/resources/lib/hudson/executors_ro.properties b/core/src/main/resources/lib/hudson/executors_ro.properties index dc72abc1e0..452240522a 100644 --- a/core/src/main/resources/lib/hudson/executors_ro.properties +++ b/core/src/main/resources/lib/hudson/executors_ro.properties @@ -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) diff --git a/test/src/main/java/org/jvnet/hudson/test/JellyTestSuiteBuilder.java b/test/src/main/java/org/jvnet/hudson/test/JellyTestSuiteBuilder.java index 3607273be4..4e3ef493ae 100644 --- a/test/src/main/java/org/jvnet/hudson/test/JellyTestSuiteBuilder.java +++ b/test/src/main/java/org/jvnet/hudson/test/JellyTestSuiteBuilder.java @@ -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 scan(File resources, String extension) throws IOException { + Map 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 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 )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 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 entry : scan(res, "jelly").entrySet()) { + ts.addTest(new JellyCheck(entry.getKey(), entry.getValue(), jct, requirePI)); } return ts; } diff --git a/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java b/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java index 6ad0d32e20..646a11eece 100644 --- a/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java +++ b/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java @@ -52,17 +52,16 @@ public class PluginAutomaticTestBuilder { * testOutputDirectory (String) : target/test-classes. */ public static TestSuite build(Map 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 params; diff --git a/test/src/main/java/org/jvnet/hudson/test/PropertiesTestSuite.java b/test/src/main/java/org/jvnet/hudson/test/PropertiesTestSuite.java new file mode 100644 index 0000000000..42e54736c0 --- /dev/null +++ b/test/src/main/java/org/jvnet/hudson/test/PropertiesTestSuite.java @@ -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 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(); + } + } + + } + +} diff --git a/test/src/test/java/CorePropertiesTest.java b/test/src/test/java/CorePropertiesTest.java new file mode 100644 index 0000000000..526e99c425 --- /dev/null +++ b/test/src/test/java/CorePropertiesTest.java @@ -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)); + } + +}