public ProtocolDefinition(Protocol<?> protocol, Map<String, String> protocolConfiguration, boolean defaultProtocol) { Validate.notNull(protocol, "Protocol must be specified"); Validate.notNull(protocolConfiguration, "ProtocolConfiguration must be specified"); Validate.notNull(defaultProtocol, "DefaultProtocol must be specified"); this.protocol = protocol; this.protocolConfiguration = protocolConfiguration; this.defaultProtocol = defaultProtocol; }
public ContainerImpl(String name, DeployableContainer<?> deployableContainer, ContainerDef containerConfiguration) { Validate.notNull(name, "Name must be specified"); Validate.notNull(deployableContainer, "DeployableContainer must be specified"); Validate.notNull(containerConfiguration, "ConfigurationConfiguration must be specified"); this.name = name; this.deployableContainer = deployableContainer; this.containerConfiguration = containerConfiguration; }
public ContainerImpl(String name, DeployableContainer<?> deployableContainer, ContainerDef containerConfiguration) { Validate.notNull(name, "Name must be specified"); Validate.notNull(deployableContainer, "DeployableContainer must be specified"); Validate.notNull(containerConfiguration, "ConfigurationConfiguration must be specified"); this.name = name; this.deployableContainer = deployableContainer; this.containerConfiguration = containerConfiguration; }
public DeployerEvent(DeployableContainer<?> deployableContainer, DeploymentDescription deployment) { super(deployableContainer); Validate.notNull(deployment, "Deployment must be specified"); this.deployment = deployment; }
/** * Instantiates new locator with given jQuery selector * * @param selector the jQuery selector */ public ByJQuery(String selector) { Validate.notNull(selector, "Cannot find elements when selector is null!"); this.implementation = instantiate(selector); }
@Override public Screenshot takeScreenshot(File file) { Validate.notNull(file, "File is a null object!"); return takeScreenshot(file, screenshotType); }
public PhaseLifecycleEvent(PhaseId phaseId, When when) { Validate.notNull(phaseId, "phaseId must not be null"); this.phase = getPhase(phaseId); this.when = when; }
@Override public void stopActivity(Class<?> activity) throws NoMatchingWebDriverInstanceFoundException { Validate.notNull(activity, "Activity you want to stop can not be a null object!"); startActivity(activity.getName()); }
@Override public <T> T inject(T target) { Validate.notNull(target, "Target must be specified."); manager.inject(target); return target; } }
public void uninstallContainer(@Observes UninstallContainer event) { Validate.notNull(configuration, "fundamental test configuration is not setup"); if (configuration.containerShouldBeUninstalled()) { File containerHome = new File(configuration.getContainerHome()); log.info(String.format("The container will be uninstalled from '%s'", containerHome.getAbsolutePath())); if (containerHome.exists()) { FileUtils.deleteQuietly(containerHome); } } }
/** * Create a new ProtocolConfiguration based on given configuration. * * @throws Exception */ public ProtocolConfiguration createProtocolConfiguration(Map<String, String> configuration) throws Exception { Validate.notNull(configuration, "ProtocolConfiguration must be specified"); ProtocolConfiguration config = protocol.getProtocolConfigurationClass().newInstance(); MapObject.populate(config, configuration); return config; } }
public EventTestRunnerAdaptor(ManagerBuilder builder) { Validate.notNull(builder, "ManagerBuilder must be specified"); this.manager = builder.create(); this.manager.start(); }
@Override public void copyLog(String cubeId, boolean follow, boolean stdout, boolean stderr, boolean timestamps, int tail, OutputStream outputStream) { Cube<?> cube = cubeRegistry.get().getCube(cubeId); Validate.notNull(cube, "Cube with id '" + cubeId + "' to get logs command does not exist."); if (cube.hasMetadata(CanCopyFromContainer.class)) { cube.getMetadata(CanCopyFromContainer.class).copyLog(follow, stdout, stderr, timestamps, tail, outputStream); } else { throw new IllegalArgumentException( "Cube " + cubeId + " does not provide the " + CanCopyFromContainer.class.getSimpleName() + " metadata"); } }
@Override public TopContainer top(String cubeId) { Cube<?> cube = cubeRegistry.get().getCube(cubeId); Validate.notNull(cube, "Cube with id '" + cubeId + "' to get top command does not exist."); if (cube.hasMetadata(CanSeeTop.class)) { return cube.getMetadata(CanSeeTop.class).top(); } else { throw new IllegalArgumentException( "Cube " + cubeId + " does not provide the " + CanSeeTop.class.getSimpleName() + " metadata"); } }
@Override public Container getContainer(TargetDescription target) { Validate.notNull(target, "Target must be specified"); if (TargetDescription.DEFAULT.equals(target)) { return findDefaultContainer(); } return findMatchingContainer(target.getName()); }
@Override public Container getContainer(TargetDescription target) { Validate.notNull(target, "Target must be specified"); if (TargetDescription.DEFAULT.equals(target)) { return findDefaultContainer(); } return findMatchingContainer(target.getName()); }