Refine search
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; }
@Override public Screenshot takeScreenshot(String fileName, ScreenshotType type) { Validate.notNullOrEmpty(fileName, "File name is a null object or an empty string!"); Validate.notNull(type, "Type of screenshot is a null object!"); return takeScreenshot(new File(fileName), type); }
@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"); } }
/** * * @param deploymentName name of deployment, taken from {@code @Deployment} method * @param extensionQualifier extension qualifier for Drone extension which operates on the given deployment */ public void add(String deploymentName, String extensionQualifier) { Validate.notNullOrEmpty(deploymentName, "Deployment name can not be a null object!"); Validate.notNullOrEmpty(extensionQualifier, "Extension qualifier for deployment '" + deploymentName + "' can not be a null object!"); map.put(deploymentName, extensionQualifier); }
@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"); } }
/** * * @param activity activity to get the deployment name of * @return deployment name from {@code @Deployment} method where {@code activity} is located. * @throws IllegalArgumentException if {@code activity} is a null object or an empty string */ public String getDeploymentName(String activity) { Validate.notNullOrEmpty(activity, "The activity to want to know the deployment name of can not be a null object nor an empty string!"); return map.get(activity); }
@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"); } }
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; }
@Override public Screenshot takeScreenshot(String fileName, ScreenshotType type) { Validate.notNullOrEmpty(fileName, "File name is a null object or an empty string!"); Validate.notNull(type, "Type of screenshot is a null object!"); return takeScreenshot(new File(fileName), type); }
/** * * @param extensionQualifier qualifier of an extension in arqullian.xml you wan to get its Drone configuration of * @return Drone configuration of the extension specified by its {@code extensionQualifier} in arquillian.xml, null if * there is not such mapping for given {@code extensionQualifier} * @throws IllegalArgumentException if {@code extensionQualifier} is a null object or an empty string */ public DroneConfigurationHolder getConfiguration(String extensionQualifier) { Validate.notNullOrEmpty(extensionQualifier, "Extension qualifier you are trying to get the configuration of can not " + "be a null object nor an empty string!"); return map.get(extensionQualifier); }
@Override public void copyFileDirectoryFromContainer(String cubeId, String from, String to) { Cube<?> cube = cubeRegistry.get().getCube(cubeId); Validate.notNull(cube, "Cube with id '" + cubeId + "' to execute copy file command does not exist."); if (cube.hasMetadata(CanCopyFromContainer.class)) { cube.getMetadata(CanCopyFromContainer.class).copyDirectory(from, to); } else { throw new IllegalArgumentException( "Cube " + cubeId + " does not provide the " + CanCopyFromContainer.class.getSimpleName() + " metadata"); } }
/** * * @param deploymentName name of deployment (taken from {@code @Deployment method} to get instrumentation configuration of * @return instrumentation configuration for given {@code deploymentName}, null if there is no such mapping */ public InstrumentationConfiguration getDeploymentName(String deploymentName) { Validate.notNullOrEmpty(deploymentName, "Deployment name to get the instrumentation configuration of " + "can not be a null object nor an empty string!"); return map.get(deploymentName); }
@Override public void copyFileDirectoryFromContainer(String cubeId, String from, String to) { Cube<?> cube = cubeRegistry.get().getCube(cubeId); Validate.notNull(cube, "Cube with id '" + cubeId + "' to execute copy file command does not exist."); if (cube.hasMetadata(CanCopyFromContainer.class)) { cube.getMetadata(CanCopyFromContainer.class).copyDirectory(from, to); } else { throw new IllegalArgumentException( "Cube " + cubeId + " does not provide the " + CanCopyFromContainer.class.getSimpleName() + " metadata"); } }
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; }
private void initializeRedmineManager(String uri, String apiKey) { Validate.notNullOrEmpty(uri, "Redmine uri must be specified."); Validate.notNullOrEmpty(apiKey, "User apikey must be provided."); redmineManager = RedmineManagerFactory.createWithApiKey(uri, apiKey); }
@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"); } }
public DeployerEvent(DeployableContainer<?> deployableContainer, DeploymentDescription deployment) { super(deployableContainer); Validate.notNull(deployment, "Deployment must be specified"); this.deployment = deployment; }
@Override public Screenshooter setScreenshotTargetDir(String screenshotTargetDir) { Validate.notNullOrEmpty(screenshotTargetDir, "Screenshot target directory can not be a null object or an empty string"); return setScreenshotTargetDir(new File(screenshotTargetDir)); }