blob: dfc0fd11ad7dab627495f52db351ecffa0fa0eba [file] [log] [blame]
Sho SHIMIZU11812fc2014-08-21 14:51:17 -07001package net.onrc.onos.core.newintent;
2
3import net.onrc.onos.api.newintent.IntentException;
4import net.onrc.onos.api.newintent.IntentServiceTest;
5import net.onrc.onos.api.newintent.TestableIntentService;
6import net.onrc.onos.core.datagrid.ISharedCollectionsService;
7import net.onrc.onos.core.datastore.hazelcast.DummySharedCollectionsService;
8import org.junit.After;
9
10import java.util.Collections;
11import java.util.List;
12
13/**
14 * Suites of test of {@link IntentManagerRuntime} inheriting from {@link IntentServiceTest}.
15 */
16public class IntentManagerRuntimeTest extends IntentServiceTest {
17
18 private TestableIntentManagerRuntime sut;
19
20 @Override
21 protected TestableIntentService createIntentService() {
22 DummySharedCollectionsService collectionsService = new DummySharedCollectionsService();
23 sut = new TestableIntentManagerRuntime(collectionsService);
24 return sut;
25 }
26
27 @After
28 public void tearDown() {
29 sut.destroy();
30 }
31
32 private static class TestableIntentManagerRuntime
33 extends IntentManagerRuntime implements TestableIntentService {
34 public TestableIntentManagerRuntime(ISharedCollectionsService service) {
35 super(service);
36 }
37
38 @Override
39 public List<IntentException> getExceptions() {
40 return Collections.emptyList();
41 }
42 }
43}