尝试使用其余的Web服务和JSON对象在EWF应用程序上实现一些测试用例,在添加了从Error: type is based on unknown class.
继承来的第一个类后,我得到了一个EQA_TEST_SET
/ p>
为一个简单的curl -v --header "Content-Type: application/json" --request POST --data '{"id":11,"name":"someName","enumerate":{"id":5}}' http://localhost:9997/someEntity
curl命令实现测试用例似乎非常复杂!我怎样才能做到这一点?哪里有例子?我正在尝试将示例从$ISE_LIBRARY/contrib/library/web/framework/ewf/wsf/tests/src/test_wsf_request.e
复制粘贴为基础,但是暂时。...
在浏览依赖项时可以找到该类,如屏幕快照所示,但是编译器找不到!奇怪的行为!
app_ewf_app.ecf
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-19-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-19-0 http://www.eiffel.com/developers/xml/configuration-1-19-0.xsd" name="sit_ewf_app" uuid="0AB55F0B-014A-4775-B93F-ACC31C9300D5">
<target name="common" abstract="true">
<file_rule>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<capability>
<catcall_detection support="none"/>
<concurrency support="scoop"/>
<void_safety support="all" use="all"/>
</capability>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf"/>
<library name="lexical" location="$ISE_LIBRARY\contrib\library\gobo\library\lexical\library.ecf"/>
<library name="logging" location="$ISE_LIBRARY\library\runtime\logging\logging.ecf"/>
<library name="odbc" location="$ISE_LIBRARY\library\store\dbms\rdbms\odbc\odbc.ecf"/>
<library name="store" location="$ISE_LIBRARY\library\store\store.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension.ecf"/>
<cluster name="database" location=".\database\" recursive="true"/>
<cluster name="entity" location=".\entity\" recursive="true"/>
<cluster name="error" location=".\error\" recursive="true"/>
<cluster name="handler" location=".\handler\" recursive="true"/>
<cluster name="logger" location=".\logger\" recursive="true"/>
<cluster name="misc" location=".\misc\" recursive="true"/>
<cluster name="relationship" location=".\relationship\" recursive="true"/>
<cluster name="rest" location=".\rest\" recursive="true"/>
<cluster name="service" location=".\service\" recursive="true"/>
<cluster name="sit-json" location=".\sit-json\" recursive="true"/>
<!-- TESTS -->
<cluster name="tests" location=".\tests\" recursive="true"/>
</target>
<target name="ewf_app_any" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<concurrency support="scoop"/>
</capability>
<library name="cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\cgi-safe.ecf"/>
<library name="libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\libfcgi-safe.ecf"/>
<library name="standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\standalone-safe.ecf"/>
<cluster name="launcher" location=".\launcher\">
<cluster name="any_launcher" location="$|any\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app_standalone" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<catcall_detection support="none"/>
<concurrency support="scoop"/>
<void_safety support="all"/>
</capability>
<variable name="httpd_ssl_disabled" value="true"/>
<library name="default_standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\standalone-safe.ecf"/>
<library name="eel" location="$ISE_LIBRARY\contrib\library\text\encryption\eel\eel.ecf"/>
<library name="ewsgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\ewsgi\ewsgi.ecf"/>
<library name="http_client" location="$ISE_LIBRARY\contrib\library\network\http_client\http_client.ecf"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/>
<cluster name="launcher" location=".\launcher\">
<cluster name="default_launcher" location="$|default\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app_cgi" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<concurrency support="scoop" use="none"/>
</capability>
<library name="default_cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\cgi-safe.ecf"/>
<cluster name="launcher" location=".\launcher\">
<cluster name="default_launcher" location="$|default\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app_libfcgi" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<concurrency support="scoop" use="none"/>
</capability>
<library name="default_libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\libfcgi-safe.ecf"/>
<cluster name="launcher" location=".\launcher\">
<cluster name="default_launcher" location="$|default\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app" extends="ewf_app_any">
</target>
</system>
答案 0 :(得分:1)
应该将库testing
添加到要为其运行测试的目标的库列表中。系统中存在类EQA_TEST_SET
并不意味着它可以自动用于类TEST_WSF_REQUEST
。应当明确包括相应的库。