Methods Summary |
---|
public int | getChanged()
synchronized (lock) {
if (!addDispatched) {
try {
// TODO: don't know why must add limitation
lock.wait(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
addDispatched = false;
return changed;
}
|
public boolean | getResult()
synchronized (lock) {
if (!addDispatched) {
try {
// TODO: don't know why must add limitation
lock.wait(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
addDispatched = false;
return result;
}
|
public void | preferenceChange(java.util.prefs.PreferenceChangeEvent pce)
synchronized (lock) {
switch(testNum) {
case TEST_GET_KEY:
if(pce != null) {
if(pce.getKey().equals("key_int")) {
result = true;
}
}
break;
case TEST_GET_NEW_VALUE:
if(pce != null) {
if(pce.getNewValue().equals(new Integer(Integer.MAX_VALUE).toString())) {
result = true;
}
}
break;
case TEST_GET_NODE:
if(pce != null) {
if("mock".equals(pce.getNode().name())) {
result = true;
}
}
break;
}
changed++;
addDispatched = true;
lock.notifyAll();
}
|
public void | reset()
changed = 0;
result = false;
|
public void | waitForEvent()
waitForEvent(1);
|
public void | waitForEvent(int count)
for (int i = 0; i < count; i++) {
try {
synchronized (lock) {
lock.wait(500);
}
} catch (InterruptedException e) {
}
}
|