当前位置: 首页>>代码示例>>Java>>正文


Java CommandLine.execute方法代码示例

本文整理汇总了Java中org.openqa.selenium.os.CommandLine.execute方法的典型用法代码示例。如果您正苦于以下问题:Java CommandLine.execute方法的具体用法?Java CommandLine.execute怎么用?Java CommandLine.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openqa.selenium.os.CommandLine的用法示例。


在下文中一共展示了CommandLine.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: launchAllure

import org.openqa.selenium.os.CommandLine; //导入方法依赖的package包/类
public static void launchAllure(boolean showDialog, String... args) {
	if (showDialog)
		WaitMessageDialog.setVisible(true, "Generating reports");
	List<String> vmArgs = getVMArgs();
	Iterator<String> iterator = vmArgs.iterator();
	while (iterator.hasNext()) {
		String next = iterator.next();
		if (next.contains("-javaagent") || next.contains("-D")) {
			if (!next.contains("-Dallure")) {
				iterator.remove();
			}
		}
	}
	vmArgs.add("-classpath");
	vmArgs.add(System.getProperty("java.class.path"));
	String property = System.getProperty(Constants.PROP_TMS_PATTERN);
	if (property != null && !"".equals(property)) {
		vmArgs.add("-D" + Constants.PROP_TMS_PATTERN + "=" + property);
	}
	property = System.getProperty(Constants.PROP_ISSUE_PATTERN);
	if (property != null && !"".equals(property)) {
		vmArgs.add("-D" + Constants.PROP_ISSUE_PATTERN + "=" + property);
	}
	ArrayList<String> newArgs = new ArrayList<String>();
	newArgs.add(getJavaCommand());
	newArgs.addAll(vmArgs);
	newArgs.add(AllureMain.class.getName());
	newArgs.addAll(new ArrayList<String>(Arrays.asList(args)));
	CommandLine command = new CommandLine(newArgs.toArray(new String[newArgs.size()]));
	command.copyOutputTo(System.out);
	Logger.getLogger(TestRunner.class.getName()).info("Launching: " + command);
	command.execute();
	if (showDialog)
		WaitMessageDialog.setVisible(false);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:36,代码来源:AllureUtils.java

示例2: main

import org.openqa.selenium.os.CommandLine; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
    JavaProfile profile = new JavaProfile(LaunchMode.JAVA_WEBSTART);
    File f = findFile();
    profile.setJNLPPath(f.getAbsolutePath());
    profile.setStartWindowTitle("SwingSet3");
    CommandLine commandLine = profile.getCommandLine();
    commandLine.copyOutputTo(System.err);
    System.out.println(commandLine);
    commandLine.execute();

}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:LaunchWebStartTest.java

示例3: executeCommand

import org.openqa.selenium.os.CommandLine; //导入方法依赖的package包/类
private static void executeCommand(String commandName, String... args) {
    CommandLine cmd = new CommandLine(commandName, args);
    cmd.execute();
}
 
开发者ID:ggasoftware,项目名称:gga-selenium-framework,代码行数:5,代码来源:WebDriverUtils.java


注:本文中的org.openqa.selenium.os.CommandLine.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。