本文整理汇总了Java中gov.nasa.jpf.util.event.Event类的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Event类属于gov.nasa.jpf.util.event包,在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPath____Z
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@MJI(noOrphanWarning=true)
public boolean checkPath____Z (MJIEnv env, int objRef){
SystemState ss = env.getSystemState();
EventChoiceGenerator cg = ss.getLastChoiceGeneratorOfType(EventChoiceGenerator.class);
if (cg != null){
Event lastEvent = cg.getNextChoice();
if (eventTree.checkPath(lastEvent)){
return true;
} else {
log.warning("trace check for event ", lastEvent.toString(), " failed");
return false;
}
} else {
return false; // there should have been one
}
}
示例2: map
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event map (Event e){
String eventName = e.getName();
if (eventName.equals("*")){
System.out.println(" expanding " + eventName + " to [X,Y]");
List<Event> list = new ArrayList<Event>();
list.add( new Event("X"));
list.add( new Event("Y"));
return e.replaceWithAlternativesFrom(list);
} else if (eventName.equals("<opt>")){
System.out.println(" skipping " + eventName);
// that's effectively event removal without changing the structure of the tree
return e.replaceWith(new NoEvent());
}
return e;
}
示例3: createRoot
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createRoot() {
return sequence(
event("a"),
alternatives(
event("1"),
sequence(
event("X"),
event("Y")
),
iteration(3,
event("r")
)
),
event("b"));
}
示例4: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Other", true),
click("$Next", true)
);
}
示例5: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Glasses", true),
click("$Teeth", true)
);
}
示例6: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Disable", true),
click("$Enable", true)
);
}
示例7: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Both_text_and_icon", true),
click("$A_check_box_menu_item", true)
);
}
示例8: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Next", true),
click("$Previous", true)
);
}
示例9: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Windows", true),
click("$Mac", true)
);
}
示例10: createRoot
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createRoot() {
return
sequence(
event("a"),
alternatives(
event("1"),
iteration(2,
event("x")
)
),
event("b")
);
}
示例11: checkGeneratedPaths
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
protected boolean checkGeneratedPaths (EventTree m, String[] expected){
System.out.println("event tree: ");
m.printTree();
int nMatches = 0;
for (Event ee : m.visibleEndEvents()){
String trace = ee.getPathString(null);
System.out.print("checking path: \"" + trace + '"');
if (!m.checkPath(ee, expected)){
System.out.println(" UNEXPECTED");
return false;
} else {
System.out.println(" OK");
}
nMatches++;
}
if (nMatches != expected.length){
System.out.println("UNCOVERED PATH: ");
for (int i=0; i<expected.length; i++){
if (expected[i] != null){
System.err.println(expected[i]);
}
}
return false;
}
return true;
}
示例12: testAddPath
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Test
public void testAddPath () {
AddPathTree t = new AddPathTree();
t.addPath(
new Event("a"),
new Event("b"),
new Event("3"));
String[] expected = { "abc", "ab3" };
if (!checkGeneratedPaths(t, expected)){
fail("failed to match traces");
}
}
示例13: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
selectAny("$Pet:list", false, 0, 3)
);
}
示例14: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
click("$Reset", true)
);
}
示例15: createEventTree
import gov.nasa.jpf.util.event.Event; //导入依赖的package包/类
@Override
public Event createEventTree() {
return sequence(
setText("$Edit1", true, "some text")
);
}