On 08/12/2009, Ronan Klyne <[email protected]> wrote:
> sebb wrote:
>
> >
> > >
> > > >
> > > > >
> > > > > > Thread Group - Ramp Up.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >  All of those are of this form:
> > > > >
> > > > >  ${__javaScript(2*${ramp_up_secs_per_thread})}
> > > > >
> > > > >  Is it allowed to nest the '${}' construct in this way?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > Yes.
> > > >
> > > > The error message suggests you may have used:
> > > >
> > > > ${__javaScript(2*${ramp_up_secs_per_thread}}
> > > > or
> > > > ${__javaScript(2*${ramp_up_secs_per_thread}})
> > > >
> > > > by mistake, i.e. misplaced ')'
> > > >
> > > >
> > > >
> > > >
> > > >
> > >  I've checked all my thread groups, and they all have the correct syntax
> :-s
> > > ...
> > >
> > >  Since it was the only thing in that broken expression, I tried changing
> > > "ramp_up_secs_per_thread" to be some integer constant, and everything
> > > works...
> > >
> > >  This variable is currently set in the test plan to be
> > > "${__P(ramp_up,__javaScript(${dev_mode}?0:5))}"
> > >
> > >  Does that look OK?
> > >
> > >
> >
> > No, because the default for ramp_up is the string
> > "__javaScript(${dev_mode}?0:5)"
> >
> > If you want the default to be a function, you need to use the ${} wrapper,
> i.e.
> >
> > "${__P(ramp_up,${__javaScript(${dev_mode}?0:5)})}"
> >
> >
>  I now understand the use of ${} slightly better than I did before. Does
> that construct have a name? I couldn't pick the right one to find docs for
> it...
>
>  Now that I've corrected that, I get a alert box saying "error compiling the
> tree - see log file". This is the corresponding log file entry:
>
>  2009/12/08 15:28:55 ERROR -
> jmeter.engine.StandardJMeterEngine: Error occurred
> compiling the tree:
> org.mozilla.javascript.EvaluatorException: missing ; before
> statement (<cmd>#1)

IIRC, that error is caused by trailing blank(s) in the JS script.

>    at
> org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:98)
>    at
> org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:85)
>    at
> org.mozilla.javascript.Parser.addError(Parser.java:126)
>    at
> org.mozilla.javascript.Parser.reportError(Parser.java:132)
>    at
> org.mozilla.javascript.Parser.statementHelper(Parser.java:1175)
>    at
> org.mozilla.javascript.Parser.statement(Parser.java:623)
>    at org.mozilla.javascript.Parser.parse(Parser.java:355)
>    at org.mozilla.javascript.Parser.parse(Parser.java:293)
>    at
> org.mozilla.javascript.Context.compileImpl(Context.java:2238)
>    at
> org.mozilla.javascript.Context.compileString(Context.java:1284)
>    at
> org.mozilla.javascript.Context.compileString(Context.java:1273)
>    at
> org.mozilla.javascript.Context.evaluateString(Context.java:1129)
>    at
> org.apache.jmeter.functions.JavaScript.execute(JavaScript.java:89)
>    at
> org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:143)
>    at
> org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:112)
>    at
> org.apache.jmeter.functions.Property2.execute(Property2.java:76)
>    at
> org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:143)
>    at
> org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:112)
>    at
> org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:80)
>    at
> org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsString(AbstractTestElement.java:213)
>    at
> org.apache.jmeter.config.Argument.getValue(Argument.java:111)
>    at
> org.apache.jmeter.config.Arguments.getArgumentsAsMap(Arguments.java:90)
>    at
> org.apache.jmeter.testelement.TestPlan.getUserDefinedVariables(TestPlan.java:140)
>    at
> org.apache.jmeter.engine.PreCompiler.addNode(PreCompiler.java:88)
>    at
> org.apache.jorphan.collections.HashTree.traverse(HashTree.java:966)
>    at
> org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:391)
>    at java.lang.Thread.run(Unknown Source)
>
>  I can see that it's processing the UDV section of the test plan element,
> and that it's fallen through to evaulating the second argument to __P. I
> can't tell what's gone wrong inside here though...
>  Might I prevail upon you again for some more help?
>
>
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> [email protected]
>  For additional commands, e-mail:
> [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to