
org.vebqa.vebtal.icomp.commands.Close Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vebtal-imagecompare Show documentation
Show all versions of vebtal-imagecompare Show documentation
Tests for comparing images and provides user interfaces with junit / assertj or keyword driven approach
The newest version!
package org.vebqa.vebtal.icomp.commands;
import org.vebqa.vebtal.annotations.Keyword;
import org.vebqa.vebtal.command.AbstractCommand;
import org.vebqa.vebtal.icomp.ImageDriver;
import org.vebqa.vebtal.icomprestserver.IcompTestAdaptionPlugin;
import org.vebqa.vebtal.model.CommandType;
import org.vebqa.vebtal.model.Response;
@Keyword(module = IcompTestAdaptionPlugin.ID, command = "Close")
public class Close extends AbstractCommand {
public Close(String aCommand, String aTarget, String aValue) {
super(aCommand, aTarget, aValue);
this.type = CommandType.ACTION;
}
@Override
public Response executeImpl(Object driver) {
ImageDriver imgDriver = (ImageDriver)driver;
Response tResp = new Response();
if (!imgDriver.isInitialized()) {
tResp.setCode(Response.FAILED);
tResp.setMessage("OpenCV not initialized. Libraries not loaded yet.");
return tResp;
}
if (!imgDriver.isLoaded()) {
tResp.setCode(Response.FAILED);
tResp.setMessage("No opened file - cannot close.");
return tResp;
}
imgDriver.close();
tResp.setCode(Response.PASSED);
tResp.setMessage("Image closed.");
return tResp;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy