Sho SHIMIZU
Committed by Gerrit Code Review

Load ComponentConfigService in IntentManager

Change-Id: I8b292edc9afdc7a8c3aaab511ed338b8497eb6de
......@@ -24,6 +24,7 @@ import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import org.onlab.util.Tools;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.core.CoreService;
import org.onosproject.core.IdGenerator;
import org.onosproject.event.AbstractListenerManager;
......@@ -115,6 +116,10 @@ public class IntentManager
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ResourceService resourceService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ComponentConfigService configService;
private ExecutorService batchExecutor;
private ExecutorService workerExecutor;
......@@ -131,6 +136,8 @@ public class IntentManager
@Activate
public void activate() {
configService.registerProperties(getClass());
intentInstaller.init(store, trackerService, flowRuleService, flowObjectiveService);
if (skipReleaseResourcesOnWithdrawal) {
store.setDelegate(testOnlyDelegate);
......@@ -154,6 +161,7 @@ public class IntentManager
} else {
store.unsetDelegate(delegate);
}
configService.unregisterProperties(getClass(), false);
trackerService.unsetDelegate(topoDelegate);
eventDispatcher.removeSink(IntentEvent.class);
batchExecutor.shutdown();
......
......@@ -28,6 +28,7 @@ import org.junit.Ignore;
import org.junit.Test;
import org.onosproject.TestApplicationId;
import org.onosproject.cfg.ComponentConfigAdapter;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.common.event.impl.TestEventDispatcher;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.impl.TestCoreManager;
......@@ -57,6 +58,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static org.easymock.EasyMock.mock;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
......@@ -231,6 +233,7 @@ public class IntentManagerTest {
manager.trackerService = new TestIntentTracker();
manager.flowRuleService = flowRuleService;
manager.coreService = new TestCoreManager();
manager.configService = mock(ComponentConfigService.class);
service = manager;
extensionService = manager;
......