简体   繁体   中英

Eiffel: Error: type is based on unknown class

Trying to implement some test cases on EWF application with rest web services and JSON objects, I'm gettint a Error: type is based on unknown class. after adding my first class inheriting from EQA_TEST_SET

Seems pretty complicated to implement test cases for a simple curl -v --header "Content-Type: application/json" --request POST --data '{"id":11,"name":"someName","enumerate":{"id":5}}' http://localhost:9997/someEntity curl command! How can I do that? Where is there some example? I'm trying to copy-paste the example from $ISE_LIBRARY/contrib/library/web/framework/ewf/wsf/tests/src/test_wsf_request.e as a base, but for the moment....

I can find the class when browsing the dependencies as shown in screenshot, but the compiler not! strange behaviour!

My 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>

My error

在此处输入图片说明

The library testing should be added to the list of libraries of the target for which you want to run tests. The presence of the class EQA_TEST_SET in the system does not mean it is automatically available to the class TEST_WSF_REQUEST . The corresponding library should be included explicitly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM