Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse WSO2 EI-集成工作室单元测试配置_Eclipse_Unit Testing_Wso2_Wso2esb_Wso2ei - Fatal编程技术网

Eclipse WSO2 EI-集成工作室单元测试配置

Eclipse WSO2 EI-集成工作室单元测试配置,eclipse,unit-testing,wso2,wso2esb,wso2ei,Eclipse,Unit Testing,Wso2,Wso2esb,Wso2ei,我正在尝试构建一个简单的测试套件,其中包含一个api工件的测试用例: 我创建了以下测试套件: <unit-test> <artifacts> <test-artifact> <artifact>/DevOps_Deploy/src/main/synapse-config/api/testEsbDevOps.xml</artifact> </test-ar

我正在尝试构建一个简单的测试套件,其中包含一个api工件的测试用例:

我创建了以下测试套件:

<unit-test>
         <artifacts>
          <test-artifact>
            <artifact>/DevOps_Deploy/src/main/synapse-config/api/testEsbDevOps.xml</artifact>
        </test-artifact>
        <supportive-artifacts/>
        <registry-resources/>
        <connector-resources/>
    </artifacts>
    <test-cases>
        <test-case name="TestOutput">
            <input>
                <request-path>/Project</request-path>
                <request-method>GET</request-method>
            </input>
            <assertions>
                <assertNotNull>
                    <actual>$body</actual>
                    <message>error</message>
                </assertNotNull>
            </assertions>
        </test-case>
    </test-cases>
    <mock-services/>
</unit-test>

/DevOps_Deploy/src/main/synapse config/api/testEsbDevOps.xml
/计划
得到
$body
错误
然后,为了运行单元测试,我输入了运行EI的服务器的ip和端口。但我得到了以下错误:

[INFO] U N I T - T E S T S

[INFO] ------------------------------------------------------------------------

[INFO] Detect 1 Synapse test case files to execute

[INFO] 

[error] Error in getting response from the synapse unit test agent

java.io.StreamCorruptedException: invalid stream header: 48545450
       at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:866)
       at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
       at org.wso2.synapse.unittest.TCPClient.readData(TCPClient.java:69)
       at org.wso2.synapse.unittest.UnitTestClient.executeTests(UnitTestClient.java:60)
       at org.wso2.synapse.unittest.UnitTestCasesMojo.testCaseRunner(UnitTestCasesMojo.java:143)
       at org.wso2.synapse.unittest.UnitTestCasesMojo.execute(UnitTestCasesMojo.java:78)
       at ...
..
[INFO] No test cases found in D:\Users\user\IntegrationStudio\workspace\MavenParentProjectDevOps\DevOps_Deploy\test\TestSuiteOne.xml unit test suite
[INFO]U I T-T S
[信息]------------------------------------------------------------------------
[信息]检测1个Synapse测试用例文件以执行
[信息]
[错误]从synapse单元测试代理获取响应时出错
java.io.StreamCorruptedException:无效的流头:485450
位于java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:866)
位于java.io.ObjectInputStream。(ObjectInputStream.java:358)
位于org.wso2.synapse.unittest.TCPClient.readData(TCPClient.java:69)
位于org.wso2.synapse.unittest.UnitTestClient.executeTests(UnitTestClient.java:60)
位于org.wso2.synapse.unittest.UnitTestCasesMojo.testCaseRunner(UnitTestCasesMojo.java:143)
位于org.wso2.synapse.unittest.UnitTestCasesMojo.execute(UnitTestCasesMojo.java:78)
在
..
[信息]在D:\Users\user\IntegrationStudio\workspace\MavenParentProjectDevOps\DevOps\u Deploy\test\TestSuiteOne.xml单元测试套件中未找到任何测试用例

我哪里出错了?

您是否使用
-DsynspaseTest
参数启动EI服务器,如下所示

对于windows:

integrator.bat -DsynapseTest
适用于Linux/MacOS

sh integrator.sh -DsynapseTest
注意-
如果您想将测试端口从默认9008更改为另一个,您可以在上述命令中另外使用
-dsynapsetstport=

您是否可以共享API配置,以查找其中的问题?