You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2006/05/01 16:45:55 UTC
svn commit: r398608 - in /jakarta/jmeter/branches/rel-2-1:
src/core/org/apache/jmeter/engine/util/CompoundVariable.java
src/functions/org/apache/jmeter/functions/StringFromFile.java
xdocs/usermanual/functions.xml
Author: sebb
Date: Mon May 1 07:45:53 2006
New Revision: 398608
URL: http://svn.apache.org/viewcvs?rev=398608&view=rev
Log:
Renamed _StringFromFile as __StringFromFile (keeping old name as alias)
Modified:
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
jakarta/jmeter/branches/rel-2-1/src/functions/org/apache/jmeter/functions/StringFromFile.java
jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml
Modified: jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/engine/util/CompoundVariable.java?rev=398608&r1=398607&r2=398608&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/engine/util/CompoundVariable.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/engine/util/CompoundVariable.java Mon May 1 07:45:53 2006
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2004 The Apache Software Foundation.
+ * Copyright 2003-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@
* CompoundFunction.
*
* @author mstover
- * @version $Id$
*/
public class CompoundVariable implements Function {
private static final Logger log = LoggingManager.getLoggerForClass();
@@ -63,7 +62,12 @@
Iterator iter = classes.iterator();
while (iter.hasNext()) {
Function tempFunc = (Function) Class.forName((String) iter.next()).newInstance();
- functions.put(tempFunc.getReferenceKey(), tempFunc.getClass());
+ String referenceKey = tempFunc.getReferenceKey();
+ functions.put(referenceKey, tempFunc.getClass());
+ // TODO: find better way to include aliases for rename of function(s)
+ if (referenceKey.equals("__StringFromFile")){//$NON-NLS-1$
+ functions.put("_StringFromFile", tempFunc.getClass());//$NON-NLS-1$
+ }
}
} catch (Exception err) {
log.error("", err);
Modified: jakarta/jmeter/branches/rel-2-1/src/functions/org/apache/jmeter/functions/StringFromFile.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/functions/org/apache/jmeter/functions/StringFromFile.java?rev=398608&r1=398607&r2=398608&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/functions/org/apache/jmeter/functions/StringFromFile.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/functions/org/apache/jmeter/functions/StringFromFile.java Mon May 1 07:45:53 2006
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2004 The Apache Software Foundation.
+ * Copyright 2003-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,28 +40,31 @@
/**
* StringFromFile Function to read a String from a text file.
*
- * Parameters: - file name - variable name (optional - defaults to
- * StringFromFile_)
- *
- * Returns: - the next line from the file - or **ERR** if an error occurs -
- * value is also saved in the variable for later re-use.
+ * Parameters:
+ * - file name
+ * - variable name (optional - defaults to StringFromFile_)
+ *
+ * Returns:
+ * - the next line from the file
+ * - or **ERR** if an error occurs
+ * - value is also saved in the variable for later re-use.
*
* Ensure that different variable names are used for each call to the function
*
*
- * Notes: - JMeter instantiates a copy of each function for every reference in a
- * Sampler or elsewhere; each instance will open its own copy of the the file -
- * the file name is resolved at file (re-)open time - the output variable name
- * is resolved every time the function is invoked
+ * Notes:
+ * - JMeter instantiates a copy of each function for every reference in a
+ * Sampler or elsewhere; each instance will open its own copy of the the file
+ * - the file name is resolved at file (re-)open time
+ * - the output variable name is resolved every time the function is invoked
*
- * @version $Revision$ Updated on: $Date$
*/
public class StringFromFile extends AbstractFunction implements Serializable, TestListener {
private static final Logger log = LoggingManager.getLoggerForClass();
private static final List desc = new LinkedList();
- private static final String KEY = "_StringFromFile";//$NON-NLS-1$
+ private static final String KEY = "__StringFromFile";//$NON-NLS-1$
// Function name (only 1 _)
Modified: jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml?rev=398608&r1=398607&r2=398608&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml (original)
+++ jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml Mon May 1 07:45:53 2006
@@ -228,8 +228,8 @@
</component>
<!-- Alternate spelling -->
-<a name="__StringFromFile"/>
-<component index="§-num;.5.5" name="_StringFromFile">
+<a name="_StringFromFile"/>
+<component index="§-num;.5.5" name="__StringFromFile">
<description>
<p>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org