* It is possible to temporarily "bypass" recipe execution by specifying
* a testserver.cucumber.silent property - in which case testcases will not be
* submitted to the server, but still logged to the above folder.
@@ -66,7 +66,7 @@ public CucumberRecipeExecutor() throws MalformedURLException {
* @param testCase the TestCase to execute
* @param scenario the Cucumber scenario used to generate the specified Recipe
* @return the TestServer Execution for the executed TestCase
- * @throws com.smartbear.readyapi.client.execution.ApiException if recipe execution failes
+ * @throws com.smartbear.readyapi4j.testserver.execution.ApiException if recipe execution failes
*/
public Execution runTestCase(TestCase testCase, Scenario scenario) {
@@ -77,12 +77,12 @@ public Execution runTestCase(TestCase testCase, Scenario scenario) {
LOG.debug(testRecipe.toString());
}
- String logFolder = System.getProperty( "testserver.cucumber.logfolder", null );
- if( scenario != null && logFolder != null ){
+ String logFolder = System.getProperty("testserver.cucumber.logfolder", null);
+ if (scenario != null && logFolder != null) {
logScenarioToFile(testRecipe, scenario, logFolder);
}
- return async ? executor.submitRecipe( testRecipe ) : executor.executeRecipe(testRecipe);
+ return async ? executor.submitRecipe(testRecipe) : executor.executeRecipe(testRecipe);
}
/**
@@ -90,14 +90,14 @@ public Execution runTestCase(TestCase testCase, Scenario scenario) {
* specified scenario
*
* @param testRecipe the test recipe to log
- * @param scenario the associated Cucumber scenario
- * @param logFolder the root folder for generated folders and files
+ * @param scenario the associated Cucumber scenario
+ * @param logFolder the root folder for generated folders and files
*/
protected void logScenarioToFile(TestRecipe testRecipe, Scenario scenario, String logFolder) {
try {
- File folder = new File( logFolder );
- if( !folder.exists() || !folder.isDirectory()){
+ File folder = new File(logFolder);
+ if (!folder.exists() || !folder.isDirectory()) {
folder.mkdirs();
}
@@ -105,7 +105,7 @@ protected void logScenarioToFile(TestRecipe testRecipe, Scenario scenario, Strin
File scenarioFolder = folder;
int fileIndex = 0;
- if( pathSegments.length > 1 ) {
+ if (pathSegments.length > 1) {
scenarioFolder = new File(folder, pathSegments[0]);
if (scenarioFolder.exists() || !scenarioFolder.isDirectory()) {
scenarioFolder.mkdirs();
@@ -115,25 +115,25 @@ protected void logScenarioToFile(TestRecipe testRecipe, Scenario scenario, Strin
}
String filename = pathSegments[fileIndex];
- for( int c = fileIndex+1; c < pathSegments.length; c++ ){
+ for (int c = fileIndex + 1; c < pathSegments.length; c++) {
String segment = pathSegments[c].trim();
- if( !StringUtils.isBlank( segment )){
+ if (!StringUtils.isBlank(segment)) {
filename += "_" + segment;
}
}
filename += ".json";
- File scenarioFile = new File( scenarioFolder, filename );
- FileWriter writer = new FileWriter( scenarioFile );
+ File scenarioFile = new File(scenarioFolder, filename);
+ FileWriter writer = new FileWriter(scenarioFile);
LOG.info("Writing recipe to " + folder.getName() + File.separatorChar + scenarioFolder.getName() +
- File.separatorChar + scenarioFile.getName());
+ File.separatorChar + scenarioFile.getName());
- writer.write( Json.pretty(testRecipe) );
+ writer.write(Json.pretty(testRecipe));
writer.close();
} catch (Exception e) {
- LOG.error("Failed to write recipe to logFolder [" + logFolder + "]", e );
+ LOG.error("Failed to write recipe to logFolder [" + logFolder + "]", e);
}
}
diff --git a/modules/core/src/main/java/com/smartbear/readyapi/testserver/cucumber/builders/TestSteps.java b/modules/core/src/main/java/com/smartbear/readyapi/testserver/cucumber/builders/TestSteps.java
index a88a230..8ad3e99 100644
--- a/modules/core/src/main/java/com/smartbear/readyapi/testserver/cucumber/builders/TestSteps.java
+++ b/modules/core/src/main/java/com/smartbear/readyapi/testserver/cucumber/builders/TestSteps.java
@@ -2,7 +2,7 @@
import com.smartbear.readyapi.client.model.RestTestRequestStep;
import com.smartbear.readyapi.client.model.SoapRequestTestStep;
-import com.smartbear.readyapi.client.teststeps.TestStepTypes;
+import com.smartbear.readyapi4j.teststeps.TestStepTypes;
/**
* Utility class with static method for building various types of TestSteps
@@ -10,7 +10,7 @@
public class TestSteps {
- public static RestTestRequestStep restRequest( String method, String endpoint ){
+ public static RestTestRequestStep restRequest(String method, String endpoint) {
RestTestRequestStep testStep = new RestTestRequestStep();
testStep.setURI(endpoint);
testStep.setMethod(method);
@@ -18,12 +18,12 @@ public static RestTestRequestStep restRequest( String method, String endpoint ){
return testStep;
}
- public static SoapRequestTestStep soapRequest( String wsdl, String operation, String binding ){
+ public static SoapRequestTestStep soapRequest(String wsdl, String operation, String binding) {
SoapRequestTestStep testStep = new SoapRequestTestStep();
- testStep.setWsdl( wsdl );
- testStep.setBinding( binding );
- testStep.setOperation( operation );
- testStep.setType( TestStepTypes.SOAP_REQUEST.getName());
+ testStep.setWsdl(wsdl);
+ testStep.setBinding(binding);
+ testStep.setOperation(operation);
+ testStep.setType(TestStepTypes.SOAP_REQUEST.getName());
return testStep;
}
}
diff --git a/modules/runner/pom.xml b/modules/runner/pom.xml
index 905d273..88d155c 100644
--- a/modules/runner/pom.xml
+++ b/modules/runner/pom.xml
@@ -9,19 +9,18 @@