public void onIndexChanged(IndexChangedEvent event) {
throw new ReceivedEventMarkerException();
}
};
ListenerList l = db.getListenerList();
l.addIndexChangedListener(listener);
DirCacheBuilder b = dc.builder();
entOrig = new DirCacheEntry(path);
entOrig.setFileMode(mode);
entOrig.setLastModified(lastModified);
entOrig.setLength(length);
b.add(entOrig);
try {
b.commit();
} catch (ReceivedEventMarkerException e) {
receivedEvent = true;
}
if (!receivedEvent)
fail("did not receive IndexChangedEvent");
// do the same again, as this doesn't change index compared to first
// round we should get no event this time
dc = db.lockDirCache();
listener = new IndexChangedListener() {
public void onIndexChanged(IndexChangedEvent event) {
throw new ReceivedEventMarkerException();
}
};
l = db.getListenerList();
l.addIndexChangedListener(listener);
b = dc.builder();
entOrig = new DirCacheEntry(path);
entOrig.setFileMode(mode);
entOrig.setLastModified(lastModified);