GP-0: Fixed GadpClientServerTest

This commit is contained in:
Dan 2021-04-16 14:46:07 -04:00
parent 9b5b0479c2
commit 187aa1fa31
3 changed files with 6 additions and 3 deletions

View file

@ -41,7 +41,7 @@ public interface GadpClientTargetObject extends SpiTargetObject {
@GadpEventHandler(Gadp.EventNotification.EvtCase.OBJECT_INVALIDATE_EVENT)
default void handleObjectInvalidateEvent(Gadp.EventNotification notification) {
Gadp.ObjectInvalidateEvent evt = notification.getObjectInvalidateEvent();
getDelegate().doInvalidate(this, evt.getReason());
getDelegate().invalidateSubtree(this, evt.getReason());
}
@GadpEventHandler(Gadp.EventNotification.EvtCase.CACHE_INVALIDATE_EVENT)

View file

@ -1013,8 +1013,8 @@ public class GadpClientServerTest implements AsyncTestUtils {
ssAvail.setElements(List.of(new TestGadpTargetAvailable(ssAvail, 1, "cat") //
), "Changed");
waitOn(invL.count.waitValue(2));
waitOn(elemL.count.waitValue(2));
waitOn(invL.count.waitUntil(c -> c >= 2));
waitOn(elemL.count.waitUntil(c -> c >= 2));
for (TargetObject a : avail1.values()) {
assertFalse(a.isValid());

View file

@ -243,6 +243,9 @@ public abstract class AbstractTargetObject<P extends TargetObject> implements Sp
}
protected void doInvalidate(TargetObject branch, String reason) {
if (!valid) {
return;
}
valid = false;
model.objectInvalidated(getProxy());
listeners.fire.invalidated(getProxy(), branch, reason);