Sho SHIMIZU | 11812fc | 2014-08-21 14:51:17 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.core.newintent; |
| 2 | |
| 3 | import net.onrc.onos.api.newintent.IntentException; |
| 4 | import net.onrc.onos.api.newintent.IntentServiceTest; |
| 5 | import net.onrc.onos.api.newintent.TestableIntentService; |
| 6 | import net.onrc.onos.core.datagrid.ISharedCollectionsService; |
| 7 | import net.onrc.onos.core.datastore.hazelcast.DummySharedCollectionsService; |
| 8 | import org.junit.After; |
| 9 | |
| 10 | import java.util.Collections; |
| 11 | import java.util.List; |
| 12 | |
| 13 | /** |
| 14 | * Suites of test of {@link IntentManagerRuntime} inheriting from {@link IntentServiceTest}. |
| 15 | */ |
| 16 | public 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 | } |