tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow.impl; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 2 | |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 3 | import com.google.common.collect.ImmutableList; |
| 4 | import com.google.common.collect.ImmutableMap; |
| 5 | import com.google.common.collect.Lists; |
| 6 | import com.google.common.collect.Sets; |
| 7 | import com.google.common.util.concurrent.ListenableFuture; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 8 | import org.junit.After; |
| 9 | import org.junit.Before; |
| 10 | import org.junit.Test; |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 11 | import org.onlab.onos.core.ApplicationId; |
| 12 | import org.onlab.onos.core.DefaultApplicationId; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 13 | import org.onlab.onos.event.impl.TestEventDispatcher; |
| 14 | import org.onlab.onos.net.DefaultDevice; |
| 15 | import org.onlab.onos.net.Device; |
| 16 | import org.onlab.onos.net.Device.Type; |
| 17 | import org.onlab.onos.net.DeviceId; |
| 18 | import org.onlab.onos.net.MastershipRole; |
| 19 | import org.onlab.onos.net.Port; |
| 20 | import org.onlab.onos.net.PortNumber; |
| 21 | import org.onlab.onos.net.device.DeviceListener; |
| 22 | import org.onlab.onos.net.device.DeviceService; |
Jonathan Hart | 936c49d | 2014-10-23 16:38:59 -0700 | [diff] [blame] | 23 | import org.onlab.onos.net.flow.BatchOperation; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 24 | import org.onlab.onos.net.flow.CompletedBatchOperation; |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 25 | import org.onlab.onos.net.flow.DefaultFlowEntry; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 26 | import org.onlab.onos.net.flow.DefaultFlowRule; |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 27 | import org.onlab.onos.net.flow.FlowEntry; |
| 28 | import org.onlab.onos.net.flow.FlowEntry.FlowEntryState; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 29 | import org.onlab.onos.net.flow.FlowRule; |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 30 | import org.onlab.onos.net.flow.FlowRuleBatchEntry; |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 31 | import org.onlab.onos.net.flow.FlowRuleBatchOperation; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 32 | import org.onlab.onos.net.flow.FlowRuleEvent; |
| 33 | import org.onlab.onos.net.flow.FlowRuleListener; |
| 34 | import org.onlab.onos.net.flow.FlowRuleProvider; |
| 35 | import org.onlab.onos.net.flow.FlowRuleProviderRegistry; |
| 36 | import org.onlab.onos.net.flow.FlowRuleProviderService; |
| 37 | import org.onlab.onos.net.flow.FlowRuleService; |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 38 | import org.onlab.onos.net.flow.StoredFlowEntry; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 39 | import org.onlab.onos.net.flow.TrafficSelector; |
| 40 | import org.onlab.onos.net.flow.TrafficTreatment; |
| 41 | import org.onlab.onos.net.flow.criteria.Criterion; |
| 42 | import org.onlab.onos.net.flow.instructions.Instruction; |
| 43 | import org.onlab.onos.net.provider.AbstractProvider; |
| 44 | import org.onlab.onos.net.provider.ProviderId; |
tom | ea961ff | 2014-10-01 12:45:15 -0700 | [diff] [blame] | 45 | import org.onlab.onos.store.trivial.impl.SimpleFlowRuleStore; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 46 | |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 47 | import java.util.ArrayList; |
| 48 | import java.util.Arrays; |
| 49 | import java.util.Collections; |
| 50 | import java.util.HashMap; |
| 51 | import java.util.List; |
| 52 | import java.util.Map; |
| 53 | import java.util.Set; |
| 54 | import java.util.concurrent.ExecutionException; |
| 55 | import java.util.concurrent.Executor; |
| 56 | import java.util.concurrent.Future; |
| 57 | import java.util.concurrent.TimeUnit; |
| 58 | import java.util.concurrent.TimeoutException; |
| 59 | |
| 60 | import static org.junit.Assert.*; |
| 61 | import static org.onlab.onos.net.flow.FlowRuleEvent.Type.*; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 62 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Test codifying the flow rule service & flow rule provider service contracts. |
| 65 | */ |
tom | 202175a | 2014-09-19 19:00:11 -0700 | [diff] [blame] | 66 | public class FlowRuleManagerTest { |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 67 | |
alshabib | 92c65ad | 2014-10-08 21:56:05 -0700 | [diff] [blame] | 68 | |
tom | f6ab215 | 2014-09-18 12:08:29 -0700 | [diff] [blame] | 69 | private static final ProviderId PID = new ProviderId("of", "foo"); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 70 | private static final DeviceId DID = DeviceId.deviceId("of:001"); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 71 | private static final int TIMEOUT = 10; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 72 | private static final Device DEV = new DefaultDevice( |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 73 | PID, DID, Type.SWITCH, "", "", "", "", null); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 74 | |
tom | 202175a | 2014-09-19 19:00:11 -0700 | [diff] [blame] | 75 | private FlowRuleManager mgr; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 76 | |
| 77 | protected FlowRuleService service; |
| 78 | protected FlowRuleProviderRegistry registry; |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 79 | protected FlowRuleProviderService providerService; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 80 | protected TestProvider provider; |
| 81 | protected TestListener listener = new TestListener(); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 82 | private ApplicationId appId; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 83 | |
| 84 | @Before |
| 85 | public void setUp() { |
tom | 202175a | 2014-09-19 19:00:11 -0700 | [diff] [blame] | 86 | mgr = new FlowRuleManager(); |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 87 | mgr.store = new SimpleFlowRuleStore(); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 88 | mgr.eventDispatcher = new TestEventDispatcher(); |
| 89 | mgr.deviceService = new TestDeviceService(); |
| 90 | service = mgr; |
| 91 | registry = mgr; |
| 92 | |
| 93 | mgr.activate(); |
| 94 | mgr.addListener(listener); |
| 95 | provider = new TestProvider(PID); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 96 | providerService = registry.register(provider); |
alshabib | 92c65ad | 2014-10-08 21:56:05 -0700 | [diff] [blame] | 97 | appId = new TestApplicationId((short) 0, "FlowRuleManagerTest"); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 98 | assertTrue("provider should be registered", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 99 | registry.getProviders().contains(provider.id())); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | @After |
| 103 | public void tearDown() { |
| 104 | registry.unregister(provider); |
| 105 | assertFalse("provider should not be registered", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 106 | registry.getProviders().contains(provider.id())); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 107 | service.removeListener(listener); |
| 108 | mgr.deactivate(); |
| 109 | mgr.eventDispatcher = null; |
| 110 | mgr.deviceService = null; |
| 111 | } |
| 112 | |
| 113 | private FlowRule flowRule(int tsval, int trval) { |
| 114 | TestSelector ts = new TestSelector(tsval); |
| 115 | TestTreatment tr = new TestTreatment(trval); |
Jonathan Hart | bc4a793 | 2014-10-21 11:46:00 -0700 | [diff] [blame] | 116 | return new DefaultFlowRule(DID, ts, tr, 10, appId, TIMEOUT, false); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 117 | } |
| 118 | |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 119 | |
| 120 | private FlowRule addFlowRule(int hval) { |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 121 | FlowRule rule = flowRule(hval, hval); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 122 | service.applyFlowRules(rule); |
| 123 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 124 | assertNotNull("rule should be found", service.getFlowEntries(DID)); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 125 | return rule; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 128 | private void validateEvents(FlowRuleEvent.Type... events) { |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 129 | if (events == null) { |
| 130 | assertTrue("events generated", listener.events.isEmpty()); |
| 131 | } |
| 132 | |
| 133 | int i = 0; |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 134 | System.err.println("events :" + listener.events); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 135 | for (FlowRuleEvent e : listener.events) { |
| 136 | assertTrue("unexpected event", e.type().equals(events[i])); |
| 137 | i++; |
| 138 | } |
| 139 | |
| 140 | assertEquals("mispredicted number of events", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 141 | events.length, listener.events.size()); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 142 | |
| 143 | listener.events.clear(); |
| 144 | } |
| 145 | |
| 146 | private int flowCount() { |
| 147 | return Sets.newHashSet(service.getFlowEntries(DID)).size(); |
| 148 | } |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 149 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 150 | @Test |
| 151 | public void getFlowEntries() { |
| 152 | assertTrue("store should be empty", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 153 | Sets.newHashSet(service.getFlowEntries(DID)).isEmpty()); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 154 | FlowRule f1 = addFlowRule(1); |
| 155 | FlowRule f2 = addFlowRule(2); |
| 156 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 157 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 158 | FlowEntry fe2 = new DefaultFlowEntry(f2); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 159 | assertEquals("2 rules should exist", 2, flowCount()); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 160 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 161 | providerService.pushFlowMetrics(DID, ImmutableList.of(fe1, fe2)); |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 162 | validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, |
| 163 | RULE_ADDED, RULE_ADDED); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 164 | |
| 165 | addFlowRule(1); |
| 166 | assertEquals("should still be 2 rules", 2, flowCount()); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 167 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 168 | providerService.pushFlowMetrics(DID, ImmutableList.of(fe1)); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 169 | validateEvents(RULE_UPDATED); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 170 | } |
| 171 | |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 172 | |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 173 | // TODO: If preserving iteration order is a requirement, redo FlowRuleStore. |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 174 | //backing store is sensitive to the order of additions/removals |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 175 | private boolean validateState(Map<FlowRule, FlowEntryState> expected) { |
| 176 | Map<FlowRule, FlowEntryState> expectedToCheck = new HashMap<>(expected); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 177 | Iterable<FlowEntry> rules = service.getFlowEntries(DID); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 178 | for (FlowEntry f : rules) { |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 179 | assertTrue("Unexpected FlowRule " + f, expectedToCheck.containsKey(f)); |
| 180 | assertEquals("FlowEntry" + f, expectedToCheck.get(f), f.state()); |
| 181 | expectedToCheck.remove(f); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 182 | } |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 183 | assertEquals(Collections.emptySet(), expectedToCheck.entrySet()); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 184 | return true; |
| 185 | } |
| 186 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 187 | @Test |
| 188 | public void applyFlowRules() { |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 189 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 190 | FlowRule r1 = flowRule(1, 1); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 191 | FlowRule r2 = flowRule(2, 2); |
| 192 | FlowRule r3 = flowRule(3, 3); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 193 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 194 | assertTrue("store should be empty", |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 195 | Sets.newHashSet(service.getFlowEntries(DID)).isEmpty()); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 196 | mgr.applyFlowRules(r1, r2, r3); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 197 | assertEquals("3 rules should exist", 3, flowCount()); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 198 | assertTrue("Entries should be pending add.", |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 199 | validateState(ImmutableMap.of( |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 200 | r1, FlowEntryState.PENDING_ADD, |
| 201 | r2, FlowEntryState.PENDING_ADD, |
| 202 | r3, FlowEntryState.PENDING_ADD))); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | @Test |
| 206 | public void removeFlowRules() { |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 207 | FlowRule f1 = addFlowRule(1); |
| 208 | FlowRule f2 = addFlowRule(2); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 209 | FlowRule f3 = addFlowRule(3); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 210 | assertEquals("3 rules should exist", 3, flowCount()); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 211 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 212 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 213 | FlowEntry fe2 = new DefaultFlowEntry(f2); |
| 214 | FlowEntry fe3 = new DefaultFlowEntry(f3); |
| 215 | providerService.pushFlowMetrics(DID, ImmutableList.of(fe1, fe2, fe3)); |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 216 | validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, |
| 217 | RULE_ADDED, RULE_ADDED, RULE_ADDED); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 218 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 219 | mgr.removeFlowRules(f1, f2); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 220 | //removing from north, so no events generated |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 221 | validateEvents(RULE_REMOVE_REQUESTED, RULE_REMOVE_REQUESTED); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 222 | assertEquals("3 rule should exist", 3, flowCount()); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 223 | assertTrue("Entries should be pending remove.", |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 224 | validateState(ImmutableMap.of( |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 225 | f1, FlowEntryState.PENDING_REMOVE, |
| 226 | f2, FlowEntryState.PENDING_REMOVE, |
| 227 | f3, FlowEntryState.ADDED))); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 228 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 229 | mgr.removeFlowRules(f1); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 230 | assertEquals("3 rule should still exist", 3, flowCount()); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | @Test |
| 234 | public void flowRemoved() { |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 235 | FlowRule f1 = addFlowRule(1); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 236 | FlowRule f2 = addFlowRule(2); |
Yuta HIGUCHI | f6f50a6 | 2014-10-19 15:58:49 -0700 | [diff] [blame] | 237 | StoredFlowEntry fe1 = new DefaultFlowEntry(f1); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 238 | FlowEntry fe2 = new DefaultFlowEntry(f2); |
| 239 | providerService.pushFlowMetrics(DID, ImmutableList.of(fe1, fe2)); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 240 | service.removeFlowRules(f1); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 241 | fe1.setState(FlowEntryState.REMOVED); |
| 242 | providerService.flowRemoved(fe1); |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 243 | validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADDED, |
| 244 | RULE_ADDED, RULE_REMOVE_REQUESTED, RULE_REMOVED); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 245 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 246 | providerService.flowRemoved(fe1); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 247 | validateEvents(); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 248 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 249 | FlowRule f3 = flowRule(3, 3); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 250 | FlowEntry fe3 = new DefaultFlowEntry(f3); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 251 | service.applyFlowRules(f3); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 252 | providerService.pushFlowMetrics(DID, Collections.singletonList(fe3)); |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 253 | validateEvents(RULE_ADD_REQUESTED, RULE_ADDED); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 254 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 255 | providerService.flowRemoved(fe3); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 256 | validateEvents(); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 257 | } |
| 258 | |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 259 | @Test |
| 260 | public void flowMetrics() { |
| 261 | FlowRule f1 = flowRule(1, 1); |
| 262 | FlowRule f2 = flowRule(2, 2); |
| 263 | FlowRule f3 = flowRule(3, 3); |
| 264 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 265 | mgr.applyFlowRules(f1, f2, f3); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 266 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 267 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 268 | FlowEntry fe2 = new DefaultFlowEntry(f2); |
| 269 | |
| 270 | |
| 271 | //FlowRule updatedF1 = flowRule(f1, FlowRuleState.ADDED); |
| 272 | //FlowRule updatedF2 = flowRule(f2, FlowRuleState.ADDED); |
| 273 | |
| 274 | providerService.pushFlowMetrics(DID, Lists.newArrayList(fe1, fe2)); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 275 | |
| 276 | assertTrue("Entries should be added.", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 277 | validateState(ImmutableMap.of( |
| 278 | f1, FlowEntryState.ADDED, |
| 279 | f2, FlowEntryState.ADDED, |
| 280 | f3, FlowEntryState.PENDING_ADD))); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 281 | |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 282 | validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, |
| 283 | RULE_ADDED, RULE_ADDED); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | @Test |
| 287 | public void extraneousFlow() { |
| 288 | FlowRule f1 = flowRule(1, 1); |
| 289 | FlowRule f2 = flowRule(2, 2); |
| 290 | FlowRule f3 = flowRule(3, 3); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 291 | mgr.applyFlowRules(f1, f2); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 292 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 293 | // FlowRule updatedF1 = flowRule(f1, FlowRuleState.ADDED); |
| 294 | // FlowRule updatedF2 = flowRule(f2, FlowRuleState.ADDED); |
| 295 | // FlowRule updatedF3 = flowRule(f3, FlowRuleState.ADDED); |
| 296 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 297 | FlowEntry fe2 = new DefaultFlowEntry(f2); |
| 298 | FlowEntry fe3 = new DefaultFlowEntry(f3); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 299 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 300 | |
| 301 | providerService.pushFlowMetrics(DID, Lists.newArrayList(fe1, fe2, fe3)); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 302 | |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 303 | validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADDED, RULE_ADDED); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 304 | |
| 305 | } |
| 306 | |
| 307 | /* |
| 308 | * Tests whether a rule that was marked for removal but no flowRemoved was received |
| 309 | * is indeed removed at the next stats update. |
| 310 | */ |
| 311 | @Test |
| 312 | public void flowMissingRemove() { |
| 313 | FlowRule f1 = flowRule(1, 1); |
| 314 | FlowRule f2 = flowRule(2, 2); |
| 315 | FlowRule f3 = flowRule(3, 3); |
| 316 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 317 | // FlowRule updatedF1 = flowRule(f1, FlowRuleState.ADDED); |
| 318 | // FlowRule updatedF2 = flowRule(f2, FlowRuleState.ADDED); |
| 319 | |
| 320 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 321 | FlowEntry fe2 = new DefaultFlowEntry(f2); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 322 | mgr.applyFlowRules(f1, f2, f3); |
| 323 | |
| 324 | mgr.removeFlowRules(f3); |
| 325 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 326 | providerService.pushFlowMetrics(DID, Lists.newArrayList(fe1, fe2)); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 327 | |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 328 | validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, |
| 329 | RULE_REMOVE_REQUESTED, RULE_ADDED, RULE_ADDED, RULE_REMOVED); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 330 | |
| 331 | } |
| 332 | |
| 333 | @Test |
| 334 | public void getByAppId() { |
| 335 | FlowRule f1 = flowRule(1, 1); |
| 336 | FlowRule f2 = flowRule(2, 2); |
| 337 | mgr.applyFlowRules(f1, f2); |
| 338 | |
| 339 | assertTrue("should have two rules", |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 340 | Lists.newLinkedList(mgr.getFlowRulesById(appId)).size() == 2); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | @Test |
| 344 | public void removeByAppId() { |
| 345 | FlowRule f1 = flowRule(1, 1); |
| 346 | FlowRule f2 = flowRule(2, 2); |
| 347 | mgr.applyFlowRules(f1, f2); |
| 348 | |
| 349 | |
| 350 | mgr.removeFlowRulesById(appId); |
| 351 | |
| 352 | //only check that we are in pending remove. Events and actual remove state will |
| 353 | // be set by flowRemoved call. |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 354 | validateState(ImmutableMap.of( |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 355 | f1, FlowEntryState.PENDING_REMOVE, |
| 356 | f2, FlowEntryState.PENDING_REMOVE)); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 357 | } |
| 358 | |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 359 | @Test |
| 360 | public void applyBatch() { |
| 361 | FlowRule f1 = flowRule(1, 1); |
| 362 | FlowRule f2 = flowRule(2, 2); |
| 363 | |
| 364 | |
| 365 | mgr.applyFlowRules(f1); |
| 366 | |
| 367 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 368 | providerService.pushFlowMetrics(DID, Collections.<FlowEntry>singletonList(fe1)); |
| 369 | |
| 370 | FlowRuleBatchEntry fbe1 = new FlowRuleBatchEntry( |
| 371 | FlowRuleBatchEntry.FlowRuleOperation.REMOVE, f1); |
| 372 | |
| 373 | FlowRuleBatchEntry fbe2 = new FlowRuleBatchEntry( |
| 374 | FlowRuleBatchEntry.FlowRuleOperation.ADD, f2); |
| 375 | |
| 376 | FlowRuleBatchOperation fbo = new FlowRuleBatchOperation( |
| 377 | Lists.newArrayList(fbe1, fbe2)); |
| 378 | Future<CompletedBatchOperation> future = mgr.applyBatch(fbo); |
| 379 | assertTrue("Entries in wrong state", |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 380 | validateState(ImmutableMap.of( |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 381 | f1, FlowEntryState.PENDING_REMOVE, |
| 382 | f2, FlowEntryState.PENDING_ADD))); |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 383 | CompletedBatchOperation completed = null; |
| 384 | try { |
| 385 | completed = future.get(); |
| 386 | } catch (InterruptedException | ExecutionException e) { |
| 387 | fail("Unexpected exception: " + e); |
| 388 | } |
| 389 | if (!completed.isSuccess()) { |
| 390 | fail("Installation should be a success"); |
| 391 | } |
| 392 | |
| 393 | } |
| 394 | |
| 395 | @Test |
| 396 | public void cancelBatch() { |
| 397 | FlowRule f1 = flowRule(1, 1); |
| 398 | FlowRule f2 = flowRule(2, 2); |
| 399 | |
| 400 | |
| 401 | mgr.applyFlowRules(f1); |
| 402 | |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 403 | assertTrue("Entries in wrong state", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 404 | validateState(ImmutableMap.of( |
| 405 | f1, FlowEntryState.PENDING_ADD))); |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 406 | |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 407 | FlowEntry fe1 = new DefaultFlowEntry(f1); |
| 408 | providerService.pushFlowMetrics(DID, Collections.<FlowEntry>singletonList(fe1)); |
| 409 | |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 410 | assertTrue("Entries in wrong state", |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 411 | validateState(ImmutableMap.of( |
| 412 | f1, FlowEntryState.ADDED))); |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 413 | |
| 414 | |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 415 | FlowRuleBatchEntry fbe1 = new FlowRuleBatchEntry( |
| 416 | FlowRuleBatchEntry.FlowRuleOperation.REMOVE, f1); |
| 417 | |
| 418 | FlowRuleBatchEntry fbe2 = new FlowRuleBatchEntry( |
| 419 | FlowRuleBatchEntry.FlowRuleOperation.ADD, f2); |
| 420 | |
| 421 | FlowRuleBatchOperation fbo = new FlowRuleBatchOperation( |
| 422 | Lists.newArrayList(fbe1, fbe2)); |
| 423 | Future<CompletedBatchOperation> future = mgr.applyBatch(fbo); |
| 424 | |
| 425 | future.cancel(true); |
| 426 | |
| 427 | assertTrue(flowCount() == 2); |
| 428 | |
| 429 | /* |
| 430 | * Rule f1 should be re-added to the list and therefore be in a pending add |
| 431 | * state. |
| 432 | */ |
| 433 | assertTrue("Entries in wrong state", |
Yuta HIGUCHI | 605347c | 2014-10-17 21:05:23 -0700 | [diff] [blame] | 434 | validateState(ImmutableMap.of( |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 435 | f2, FlowEntryState.PENDING_REMOVE, |
| 436 | f1, FlowEntryState.PENDING_ADD))); |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 437 | |
| 438 | |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 442 | private static class TestListener implements FlowRuleListener { |
| 443 | final List<FlowRuleEvent> events = new ArrayList<>(); |
| 444 | |
| 445 | @Override |
| 446 | public void event(FlowRuleEvent event) { |
| 447 | events.add(event); |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | private static class TestDeviceService implements DeviceService { |
| 452 | |
| 453 | @Override |
| 454 | public int getDeviceCount() { |
Madan Jampani | 6a45616 | 2014-10-24 11:36:17 -0700 | [diff] [blame] | 455 | return 1; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | @Override |
| 459 | public Iterable<Device> getDevices() { |
Madan Jampani | 6a45616 | 2014-10-24 11:36:17 -0700 | [diff] [blame] | 460 | return Arrays.asList(DEV); |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | @Override |
| 464 | public Device getDevice(DeviceId deviceId) { |
| 465 | return DEV; |
| 466 | } |
| 467 | |
| 468 | @Override |
| 469 | public MastershipRole getRole(DeviceId deviceId) { |
| 470 | return null; |
| 471 | } |
| 472 | |
| 473 | @Override |
| 474 | public List<Port> getPorts(DeviceId deviceId) { |
| 475 | return null; |
| 476 | } |
| 477 | |
| 478 | @Override |
| 479 | public Port getPort(DeviceId deviceId, PortNumber portNumber) { |
| 480 | return null; |
| 481 | } |
| 482 | |
| 483 | @Override |
| 484 | public boolean isAvailable(DeviceId deviceId) { |
| 485 | return false; |
| 486 | } |
| 487 | |
| 488 | @Override |
| 489 | public void addListener(DeviceListener listener) { |
| 490 | } |
| 491 | |
| 492 | @Override |
| 493 | public void removeListener(DeviceListener listener) { |
| 494 | } |
| 495 | |
| 496 | } |
| 497 | |
| 498 | private class TestProvider extends AbstractProvider implements FlowRuleProvider { |
| 499 | |
| 500 | protected TestProvider(ProviderId id) { |
| 501 | super(PID); |
| 502 | } |
| 503 | |
| 504 | @Override |
| 505 | public void applyFlowRule(FlowRule... flowRules) { |
| 506 | } |
| 507 | |
| 508 | @Override |
| 509 | public void removeFlowRule(FlowRule... flowRules) { |
| 510 | } |
| 511 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 512 | @Override |
| 513 | public void removeRulesById(ApplicationId id, FlowRule... flowRules) { |
| 514 | } |
| 515 | |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 516 | @Override |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 517 | public ListenableFuture<CompletedBatchOperation> executeBatch( |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 518 | BatchOperation<FlowRuleBatchEntry> batch) { |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 519 | return new TestInstallationFuture(); |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 520 | } |
| 521 | |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 522 | private class TestInstallationFuture |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 523 | implements ListenableFuture<CompletedBatchOperation> { |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 524 | |
| 525 | @Override |
| 526 | public boolean cancel(boolean mayInterruptIfRunning) { |
| 527 | return true; |
| 528 | } |
| 529 | |
| 530 | @Override |
| 531 | public boolean isCancelled() { |
| 532 | return true; |
| 533 | } |
| 534 | |
| 535 | @Override |
| 536 | public boolean isDone() { |
| 537 | return false; |
| 538 | } |
| 539 | |
| 540 | @Override |
| 541 | public CompletedBatchOperation get() |
| 542 | throws InterruptedException, ExecutionException { |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 543 | return new CompletedBatchOperation(true, Collections.<FlowEntry>emptySet()); |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 544 | } |
| 545 | |
| 546 | @Override |
| 547 | public CompletedBatchOperation get(long timeout, TimeUnit unit) |
| 548 | throws InterruptedException, |
| 549 | ExecutionException, TimeoutException { |
| 550 | return null; |
| 551 | } |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 552 | |
| 553 | @Override |
| 554 | public void addListener(Runnable task, Executor executor) { |
| 555 | // TODO: add stuff. |
| 556 | } |
alshabib | cf36991 | 2014-10-13 14:16:42 -0700 | [diff] [blame] | 557 | } |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 558 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 559 | } |
| 560 | |
| 561 | private class TestSelector implements TrafficSelector { |
| 562 | |
| 563 | //for controlling hashcode uniqueness; |
alshabib | 9704490 | 2014-09-18 14:52:16 -0700 | [diff] [blame] | 564 | private final int testval; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 565 | |
| 566 | public TestSelector(int val) { |
| 567 | testval = val; |
| 568 | } |
| 569 | |
| 570 | @Override |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 571 | public Set<Criterion> criteria() { |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 572 | return null; |
| 573 | } |
| 574 | |
| 575 | @Override |
Jonathan Hart | 936c49d | 2014-10-23 16:38:59 -0700 | [diff] [blame] | 576 | public Criterion getCriterion( |
| 577 | org.onlab.onos.net.flow.criteria.Criterion.Type type) { |
| 578 | return null; |
| 579 | } |
| 580 | |
| 581 | @Override |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 582 | public int hashCode() { |
| 583 | return testval; |
| 584 | } |
| 585 | |
| 586 | @Override |
| 587 | public boolean equals(Object o) { |
| 588 | if (o instanceof TestSelector) { |
| 589 | return this.testval == ((TestSelector) o).testval; |
| 590 | } |
| 591 | return false; |
| 592 | } |
Jonathan Hart | 936c49d | 2014-10-23 16:38:59 -0700 | [diff] [blame] | 593 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 594 | } |
| 595 | |
| 596 | private class TestTreatment implements TrafficTreatment { |
| 597 | |
| 598 | //for controlling hashcode uniqueness; |
alshabib | 9704490 | 2014-09-18 14:52:16 -0700 | [diff] [blame] | 599 | private final int testval; |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 600 | |
| 601 | public TestTreatment(int val) { |
| 602 | testval = val; |
| 603 | } |
| 604 | |
| 605 | @Override |
| 606 | public List<Instruction> instructions() { |
| 607 | return null; |
| 608 | } |
| 609 | |
| 610 | @Override |
| 611 | public int hashCode() { |
| 612 | return testval; |
| 613 | } |
| 614 | |
| 615 | @Override |
| 616 | public boolean equals(Object o) { |
| 617 | if (o instanceof TestTreatment) { |
| 618 | return this.testval == ((TestTreatment) o).testval; |
| 619 | } |
| 620 | return false; |
| 621 | } |
| 622 | |
| 623 | } |
| 624 | |
alshabib | 92c65ad | 2014-10-08 21:56:05 -0700 | [diff] [blame] | 625 | public class TestApplicationId extends DefaultApplicationId { |
| 626 | |
| 627 | public TestApplicationId(short id, String name) { |
| 628 | super(id, name); |
| 629 | } |
| 630 | } |
| 631 | |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 632 | } |