sebb        2005/04/08 16:43:28

  Modified:    src/components/org/apache/jmeter/config CSVDataSet.java
                        CSVDataSetBeanInfo.java
                        CSVDataSetResources.properties
  Log:
  Allow user to specify delimiter to be used when parsing the file
  
  Revision  Changes    Path
  1.3       +16 -2     
jakarta-jmeter/src/components/org/apache/jmeter/config/CSVDataSet.java
  
  Index: CSVDataSet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/config/CSVDataSet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CSVDataSet.java   4 Jan 2005 19:30:16 -0000       1.2
  +++ CSVDataSet.java   8 Apr 2005 23:43:28 -0000       1.3
  @@ -41,7 +41,9 @@
       
       transient String filename;
       transient String variableNames;
  -    transient private String[] vars;
  +     transient String delimiter;
  +
  +     transient private String[] vars;
       
   
       /* (non-Javadoc)
  @@ -57,7 +59,9 @@
           }
           try
           {
  -            String[] lineValues = 
JOrphanUtils.split(server.readLine(getFilename()),",");
  +                     String delim=getDelimiter();
  +                     if (delim.equals("\\t")) delim="\t";// Make it easier 
to enter a Tab
  +            String[] lineValues = 
JOrphanUtils.split(server.readLine(getFilename()),delim);
                for(int a = 0;a < vars.length && a < lineValues.length;a++)
                {
                    
this.getThreadContext().getVariables().put(vars[a],lineValues[a]);
  @@ -97,4 +101,14 @@
       {
           this.variableNames = variableNames;
       }
  +
  +     public String getDelimiter() {
  +             return delimiter;
  +     }
  +     
  +
  +     public void setDelimiter(String delimiter) {
  +             this.delimiter = delimiter;
  +     }
  +     
   }
  
  
  
  1.3       +5 -1      
jakarta-jmeter/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java
  
  Index: CSVDataSetBeanInfo.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/config/CSVDataSetBeanInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CSVDataSetBeanInfo.java   4 Jan 2005 19:29:56 -0000       1.2
  +++ CSVDataSetBeanInfo.java   8 Apr 2005 23:43:28 -0000       1.3
  @@ -36,7 +36,7 @@
       public CSVDataSetBeanInfo()
       {
           super(CSVDataSet.class);
  -        createPropertyGroup("csv_data",new 
String[]{"filename","variableNames"});
  +        createPropertyGroup("csv_data",new 
String[]{"filename","variableNames","delimiter"});
           PropertyDescriptor p = property("filename");
           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
           p.setValue(DEFAULT, "");
  @@ -45,5 +45,9 @@
           p.setValue(NOT_UNDEFINED, Boolean.TRUE);
           p.setValue(DEFAULT, "");
           p.setValue(NOT_EXPRESSION,Boolean.TRUE);
  +        p = property("delimiter");
  +        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
  +        p.setValue(DEFAULT, ",");
  +        p.setValue(NOT_EXPRESSION,Boolean.TRUE);
       }
   }
  
  
  
  1.2       +4 -2      
jakarta-jmeter/src/components/org/apache/jmeter/config/CSVDataSetResources.properties
  
  Index: CSVDataSetResources.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/config/CSVDataSetResources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CSVDataSetResources.properties    19 Oct 2004 20:08:19 -0000      1.1
  +++ CSVDataSetResources.properties    8 Apr 2005 23:43:28 -0000       1.2
  @@ -1,6 +1,8 @@
   displayName=CSV Data Set Config
  -csv_data.displayName=Configure you CSV Data Source
  +csv_data.displayName=Configure the CSV Data Source
   filename.displayName=Filename
   filename.shortDescription=Name of the file (within your supporting file 
directory) that holds cvs data
   variableNames.displayName=Variable Names (comma-delimited)
  -variableNames.shortDescription=List your variable names in order to match 
the order of columns in your csv data.  Separate by commas.
  \ No newline at end of file
  +variableNames.shortDescription=List your variable names in order to match 
the order of columns in your csv data.  Separate by commas.
  +delimiter.displayName=Delimiter (use \t for tab)
  +delimiter.shortDescription=Enter the delimiter (\t for tab)
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to