本文整理了Java中org.mozilla.zest.core.v1.ZestLoopFile
类的一些代码示例,展示了ZestLoopFile
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestLoopFile
类的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestLoopFile
类名称:ZestLoopFile
[英]This class represent a loop through a list of strings given in input through a file.
[中]此类表示通过文件输入中给定的字符串列表的循环。
代码示例来源:origin: mozilla/zest
@Override
public ZestLoopFile deepCopy() {
ZestLoopFile copy;
try {
copy = new ZestLoopFile(this.getIndex());
copy.setVariableName(this.getVariableName());
copy.setCurrentState(this.getCurrentState().deepCopy());
copy.setStatements(this.copyStatements());
copy.setSet(this.getSet().deepCopy());
copy.setEnabled(this.isEnabled());
return copy;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
代码示例来源:origin: mozilla/zest
@Override
public String getCurrentToken() {
if (super.getCurrentToken() == null) {
super.init(getSet(), getStatements());
}
return super.getCurrentToken();
}
代码示例来源:origin: mozilla/zest
@Override
public void toLastState() {
getCurrentState().toLastState(getSet());
}
代码示例来源:origin: mozilla/zest
@Test
public void testLoop() throws Exception {
ZestScript script = new ZestScript();
ZestLoopFile loop = new ZestLoopFile();
loop.setVariableName("aaa");
script.add(loop);
Set<String> vars = script.getVariableNames();
assertTrue(vars.contains("aaa"));
}
}
代码示例来源:origin: mozilla/zest
@Test
public void testSerializationLoopFile() throws FileNotFoundException {
ZestLoopFile loop = new ZestLoopFile(ZestLoopFileUnitTest.file.getAbsolutePath());
for (ZestStatement stmt : statements) {
loop.addStatement(stmt);
}
String loopString = ZestJSON.toString(loop);
ZestLoopFile copy = (ZestLoopFile) ZestJSON.fromString(loopString);
String copyString = ZestJSON.toString(copy);
// System.out.println("===============================");
// System.out.println(" LOOP FILE");
// System.out.println("===============================");
// System.out.println(copyString);
assertTrue(loopString.equals(copyString));
}
}
代码示例来源:origin: mozilla/zest
/**
* Method testOpenFile.
*
* @throws IOException
*/
@Test
public void testOpenFile() throws IOException {
new ZestLoopFile(file.getAbsolutePath());
}
}
代码示例来源:origin: mozilla/zest
/**
* returns the file of this loop.
*
* @return the file of this loop
*/
public File getFile() {
return this.getSet().getFile();
}
代码示例来源:origin: mozilla/zest
@Override
public void setSet(ZestLoopTokenSet<String> set) {
if (set instanceof ZestLoopTokenFileSet) {
try {
ZestLoopTokenFileSet fileSet = (ZestLoopTokenFileSet) set;
this.set = new ZestLoopTokenFileSet(fileSet.getFile().getAbsolutePath());
super.init(set, getStatements());
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else {
throw new IllegalArgumentException(
"Invelid set. It must be instance of " + ZestLoopTokenFileSet.class.getName());
}
}
代码示例来源:origin: mozilla/zest
ZestLoopFile loopFile = (ZestLoopFile) loop;
System.out.println(
"FOR tokens IN FILE " + loopFile.getFile().getAbsolutePath() + " DO");
} else if (stmt instanceof ZestLoopInteger) {
ZestLoopInteger loopInteger = (ZestLoopInteger) loop;
代码示例来源:origin: mozilla/zest
System.out.println(" ZestLoopFile");
System.out.println("---------------------");
ZestLoopFile loopFile = new ZestLoopFile(ZestLoopFileUnitTest.file.getAbsolutePath());
for (ZestStatement stmt : statements) {
loopFile.addStatement(stmt);
代码示例来源:origin: mozilla/zest
public static void main(String[] args) throws FileNotFoundException {
ZestLoopFile loop = new ZestLoopFile(ZestLoopFileUnitTest.file.getAbsolutePath());
ZestScript script =
new ZestScript(
代码示例来源:origin: mozilla/zest
public boolean loop() {
return super.loop(getSet());
}
代码示例来源:origin: mozilla/zest
public void endLoop() {
super.endLoop(getSet());
}
}
代码示例来源:origin: mozilla/zest
@Override
public void increase() {
super.getCurrentState().increase(getSet());
}
代码示例来源:origin: mozilla/zest
@Override
public boolean isLastState() {
return super.getCurrentState().isLastState(getSet());
}
内容来源于网络,如有侵权,请联系作者删除!