本文整理汇总了Java中test.java.awt.regtesthelpers.process.ProcessCommunicator类的典型用法代码示例。如果您正苦于以下问题:Java ProcessCommunicator类的具体用法?Java ProcessCommunicator怎么用?Java ProcessCommunicator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProcessCommunicator类属于test.java.awt.regtesthelpers.process包,在下文中一共展示了ProcessCommunicator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public void start() {
SourceFrame sourceFrame = new SourceFrame();
Util.waitForIdle(null);
String [] args = new String [] {
String.valueOf(sourceFrame.getNextLocationX()),
String.valueOf(sourceFrame.getNextLocationY()),
String.valueOf(sourceFrame.getDragSourcePointX()),
String.valueOf(sourceFrame.getDragSourcePointY()),
};
String classpath = System.getProperty("java.class.path");
ProcessResults processResults =
ProcessCommunicator.executeChildProcess(this.getClass(),classpath,args);
verifyTestResults(processResults);
}
示例2: DragInterceptorAppletTest
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public DragInterceptorAppletTest(Point targetFrameLocation, Point dragSourcePoint)
throws InterruptedException
{
DragInterceptorFrame targetFrame = new DragInterceptorFrame(targetFrameLocation);
Util.waitForIdle(null);
final Robot robot = Util.createRobot();
robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY());
sleep(100);
robot.mousePress(InputEvent.BUTTON1_MASK);
sleep(100);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
sleep(100);
Util.drag(robot, dragSourcePoint, targetFrame.getDropTargetPoint(),
InputEvent.BUTTON1_MASK);
sleep(2000);
ProcessCommunicator.destroyProcess();
}
示例3: start
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public void start() {
SourceFileListFrame sourceFrame = new SourceFileListFrame();
Util.waitForIdle(null);
String [] args = new String [] {
String.valueOf(sourceFrame.getNextLocationX()),
String.valueOf(sourceFrame.getNextLocationY()),
String.valueOf(sourceFrame.getDragSourcePointX()),
String.valueOf(sourceFrame.getDragSourcePointY()),
String.valueOf(sourceFrame.getSourceFilesNumber())
};
ProcessResults processResults =
ProcessCommunicator.executeChildProcess(this.getClass(), args);
verifyTestResults(processResults);
}
示例4: start
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public void start() {
String toolkit = Toolkit.getDefaultToolkit().getClass().getName();
if (toolkit.equals("sun.awt.windows.WToolkit")){
System.out.println("This test is not for the Windows platform. Passed.");
return;
} else {
System.out.println("Toolkit = " + toolkit);
}
SourceFileListFrame sourceFrame = new SourceFileListFrame();
Util.waitForIdle(null);
String [] args = new String [] {
String.valueOf(sourceFrame.getNextLocationX()),
String.valueOf(sourceFrame.getNextLocationY()),
String.valueOf(sourceFrame.getDragSourcePointX()),
String.valueOf(sourceFrame.getDragSourcePointY()),
String.valueOf(sourceFrame.getSourceFilesNumber())
};
String classpath = System.getProperty("java.class.path");
ProcessResults processResults =
ProcessCommunicator.executeChildProcess(this.getClass(), classpath, args);
verifyTestResults(processResults);
}
示例5: addTrayIcon
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
void addTrayIcon() throws Exception {
SystemTray tray = SystemTray.getSystemTray();
TrayIcon icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB));
tray.add(icon);
new Robot().delay(2000);
ProcessResults processResults =
ProcessCommunicator.executeChildProcess(this.getClass(), new String[]{NEW_JVM});
if (processResults.getExitValue() != 0)
throw new RuntimeException("\n"+processResults.getStdErr());
}
示例6: main
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public static void main(String[] args) {
final AtomicBoolean passed = new AtomicBoolean(false);
new Thread(() -> {
for (int trial = 0; trial < 5; ++trial) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
throw new RuntimeException("Test FAILED!", e);
}
if (passed.get()) {
break;
} else if (trial == 4) {
throw new RuntimeException("Child process never exits");
}
}
}, "TimeoutThread").start();
String classpath = System.getProperty("java.class.path");
String policyPath = System.getProperty("test.src")+File.separatorChar+"policy";
System.out.println("policyPath in main: "+policyPath);
ProcessResults pres = ProcessCommunicator.executeChildProcess(TestApplication.class, classpath+" -Djava.security.manager -Djava.security.policy="+policyPath, new String[0]);
passed.set(true);
if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
System.err.println("========= Child VM System.err ========");
System.err.print(pres.getStdErr());
System.err.println("======================================");
}
if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
System.err.println("========= Child VM System.out ========");
System.err.print(pres.getStdOut());
System.err.println("======================================");
}
}
示例7: main
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Producer contents = new Producer();
clipboard.setContents(contents, null);
ProcessResults processResults =
ProcessCommunicator
.executeChildProcess(Consumer.class, new String[0]);
if (!"Hello".equals(processResults.getStdErr())) {
throw new RuntimeException("transfer of remote object failed");
}
System.out.println("ok");
}
示例8: main
import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public static void main(String[] args) {
final AtomicBoolean passed = new AtomicBoolean(false);
new Thread(() -> {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
throw new RuntimeException("Test FAILED!", e);
}
if (!passed.get()) {
throw new RuntimeException("Test FAILED! The child process never exits");
}
}, "TimeoutThread").start();
String classpath = System.getProperty("java.class.path");
String policyPath = System.getProperty("test.src")+File.separatorChar+"policy";
System.out.println("policyPath in main: "+policyPath);
ProcessResults pres = ProcessCommunicator.executeChildProcess(TestApplication.class, classpath+" -Djava.security.manager -Djava.security.policy="+policyPath, new String[0]);
passed.set(true);
if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
System.err.println("========= Child VM System.err ========");
System.err.print(pres.getStdErr());
System.err.println("======================================");
}
if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
System.err.println("========= Child VM System.out ========");
System.err.print(pres.getStdOut());
System.err.println("======================================");
}
}