本文整理汇总了Java中org.netbeans.jemmy.util.Dumper类的典型用法代码示例。如果您正苦于以下问题:Java Dumper类的具体用法?Java Dumper怎么用?Java Dumper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dumper类属于org.netbeans.jemmy.util包,在下文中一共展示了Dumper类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fail
import org.netbeans.jemmy.util.Dumper; //导入依赖的package包/类
protected void fail(String msg, Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
if (captureScreen) {
try {
PNGEncoder.captureScreen(getWorkDirPath()+File.separator+"screen.png");
} catch (Exception e1) {}
}
if (dumpScreen) {
try {
Dumper.dumpAll(getWorkDirPath()+File.separator+"screen.xml");
} catch (Exception e2) {}
}
fail(msg + "\n" + sw);
}
示例2: reload
import org.netbeans.jemmy.util.Dumper; //导入依赖的package包/类
private void reload(final int delay) {
viewButton.setEnabled(false);
expandButton.setEnabled(false);
new Thread(new Runnable() {
@Override
public void run() {
try {
for (int i = delay - 1; i >= 0; i--) {
setStatus("Reloading after " + Integer.toString(i) + " second");
Thread.sleep(1000);
}
setStatus("Reloading ...");
Dumper.dumpAll(dumpWriter);
//qt.lock();
root = new RootNode();
//qt.unlock();
mainTree.setModel(root.getWindowModel());
setStatus("Reloaded");
} catch (InterruptedException ignored) {
}
}
}).start();
}
示例3: captureAll
import org.netbeans.jemmy.util.Dumper; //导入依赖的package包/类
/**
* Trying to capture as much information as possible. Currently it includes
* full dump and a screenshot of the whole screen.
*/
public static void captureAll() {
PNGEncoder.captureScreen("failure.png", PNGEncoder.COLOR_MODE);
try {
Dumper.dumpAll("dumpAll.xml");
} catch (FileNotFoundException ex) {
Logger.getLogger(JemmyExt.class.getName()).log(Level.SEVERE, null, ex);
}
captureWindows();
}