本文整理汇总了Java中org.databene.commons.SystemInfo.isWindows方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.isWindows方法的具体用法?Java SystemInfo.isWindows怎么用?Java SystemInfo.isWindows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.databene.commons.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.isWindows方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAppend
import org.databene.commons.SystemInfo; //导入方法依赖的package包/类
@Test
public void testAppend() throws Exception {
if (SystemInfo.isWindows()) { // TODO make this test work on Windows
System.out.println("Skipping testAppend()");
return;
}
try {
CSVEntityExporter exporter = new CSVEntityExporter(customFile.getAbsolutePath(), "name");
exporter.setAppend(true);
cosumeAndClose(exporter);
CSVEntityExporter exporter2 = new CSVEntityExporter(customFile.getAbsolutePath(), "name");
exporter2.setAppend(true);
cosumeAndClose(exporter2);
assertEquals("name\r\nAlice\r\nBob\r\nAlice\r\nBob", getContent(customFile));
} finally {
customFile.delete();
}
}
示例2: testShell
import org.databene.commons.SystemInfo; //导入方法依赖的package包/类
@Test
public void testShell() {
String cmd = "echo 42";
if (SystemInfo.isWindows())
cmd = "cmd.exe /C " + cmd;
EvaluateStatement stmt = new EvaluateStatement(
true,
constant("result"),
constant(cmd),
null,
constant("shell"),
null,
null,
constant("fatal"),
constant(Encodings.UTF_8),
constant(false),
null,
null);
stmt.execute(context);
assertEquals(42, context.get("result"));
}
示例3: echoCommands
import org.databene.commons.SystemInfo; //导入方法依赖的package包/类
private String[] echoCommands(String variable) {
String[] command;
if (SystemInfo.isWindows()) {
command = new String[] { "cmd.exe", "/C", "ECHO %" + variable + "%" };
}
else {
command = new String[] { "/bin/bash", "-c", "echo $" + variable };
}
return command;
}
示例4: batchFileSuffix
import org.databene.commons.SystemInfo; //导入方法依赖的package包/类
private String batchFileSuffix() {
return (SystemInfo.isWindows() ? ".bat" : ".sh");
}