Java exception calling TestRunner

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Java exception calling TestRunner

cheolhyun.park
This post was updated on .
아래 코드에서 에러가 발생합니다. 원인 좀 알려주시면 감사하겠습니다!
--------------------------------------------------------------------------------------------------------
from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from net.grinder.plugin.http import HTTPPluginControl
 
test1 = Test(1, "mytest")
 
class TestRunner:
    # initlialize a thread
    def __init__(self):
        test1.record(TestRunner.__call__)
        grinder.statistics.delayReports=True
        pass
 
    # test method        
    def __call__(self):
        grinder.statistics.forLastTest.success = 1



--------------------------------------------------------------------------------------------------------

2018-01-15 17:46:47,471 ERROR Aborted run: Java exception calling TestRunner
net.grinder.scriptengine.jython.JythonScriptExecutionException: Java exception calling TestRunner
        grinder.statistics.forLastTest.success = 1
        File "${NGRINDER_HOME}/script/lp11603/wst.py", line 21, in __call__
Caused by: net.grinder.script.InvalidContextException: No tests have been performed by this thread.
        at net.grinder.engine.process.ScriptStatisticsImplementation.getForLastTest(ScriptStatisticsImplementation.java:130)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.python.core.PyBeanProperty._doget(PyBeanProperty.java:33)
        at org.python.core.PyObject._doget(PyObject.java:1072)
        at org.python.core.PyObject.__get__(PyObject.java:3674)
        at org.python.core.PyObject.object___findattr__(PyObject.java:3706)
        at org.python.core.PyObject.object___getattribute__(PyObject.java:3690)
        at org.python.core.PyObject$object___getattribute___exposer.__call__(Unknown Source)
        at org.python.core.Deriveds.__findattr_ex__(Deriveds.java:59)
        at org.python.core.PyObjectDerived.__findattr_ex__(PyObjectDerived.java:983)
        at org.python.core.PyObject.__getattr__(PyObject.java:923)
        at org.python.pycode._pyx1.__call__$3(${NGRINDER_HOME}/script/lp11603/wst.py:23)
        at org.python.pycode._pyx1.call_function(${NGRINDER_HOME}/script/lp11603/wst.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:194)
        at org.python.core.PyFunction.__call__(PyFunction.java:387)
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220)
        at org.python.core.PyMethod.__call__(PyMethod.java:211)
        at org.python.core.PyMethod.__call__(PyMethod.java:206)
        at org.python.core.PyObject.invoke(PyObject.java:3555)
        at org.python.core.PyInstance.instance___call__(PyInstance.java:351)
        at org.python.core.PyInstance.__call__(PyInstance.java:342)
        at org.python.core.PyObject.__call__(PyObject.java:371)
        at net.grinder.scriptengine.jython.JythonScriptEngine$JythonWorkerRunnable.run(JythonScriptEngine.java:250)
        at net.grinder.engine.process.GrinderThread.run(GrinderThread.java:118)
        at java.lang.Thread.run(Thread.java:745)