Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38306

Directory name for @LocalData

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor Minor
    • jenkins-test-harness
    • None
    • jenkins-2.14

      @LocalData decides the directory use in the following way:

      1. # /package/class/methodname
      2. /package/class

      So the data is usable from only one test cases or all test cases (with @LocalData) in a test.

      However, it's often the case that one wants to use data from multiple test cases,
      but not all test cases.

      It's great if one can specify the directory name with @LocalData like

      public class Test {
          @Rule public JenkinsRule j = new JenkinsRule();
      
          @Test
          @LocalData("config1")
          public void config1_test1() throws Exception {...}
      
          @Test
          @LocalData("config1")
          public void config1_test2() throws Exception {...}
      
          @Test
          @LocalData("config2")
          public void config2_test1() throws Exception {...}
      }
      

            ikedam ikedam
            ikedam ikedam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: