/* @test
@bug 4714674
@summary Tests that JEditorPane opens HTTP connection asynchronously
@author Peter Zhelezniakov
@run main bug4714674
*/
public class bug4714674 {
new bug4714674().test();
}
public void run() {
try {
// this will block EDT unless 4714674 is fixed
} catch (IOException e) {
// should not happen
throw new Error(e);
}
}
});
// if 4714674 is fixed, this executes before connection times out
public void run() {
synchronized (server) {
}
pass();
}
});
// wait, then check test status
try {
if (!passed()) {
throw new RuntimeException("Failed: EDT was blocked");
}
} finally {
}
}
private boolean passed = false;
private synchronized boolean passed() {
return passed;
}
private synchronized void pass() {
passed = true;
}
}
/**
* A "deaf" HTTP server that does not respond to requests.
*/
class DeafServer {
boolean wakeup = false;
/**
* Create and start the HTTP server.
*/
}
/**
* Stop server without any delay.
*/
public void destroy() {
}
/**
* Return actual server port number, useful for constructing request URIs.
*/
public int getPort() {
}
synchronized (DeafServer.this) {
while (! wakeup) {
try {
DeafServer.this.wait();
} catch (InterruptedException e) {
// just wait again
}
}
}
}
}
}