@@ -0,0 +1,3101 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * %0A */%0A%0A/**%0A * Package to test FileServer methods %0A */%0A     %0Apackage org.apache.jmeter.config;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.jmeter.junit.JMeterTestCase;%0Aimport org.apache.jmeter.threads.JMeterContext;%0Aimport org.apache.jmeter.threads.JMeterContextService;%0Aimport org.apache.jmeter.threads.JMeterVariables;%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class TestRandomVariableConfig extends JMeterTestCase %7B%0A%0A    private JMeterVariables threadVars;%0A    %0A    private static final String MIN_VALUE = %220%22;%0A    private static final String MAX_VALUE = %2210%22;%0A    RandomVariableConfig config = new RandomVariableConfig();%0A%0A    @Before%0A    public void setUp()%7B%0A        JMeterContext jmcx = JMeterContextService.getContext();%0A        jmcx.setVariables(new JMeterVariables());%0A        threadVars = jmcx.getVariables();        %0A        config.setRandomSeed(%22abcd%22);%0A        config.setVariableName(%22randomVar%22);%0A%0A    %7D%0A%0A    @After%0A    public void tearDown() throws IOException%7B%0A    %7D%0A    %0A    @Test%0A    public void testRandom() throws Exception %7B%0A        config.setMinimumValue(MIN_VALUE);%0A        config.setMaximumValue(MAX_VALUE);%0A        for (int i = 0; i %3C 100;i++) %7B%0A            config.iterationStart(null);%0A            String value = threadVars.get(%22randomVar%22);%0A            Assert.assertNotNull(threadVars.get(%22randomVar%22));%0A            int numericValue = Integer.parseInt(value);%0A            Assert.assertTrue(%22value:%22+numericValue+%22 is not in range %5B%22+MIN_VALUE+%22,%22+MAX_VALUE+%22%5D%22, %0A                    numericValue %3E=0 && numericValue %3C=10);            %0A        %7D%0A    %7D%0A    %0A    @Test%0A    public void testRandomWithFormat() throws Exception %7B%0A        config.setMinimumValue(MAX_VALUE);%0A        config.setMaximumValue(MAX_VALUE);%0A        config.setOutputFormat(%22000.00%22);%0A        config.iterationStart(null);%0A        String value = threadVars.get(%22randomVar%22);%0A        Assert.assertNotNull(threadVars.get(%22randomVar%22));%0A        Assert.assertEquals(%22010.00%22, value);%0A%0A    %7D%0A    %0A    @Test%0A    public void testInvalidRange() throws Exception %7B%0A        config.setMinimumValue(MAX_VALUE);%0A        config.setMaximumValue(MIN_VALUE);%0A        config.iterationStart(null);%0A        Assert.assertNull(threadVars.get(%22randomVar%22));%0A    %7D%0A%0A%7D%0A

Add test for Random Variable