@Test public void corruptEventThreshold() { IntentStoreDelegate mockDelegate = new IntentStoreDelegate() { @Override public void process(IntentData intentData) { intentData.setState(CORRUPT); intentData.setErrorCount(cleanup.retryThreshold); store.write(intentData); } @Override public void notify(IntentEvent event) { cleanup.event(event); } }; store.setDelegate(mockDelegate); Intent intent = new MockIntent(1L); IntentData data = new IntentData(intent, INSTALL_REQ, null); store.addPending(data); assertEquals("Expect number of submits incorrect", 0, service.submitCounter()); }
@Override public void event(IntentEvent event) { if (enabled && event.type() == IntentEvent.Type.CORRUPT) { Key key = event.subject().key(); if (store.isMaster(key)) { IntentData data = store.getIntentData(event.subject().key()); resubmitCorrupt(data, true); } } }
IntentCleanup implements Runnable, IntentListener { @Override public void event(IntentEvent event) { if (enabled && event.type() == IntentEvent.Type.CORRUPT) { Key key = event.subject().key(); if (store.isMaster(key)) { IntentData data = store.getIntentData(event.subject().key()); resubmitCorrupt(data, true); } } } }
IntentCleanup implements Runnable, IntentListener { @Override public void event(IntentEvent event) { if (enabled && event.type() == IntentEvent.Type.CORRUPT) { Key key = event.subject().key(); if (store.isMaster(key)) { IntentData data = store.getIntentData(event.subject().key()); resubmitCorrupt(data, true); } } }  }
IntentCleanup implements Runnable, IntentListener { @Override public void event(IntentEvent event) { if (enabled && event.type() == IntentEvent.Type.CORRUPT) { Key key = event.subject().key(); if (store.isMaster(key)) { IntentData data = store.getIntentData(event.subject().key()); resubmitCorrupt(data, true); } } }  @Activate void activate(); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override void run(); @Override void event(IntentEvent event); }
IntentCleanup implements Runnable, IntentListener { @Override public void event(IntentEvent event) { if (enabled && event.type() == IntentEvent.Type.CORRUPT) { Key key = event.subject().key(); if (store.isMaster(key)) { IntentData data = store.getIntentData(event.subject().key()); resubmitCorrupt(data, true); } } }  @Activate void activate(); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override void run(); @Override void event(IntentEvent event);  }