Forum Discussion

albertzhou's avatar
albertzhou
New Contributor
11 years ago

test case working well in SoapUI but malfunction with JUnit

I have a simple Data-Driven test case. What it does is to loop the input data in a Excel spreadsheet and insert them into a MySQL table. It works well in SoapUI Pro v5.1.2. Now, I started to integrate the SoapUI test case with JUnit v3. For some reasons, the same data was NOT able to be inserted into database.

JUnit indicated that there were Runs:1/1 Errors:0 Failures:0.
The following information showed up on the Tomcat's console when I ran the JUnit test case in Eclipse.

- Could not find jfxrt.jar. Internal browser will be disabled.
20:30:26,119 WARN [SoapUI] Missing folder [C:\Users\Albert\MyJavaWorkspace\Luna\SoapuiTest\ext] for external libraries
20:30:26,426 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\Albert\soapui-settings.xml]
20:30:27,182 INFO [WsdlProject] Loaded project from [file:/C:/Users/Albert/Documents/GuestManagementServices-soapui-project.xml]
======Running test case: addMultipleGuest TestCase ===========
20:30:27,685 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
20:30:27,686 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /HotelReservation/services/GuestManagementService.GuestManagementServiceHttpSoap11Endpoint/ HTTP/1.1
20:30:27,701 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 500 Internal Server Error
20:30:27,711 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection shut down

For further troubleshooting, my codes are listed as follow:

package com.test.soapuitest;

import com.eviware.soapui.impl.wsdl.WsdlProjectPro;
import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
import com.eviware.soapui.model.support.PropertiesMap;
import com.eviware.soapui.model.testsuite.TestRunner;

import junit.framework.TestCase;

public class MathServiceSoapUITest extends TestCase {

public void testMathServiceSoapUITest() {
WsdlProjectPro myProject = new WsdlProjectPro(
"C:\\Users\\Albert\\Documents\\AddSubstractService-soapui-project.xml");
WsdlTestSuite myTestSuite = myProject
.getTestSuiteByName("OperationSoap11Binding TestSuite");
WsdlTestCase myTestCase = myTestSuite.getTestCaseByName("add TestCase");

System.out.println("======Running test case: " + myTestCase.getName() + " ===========");
TestRunner myTestRunner = myTestCase.run(new PropertiesMap(), false);
}
}
  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2
    Have you tried to find the reason why the following is seen in the log? And why this is being used?

    - Could not find jfxrt.jar.


    Also check whether service is running
    Receiving response: HTTP/1.1 500 Internal Server Error