You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by ag...@apache.org on 2017/09/01 08:48:32 UTC

svn commit: r1806898 - in /jmeter/trunk: src/core/org/apache/jmeter/resources/messages.properties src/core/org/apache/jmeter/resources/messages_fr.properties xdocs/changes.xml xdocs/usermanual/functions.xml

Author: agomes
Date: Fri Sep  1 08:48:32 2017
New Revision: 1806898

URL: http://svn.apache.org/viewvc?rev=1806898&view=rev
Log:
This closes #303 : Add a random date within a specific date range function

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/functions.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1806898&r1=1806897&r2=1806898&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Fri Sep  1 08:48:32 2017
@@ -243,6 +243,8 @@ database_sql_query_title=JDBC SQL Query
 database_testing_title=JDBC Request
 database_url=JDBC URL\:
 database_url_jdbc_props=Database URL and JDBC Driver
+date_end=End date
+date_start=Start date (optional) (default: now)
 date_to_shift=Date to shift (optional) (default \: now )
 ddn=DN
 de=German
@@ -1185,6 +1187,7 @@ throughput_control_perthread_label=Per U
 throughput_control_title=Throughput Controller
 throughput_control_tplabel=Throughput
 time_format=Format string for SimpleDateFormat (optional)
+time_format_random=Format string for DateTimeFormatter (optional) (default yyyy-MM-dd)
 time_format_shift=Format string for DateTimeFormatter (optional) ( default unix timestamp in millisecond )
 timelim=Time limit
 timeout_config_box_title=Timeout configuration

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1806898&r1=1806897&r2=1806898&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Fri Sep  1 08:48:32 2017
@@ -238,6 +238,8 @@ database_sql_query_title=Requ\u00EAte SQ
 database_testing_title=Requ\u221A\u2122te JDBC
 database_url=URL JDBC\:
 database_url_jdbc_props=URL et driver JDBC de la base de donn\u221A\u00A9es
+date_end=Date de fin
+date_start=Date de d\u00E9but (d\u00E9faut \: maintenant) (optionnel)
 date_to_shift=Date sur laquelle on applique le d\u00E9callage (optionnel) (d\u00E9faut \: maintenant )
 ddn=DN \:
 de=Allemand
@@ -1175,6 +1177,7 @@ throughput_control_perthread_label=Par u
 throughput_control_title=Contr\u00F4leur D\u00E9bit
 throughput_control_tplabel=D\u00E9bit \:
 time_format=Cha\u00EEne de formatage sur le mod\u00E8le SimpleDateFormat (optionnel)
+time_format_random=Cha\u00EEne de formatage sur le mod\u00E8le DateTimeFormatter (optionnel) ( d\u00E9faut \: yyyy-MM-dd )
 time_format_shift=Cha\u00EEne de formatage sur le mod\u00E8le DateTimeFormatter (optionnel) ( d\u00E9faut \: unix timestamp en millisecondes )
 timelim=Limiter le temps de r\u00E9ponses \u00E0 (ms)
 timeout_config_box_title=Configuration du d\u00E9lai d'expiration

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1806898&r1=1806897&r2=1806898&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Fri Sep  1 08:48:32 2017
@@ -126,6 +126,7 @@ Incorporated feed back about unclear doc
 <ul>
     <li><bug>61040</bug>Add a time shifting function</li>
     <li><bug>61126</bug>Function Helper Dialog : Add a field that shows execution result</li>
+    <li>Add a random date within a specific date range function</li>
 </ul>
 
 <h3>I18N</h3>

Modified: jmeter/trunk/xdocs/usermanual/functions.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/functions.xml?rev=1806898&r1=1806897&r2=1806898&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/functions.xml (original)
+++ jmeter/trunk/xdocs/usermanual/functions.xml Fri Sep  1 08:48:32 2017
@@ -123,6 +123,7 @@ Alternatively, just use <code>/</code> i
         <tr><td>Calculation</td><td> <a href="#__intSum">intSum</a></td><td>add int numbers</td><td>1.8.1</td></tr>
         <tr><td>Calculation</td><td> <a href="#__longSum">longSum</a></td><td>add long numbers</td><td>2.3.2</td></tr>
         <tr><td>Calculation</td><td> <a href="#__Random">Random</a></td><td>generate a random number</td><td>1.9</td></tr>
+        <tr><td>Calculation</td><td> <a href="#__RandomDate">RandomDate</a></td><td>generate random date within a specific date range</td><td>3.3</td></tr>
         <tr><td>Calculation</td><td> <a href="#__RandomFromMultipleVars">RandomFromMultipleVars</a></td><td>extracts an element from the values of a set of variables separated by <code>|</code></td><td>3.1</td></tr>
         <tr><td>Calculation</td><td> <a href="#__RandomString">RandomString</a></td><td>generate a random string</td><td>2.6</td></tr>
         <tr><td>Calculation</td><td> <a href="#__UUID">UUID</a></td><td>generate a random type 4 UUID</td><td>2.9</td></tr>
@@ -638,6 +639,27 @@ the comma after <code>7</code> is escape
 </p>
 </component>
 
+<component index="&sect-num;.5.8" name="__RandomDate">
+<description><p>The randomDate function returns a random date that lies between the given start date and end date values.</p></description>
+
+<properties>
+        <property name="Time format" required="No">Format string for DateTimeFormatter (default yyyy-MM-dd)</property>
+        <property name="Start date" required="No">The start date, the default is now</property>
+        <property name="End date" required="Yes">The end date</property>
+        <property name="Locale to use for format" required="No">
+        The string format of a locale. The language code must be lowercase. The country code must be uppercase. The separator must be an underscore. ex: en_EN
+        See http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html
+        If omitted, by default the function use the ApacheJMeter locale one.
+        </property>
+        <property name="Name of variable" required="No">The name of the variable to set.</property>
+</properties>
+
+<p>Examples:
+<source>${__randomDate(,,2050-07-08,,)}</source> will return a random date between now and 2050-07-08. For example 2039-06-21<br/>
+<source>${__randomDate(dd MM yyyy,,08 07 2050,,)}</source> will return a random date like 04 03 2034<br/>
+</p>
+</component>
+
 <component index="&sect-num;.5.8" name="__RandomString">
 <description><p>The RandomString function returns a random String of length using characters in chars to use.</p></description>