-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
110 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
// Build the plugin using https://github.com/jenkins-infra/pipeline-library | ||
buildPlugin(jenkinsVersions: [null, '2.107.2']) | ||
/* | ||
See the documentation for more options: | ||
https://github.com/jenkins-infra/pipeline-library/ | ||
*/ | ||
buildPlugin(useContainerAgent: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/main/resources/hudson/plugins/locale/PluginImpl/config.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> | ||
<f:section title="${%Locale}"> | ||
<f:entry title="${%Default Language}" help="/plugin/locale/help/default-language.html"> | ||
<f:textbox name="systemLocale" value="${it.systemLocale}" /> | ||
<f:entry title="${%Default Language}" field="systemLocale"> | ||
<f:textbox /> | ||
</f:entry> | ||
<f:entry> | ||
<f:checkbox name="ignoreAcceptLanguage" checked="${it.ignoreAcceptLanguage}" title="${%description}" /> | ||
<f:checkbox field="ignoreAcceptLanguage" /> | ||
</f:entry> | ||
</f:section> | ||
</j:jelly> |
22 changes: 22 additions & 0 deletions
22
src/test/java/hudson/plugins/locale/ConfigurationAsCodeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package hudson.plugins.locale; | ||
|
||
import jenkins.model.Jenkins; | ||
import io.jenkins.plugins.casc.misc.ConfiguredWithCode; | ||
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class ConfigurationAsCodeTest { | ||
|
||
@Rule public JenkinsConfiguredWithCodeRule r = new JenkinsConfiguredWithCodeRule(); | ||
|
||
@Test | ||
@ConfiguredWithCode("configuration-as-code.yml") | ||
public void should_support_configuration_as_code() throws Exception { | ||
PluginImpl plugin = Jenkins.get().getExtensionList(PluginImpl.class).get(0); | ||
assertEquals("fr", plugin.getSystemLocale()); | ||
assertEquals(true, plugin.isIgnoreAcceptLanguage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/test/resources/hudson/plugins/locale/configuration-as-code.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
unclassified: | ||
locale: | ||
systemLocale: fr | ||
ignoreAcceptLanguage: true |