title: XmlClass parameter not passed to class on instantiation
body: <p>I'm trying to programatically launch TestNg tests something like this,</p>
  <pre><code>public class TestRunner {
      public static void main(String[] args) {
          // Add parameter to XmlClass
          Map&lt;String, String&gt; testClassParameters = new HashMap&lt;&gt;();
          testClassParameters.put(&quot;classParam1&quot;, &quot;valueOfClassParam1&quot;);
          testClassParameters.put(&quot;day&quot;, &quot;Friday&quot;);
  
          XmlClass testClass = new XmlClass();
          testClass.setParameters(testClassParameters);
          testClass.setClass(TestClass.class);    
  
          XmlSuite suite = new XmlSuite();
          suite.setName(&quot;TmpSuite&quot;);
  
          XmlTest test = new XmlTest(suite);
          test.setName(&quot;TmpTest&quot;);
          // Add parameter to XmlTest
          test.addParameter(&quot;testParam1&quot;, &quot;clock&quot;);
          test.setXmlClasses(Arrays.asList(testClass)) ;
  
          TestNG tng = new TestNG();
          tng.setXmlSuites(Arrays.asList(suite));    
          tng.run();
      }
  }
  
  public class TestClass {
  
      @Test
      @Parameters({&quot;day&quot;, &quot;testParam1&quot;, &quot;classParam1&quot; })
      public void test1(String day, String testParam1, String classParam1) {
          System.out.println(&quot;Day: &quot; + day);
          System.out.println(&quot;testParam1: &quot; + testParam1);
          System.out.println(&quot;classParam1: &quot; + classParam1);
      }
  }
  </code></pre>
  <p>But the parameters set in the <code>XmlClass</code> is not being passed to the test method. Whereas it is being passed only if it is set from <code>XmlTest</code>.</p>
  <p>Have couple of questions on this behaviour,</p>
  <p>Is this expected? If so, why the class is being chosen from <code>XmlClass</code> but the parameters from <code>XmlTest</code>?</p>
  <p>Given this behaviour, how can I pass different parameters to each classes without defining method parameters?</p>