All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simple4j.wsfeeler.model.DelayStep Maven / Gradle / Ivy

Go to download

This is a simple end to end Web Service Testing library to test wide variety of web service. It supports hierarchy of test cases and test steps with wiring of request response objects using templated variable replacement. The test steps can be Web Service or DB call out of the box with capability to extend to other test steps. The DB steps are for data setup and assertion of values from the DB.

There is a newer version: 24.12.04.1
Show newest version
package org.simple4j.wsfeeler.model;

import java.io.File;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DelayStep extends TestStep
{

	private static Logger logger = LoggerFactory.getLogger(DelayStep.class);

	public DelayStep(Map testStepInputVariables, File testStepInputFile, TestCase parent,
			TestSuite testSuite)
	{
		super(testStepInputVariables, testStepInputFile, parent, testSuite);
	}

	@Override
	public boolean execute()
	{
		logger.info("Entering execute:{}", this.name);
		try
		{
	    	Object delayMilliSecondsObj = this.testStepVariables.get("delayMilliSeconds");
	    	if(delayMilliSecondsObj != null)
	    	{
	    		long delayMilliSeconds = Long.parseLong((String) delayMilliSecondsObj);
	    		Thread.sleep(delayMilliSeconds);
	    	}
			
		} catch (InterruptedException e)
		{
			throw new RuntimeException(e);
		}
		finally
		{
			logger.info("Exiting execute:{}", this.name);
		}
		this.setSuccess(true);
		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy