<commit_before>package jenkins.bugs

import hudson.Launcher
import hudson.model.AbstractBuild
import hudson.model.AbstractProject
import hudson.model.BuildListener
import hudson.tasks.BuildStepDescriptor
import hudson.tasks.Builder
import hudson.util.FormValidation
import hudson.util.ListBoxModel
import org.junit.Rule
import org.junit.Test
import org.jvnet.hudson.test.Issue
import org.jvnet.hudson.test.JenkinsRule
import org.jvnet.hudson.test.TestExtension
import org.kohsuke.stapler.QueryParameter

import javax.inject.Inject

/**
 *
 *
 * @author <NAME>
 */
class Jenkins19124Test {
    @Rule
    public JenkinsRule j = new JenkinsRule();

    @Inject
    DescriptorImpl d;

    @Issue("JENKINS-19124")
    @Test
    public void interrelatedFormValidation() {
        j.jenkins.injector.injectMembers(this);

        def p = j.createFreeStyleProject();
        p.buildersList.add(new Foo());

        def wc = j.createWebClient();
        def c = wc.getPage(p, "configure");
        c.getElementByName("_.alpha").valueAttribute = "hello";
        assert d.alpha=="hello";
        assert d.bravo=="2";

        c.getElementByName("_.bravo").setSelectedAttribute("1",true);
        assert d.alpha=="hello";<commit_msg>Jenkins19124Test fixes<commit_after>package jenkins.bugs

import com.gargoylesoftware.htmlunit.WebClientUtil
import hudson.Launcher
import hudson.model.AbstractBuild
import hudson.model.AbstractProject
import hudson.model.BuildListener
import hudson.tasks.BuildStepDescriptor
import hudson.tasks.Builder
import hudson.util.FormValidation
import hudson.util.ListBoxModel
import org.junit.Rule
import org.junit.Test
import org.jvnet.hudson.test.Issue
import org.jvnet.hudson.test.JenkinsRule
import org.jvnet.hudson.test.TestExtension
import org.kohsuke.stapler.QueryParameter

import javax.inject.Inject

/**
 *
 *
 * @author <NAME>
 */
class Jenkins19124Test {
    @Rule
    public JenkinsRule j = new JenkinsRule();

    @Inject
    DescriptorImpl d;

    @Issue("JENKINS-19124")
    @Test
    public void interrelatedFormValidation() {
        j.jenkins.injector.injectMembers(this);

        def p = j.createFreeStyleProject();
        p.buildersList.add(new Foo());

        def wc = j.createWebClient();
        def c = wc.getPage(p, "configure");
        c.getElementByName("_.alpha").valueAttribute = "hello";
        WebClientUtil.waitForJSExec(wc);
        assert d.alpha=="hello";
        assert d.bravo=="2";

        c.getElementByName("_.bravo").setSelectedAttribute("1",true);
        WebClientUtil.waitForJSExec(wc);
        assert d.alpha=="hello";
{'fraction_non_alphanumeric': 0.11407579273008507, 'fraction_numerical': 0.011214230471771076, 'mean_word_length': 3.729433272394881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '11918', 'n_tokens_mistral': 870, 'n_tokens_neox': 808, 'n_words': 148}