Home » jakarta-jmeter-2.3.4_src » org.apache.jmeter.config » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    * http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   13    * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   14    * License for the specific language governing permissions and limitations
   15    * under the License.
   16    *
   17    */
   18   
   19   package org.apache.jmeter.config;
   20   
   21   import java.beans.PropertyDescriptor;
   22   
   23   import org.apache.jmeter.testbeans.BeanInfoSupport;
   24   
   25   public class RandomVariableConfigBeanInfo extends BeanInfoSupport {
   26   
   27       // These group names must have .displayName properties
   28       private static final String VARIABLE_GROUP = "variable"; // $NON-NLS-1$
   29       private static final String OPTIONS_GROUP = "options"; // $NON-NLS-1$
   30       private static final String RANDOM_GROUP = "random"; // $NON-NLS-1$
   31   
   32       // These variable names must have .displayName properties and agree with the getXXX()/setXXX() methods
   33       private static final String PER_THREAD = "perThread"; // $NON-NLS-1$
   34       private static final String RANDOM_SEED = "randomSeed"; // $NON-NLS-1$
   35       private static final String MAXIMUM_VALUE = "maximumValue"; // $NON-NLS-1$
   36       private static final String MINIMUM_VALUE = "minimumValue"; // $NON-NLS-1$
   37       private static final String OUTPUT_FORMAT = "outputFormat"; // $NON-NLS-1$
   38       private static final String VARIABLE_NAME = "variableName"; // $NON-NLS-1$
   39   
   40       public    RandomVariableConfigBeanInfo() {
   41           super(RandomVariableConfig.class);
   42   
   43           PropertyDescriptor p;
   44   
   45           createPropertyGroup(VARIABLE_GROUP, new String[] { VARIABLE_NAME, OUTPUT_FORMAT, });
   46   
   47           p = property(VARIABLE_NAME);
   48           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
   49           p.setValue(DEFAULT, ""); // $NON-NLS-1$
   50   
   51           p = property(OUTPUT_FORMAT);
   52           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
   53           p.setValue(DEFAULT, ""); // $NON-NLS-1$
   54   
   55           createPropertyGroup(RANDOM_GROUP,
   56           new String[] { MINIMUM_VALUE, MAXIMUM_VALUE, RANDOM_SEED, });
   57   
   58           p = property(MINIMUM_VALUE);
   59           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
   60           p.setValue(DEFAULT, "1"); // $NON-NLS-1$
   61   
   62           p = property(MAXIMUM_VALUE);
   63           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
   64           p.setValue(DEFAULT, ""); // $NON-NLS-1$
   65   
   66           p = property(RANDOM_SEED);
   67           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
   68           p.setValue(DEFAULT, ""); // $NON-NLS-1$
   69   
   70           createPropertyGroup(OPTIONS_GROUP, new String[] { PER_THREAD, });
   71   
   72           p = property(PER_THREAD);
   73           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
   74           p.setValue(NOT_EXPRESSION, Boolean.TRUE);
   75           p.setValue(NOT_OTHER, Boolean.TRUE);
   76           p.setValue(DEFAULT, Boolean.FALSE);
   77       }
   78   }

Home » jakarta-jmeter-2.3.4_src » org.apache.jmeter.config » [javadoc | source]