title: NumberFormatException when passing String param through Jenkins choice parameter
body: <p>I have some automated tests for which I am using a Jenkins Parameterized project. It is a Maven project using TestNG for which I am passing values at runtime  </p>
  
  <p>I am using Choice Parameters to pass values as Strings.  A few of the parameters are of int type however.  </p>
  
  <p>I therefore convert these as follows (code simplified for illustration purposes):</p>
  
  <pre><code> @BeforeClass
  @Parameters({"numOfAdults"})
  public void setup(String numOfAdults) {
  
   numOfPeople = new SearchDetails()
              .withNumberOfAdults(Integer.valueOf(numOfAdults.trim()))
  </code></pre>
  
  <p>The maven goal I pass at runtime is:</p>
  
  <pre><code>clean test -DsuiteFile=src\test\resources\tools\testng_custom_runner.xml -DnumAdults=$numOfAdults 
  </code></pre>
  
  <p>The TestNG Suite File has the param:</p>
  
  <pre><code>   &lt;parameter name="numOfAdults" value="${numAdults}"/&gt;
  </code></pre>
  
  <p>And the Maven file as follows:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;sl4j.version&gt;1.7.7&lt;/sl4j.version&gt;
      &lt;suiteFile&gt;${suiteFile}&lt;/suiteFile&gt;
      &lt;numAdults&gt;${numAdults}&lt;/numAdults&gt;
  &lt;/properties&gt;
  //...........
  &lt;systemPropertyVariables&gt;
      &lt;numAdults&gt;${numAdults}&lt;/numAdults&gt;
  &lt;/systemPropertyVariables&gt;
  </code></pre>
  
  <p>The build fails with:</p>
  
  <pre><code>java.lang.NumberFormatException: For input string: "$numOfAdults"
  </code></pre>
  
  <p>I'm sure there is an obvious answer (and solution) - the code runs fine in the IDE.  Is there a better / safer way to pass or convert variables via Runtime?  I have a need to expose the variables in dropdown boxes so non technical staff can run the tests with different data. </p>
  
  <p>The value is passed via Jenkins Build with Parameters:
  <a href="https://i.stack.imgur.com/hl0EN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hl0EN.png" alt="enter image description here"></a></p>