Forum Discussion
aepdwm
13 years agoNew Contributor
first best thanks for your help, I have found the file and was able to further analyze the problem.
Addendum, what I've found so far:
If I disable the property "leave_MockEngine", then the connector is closed before the MockResponse is sent to the server.
The StopMockService () function is called before the MockResponse is passed to the SoapUIHttpClient.
If the property "leave_MockEngine" is disabled, the connector is stopped and no response passed to the SoapUIHttpClient.
If the "leave_MockEngine" property is enabled, only the MockRunner is removed but the Connector is still running and the response will sent (passed to the SoapUIHttpClient)
My approach:
To close the connector at the end of the test, I created an additional function that I call via groovy step at the end of the case.
Function, which i have created in the JettyMockEngine Class:
Groovy Script:
Now to my questions:
I've downloaded the source files from the git and tested my modification with the following command "mvn exec: java". But how can I create an install file from this project?
Thanks a lot and regards.
aepdwm
Addendum, what I've found so far:
If I disable the property "leave_MockEngine", then the connector is closed before the MockResponse is sent to the server.
The StopMockService () function is called before the MockResponse is passed to the SoapUIHttpClient.
If the property "leave_MockEngine" is disabled, the connector is stopped and no response passed to the SoapUIHttpClient.
If the "leave_MockEngine" property is enabled, only the MockRunner is removed but the Connector is still running and the response will sent (passed to the SoapUIHttpClient)
My approach:
To close the connector at the end of the test, I created an additional function that I call via groovy step at the end of the case.
Function, which i have created in the JettyMockEngine Class:
public boolean stopConnector( Integer port ) throws Exception
{
synchronized( server )
{
SoapUIConnector connector = connectors.get( port );
if( connector == null )
{
log.warn( "Missing connectors on port [" + port + "]" );
return false;
}
else
{
try
{
log.info( "Stopping connector on port [" + port + "]" );
connector.stop();
}
catch( Exception e )
{
SoapUI.logError( e );
}
server.removeConnector( connector );
runners.remove( port );
return true;
}
}
}
Groovy Script:
import com.eviware.soapui.SoapUI
SoapUI.getMockEngine().stopConnector(8080)
Now to my questions:
I've downloaded the source files from the git and tested my modification with the following command "mvn exec: java". But how can I create an install file from this project?
Thanks a lot and regards.
aepdwm