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

org.vebqa.vebtal.AbstractTestAdaptionResource Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package org.vebqa.vebtal;

import java.util.Calendar;

import org.vebqa.vebtal.model.Command;
import org.vebqa.vebtal.model.Response;

public class AbstractTestAdaptionResource implements TestAdaptionResource {

	private Long startTime;
	private Long finishTime;
	
	public AbstractTestAdaptionResource() {
		startTime = 0L;
		finishTime = 0L;
	}
	
	@Override
	public Response execute(Command aCmd) {
		throw new UnsupportedOperationException();
	}

	@Override
	public String getCommandClassName(Command aCmd) {
		// Test - to be refactored
		// Command instanziieren
		// erst alles klein schreiben
		String tCmd = aCmd.getCommand().toLowerCase().trim();
		// erster Buchstabe gross
		String cmdFL = tCmd.substring(0, 1).toUpperCase(); 
		String cmdRest = tCmd.substring(1);
		return cmdFL + cmdRest;
	}

	
	@Override
	public Long getDuration() {
		return finishTime - startTime;
	}

	@Override
	public void setStart() {
		startTime = Calendar.getInstance().getTimeInMillis();
	}

	@Override
	public void setFinished() {
		finishTime = Calendar.getInstance().getTimeInMillis();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy