Committed by
Gerrit Code Review
Remove methods deprecated in Drake from Instructions API
Change-Id: I87a20cb9e8abbf4b27bbb4760a62947169866ea6
Showing
15 changed files
with
17 additions
and
115 deletions
| ... | @@ -72,17 +72,6 @@ public final class Instructions { | ... | @@ -72,17 +72,6 @@ public final class Instructions { |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | /** | 74 | /** |
| 75 | - * Creates a drop instruction. | ||
| 76 | - * | ||
| 77 | - * @return drop instruction | ||
| 78 | - * @deprecated 1.4.0 Emu Release | ||
| 79 | - */ | ||
| 80 | - @Deprecated | ||
| 81 | - public static DropInstruction createDrop() { | ||
| 82 | - return new DropInstruction(); | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | - /** | ||
| 86 | * Creates a no action instruction. | 75 | * Creates a no action instruction. |
| 87 | * | 76 | * |
| 88 | * @return no action instruction | 77 | * @return no action instruction |
| ... | @@ -484,42 +473,6 @@ public final class Instructions { | ... | @@ -484,42 +473,6 @@ public final class Instructions { |
| 484 | } | 473 | } |
| 485 | 474 | ||
| 486 | /** | 475 | /** |
| 487 | - * Drop instruction. | ||
| 488 | - * @deprecated 1.4.0 Emu Release | ||
| 489 | - */ | ||
| 490 | - @Deprecated | ||
| 491 | - public static final class DropInstruction implements Instruction { | ||
| 492 | - | ||
| 493 | - private DropInstruction() {} | ||
| 494 | - | ||
| 495 | - @Override | ||
| 496 | - public Type type() { | ||
| 497 | - return Type.DROP; | ||
| 498 | - } | ||
| 499 | - | ||
| 500 | - @Override | ||
| 501 | - public String toString() { | ||
| 502 | - return type().toString(); | ||
| 503 | - } | ||
| 504 | - | ||
| 505 | - @Override | ||
| 506 | - public int hashCode() { | ||
| 507 | - return type().ordinal(); | ||
| 508 | - } | ||
| 509 | - | ||
| 510 | - @Override | ||
| 511 | - public boolean equals(Object obj) { | ||
| 512 | - if (this == obj) { | ||
| 513 | - return true; | ||
| 514 | - } | ||
| 515 | - if (obj instanceof DropInstruction) { | ||
| 516 | - return true; | ||
| 517 | - } | ||
| 518 | - return false; | ||
| 519 | - } | ||
| 520 | - } | ||
| 521 | - | ||
| 522 | - /** | ||
| 523 | * No Action instruction. | 476 | * No Action instruction. |
| 524 | */ | 477 | */ |
| 525 | public static final class NoActionInstruction implements Instruction { | 478 | public static final class NoActionInstruction implements Instruction { | ... | ... |
| ... | @@ -101,7 +101,6 @@ public class InstructionsTest { | ... | @@ -101,7 +101,6 @@ public class InstructionsTest { |
| 101 | */ | 101 | */ |
| 102 | @Test | 102 | @Test |
| 103 | public void testImmutabilityOfInstructions() { | 103 | public void testImmutabilityOfInstructions() { |
| 104 | - assertThatClassIsImmutable(Instructions.DropInstruction.class); | ||
| 105 | assertThatClassIsImmutable(Instructions.OutputInstruction.class); | 104 | assertThatClassIsImmutable(Instructions.OutputInstruction.class); |
| 106 | assertThatClassIsImmutable(L0ModificationInstruction.ModLambdaInstruction.class); | 105 | assertThatClassIsImmutable(L0ModificationInstruction.ModLambdaInstruction.class); |
| 107 | assertThatClassIsImmutable(L0ModificationInstruction.ModOchSignalInstruction.class); | 106 | assertThatClassIsImmutable(L0ModificationInstruction.ModOchSignalInstruction.class); |
| ... | @@ -155,40 +154,6 @@ public class InstructionsTest { | ... | @@ -155,40 +154,6 @@ public class InstructionsTest { |
| 155 | assertThat(noAction1.hashCode(), is(equalTo(noAction2.hashCode()))); | 154 | assertThat(noAction1.hashCode(), is(equalTo(noAction2.hashCode()))); |
| 156 | } | 155 | } |
| 157 | 156 | ||
| 158 | - // DropInstruction | ||
| 159 | - | ||
| 160 | - private final Instructions.DropInstruction drop1 = Instructions.createDrop(); | ||
| 161 | - private final Instructions.DropInstruction drop2 = Instructions.createDrop(); | ||
| 162 | - | ||
| 163 | - /** | ||
| 164 | - * Test the createDrop method. | ||
| 165 | - */ | ||
| 166 | - @Test | ||
| 167 | - public void testCreateDropMethod() { | ||
| 168 | - Instructions.DropInstruction instruction = Instructions.createDrop(); | ||
| 169 | - checkAndConvert(instruction, | ||
| 170 | - Instruction.Type.DROP, | ||
| 171 | - Instructions.DropInstruction.class); | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - /** | ||
| 175 | - * Test the equals() method of the DropInstruction class. | ||
| 176 | - */ | ||
| 177 | - | ||
| 178 | - @Test | ||
| 179 | - public void testDropInstructionEquals() throws Exception { | ||
| 180 | - assertThat(drop1, is(equalTo(drop2))); | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - /** | ||
| 184 | - * Test the hashCode() method of the DropInstruction class. | ||
| 185 | - */ | ||
| 186 | - | ||
| 187 | - @Test | ||
| 188 | - public void testDropInstructionHashCode() { | ||
| 189 | - assertThat(drop1.hashCode(), is(equalTo(drop2.hashCode()))); | ||
| 190 | - } | ||
| 191 | - | ||
| 192 | // OutputInstruction | 157 | // OutputInstruction |
| 193 | 158 | ||
| 194 | private final PortNumber port1 = portNumber(1); | 159 | private final PortNumber port1 = portNumber(1); | ... | ... |
| ... | @@ -257,8 +257,8 @@ public final class DecodeInstructionCodecHelper { | ... | @@ -257,8 +257,8 @@ public final class DecodeInstructionCodecHelper { |
| 257 | + " is not supported"); | 257 | + " is not supported"); |
| 258 | } | 258 | } |
| 259 | return Instructions.createOutput(portNumber); | 259 | return Instructions.createOutput(portNumber); |
| 260 | - } else if (type.equals(Instruction.Type.DROP.name())) { | 260 | + } else if (type.equals(Instruction.Type.NOACTION.name())) { |
| 261 | - return Instructions.createDrop(); | 261 | + return Instructions.createNoAction(); |
| 262 | } else if (type.equals(Instruction.Type.L0MODIFICATION.name())) { | 262 | } else if (type.equals(Instruction.Type.L0MODIFICATION.name())) { |
| 263 | return decodeL0(); | 263 | return decodeL0(); |
| 264 | } else if (type.equals(Instruction.Type.L1MODIFICATION.name())) { | 264 | } else if (type.equals(Instruction.Type.L1MODIFICATION.name())) { | ... | ... |
| ... | @@ -73,18 +73,6 @@ public class InstructionCodecTest { | ... | @@ -73,18 +73,6 @@ public class InstructionCodecTest { |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | - * Tests the encoding of drop instructions. | ||
| 77 | - */ | ||
| 78 | - @Test | ||
| 79 | - public void dropInstructionTest() { | ||
| 80 | - final Instructions.DropInstruction instruction = | ||
| 81 | - Instructions.createDrop(); | ||
| 82 | - final ObjectNode instructionJson = | ||
| 83 | - instructionCodec.encode(instruction, context); | ||
| 84 | - assertThat(instructionJson, matchesInstruction(instruction)); | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - /** | ||
| 88 | * Tests the encoding of output instructions. | 76 | * Tests the encoding of output instructions. |
| 89 | */ | 77 | */ |
| 90 | @Test | 78 | @Test | ... | ... |
| ... | @@ -20,7 +20,6 @@ import org.hamcrest.TypeSafeDiagnosingMatcher; | ... | @@ -20,7 +20,6 @@ import org.hamcrest.TypeSafeDiagnosingMatcher; |
| 20 | import org.onlab.util.HexString; | 20 | import org.onlab.util.HexString; |
| 21 | import org.onosproject.net.OduSignalId; | 21 | import org.onosproject.net.OduSignalId; |
| 22 | import org.onosproject.net.flow.instructions.Instruction; | 22 | import org.onosproject.net.flow.instructions.Instruction; |
| 23 | -import org.onosproject.net.flow.instructions.Instructions.DropInstruction; | ||
| 24 | import org.onosproject.net.flow.instructions.Instructions.NoActionInstruction; | 23 | import org.onosproject.net.flow.instructions.Instructions.NoActionInstruction; |
| 25 | import org.onosproject.net.flow.instructions.Instructions.OutputInstruction; | 24 | import org.onosproject.net.flow.instructions.Instructions.OutputInstruction; |
| 26 | import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModLambdaInstruction; | 25 | import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModLambdaInstruction; |
| ... | @@ -452,8 +451,6 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json | ... | @@ -452,8 +451,6 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json |
| 452 | 451 | ||
| 453 | if (instruction instanceof PushHeaderInstructions) { | 452 | if (instruction instanceof PushHeaderInstructions) { |
| 454 | return matchPushHeaderInstruction(jsonInstruction, description); | 453 | return matchPushHeaderInstruction(jsonInstruction, description); |
| 455 | - } else if (instruction instanceof DropInstruction) { | ||
| 456 | - return true; | ||
| 457 | } else if (instruction instanceof OutputInstruction) { | 454 | } else if (instruction instanceof OutputInstruction) { |
| 458 | return matchOutputInstruction(jsonInstruction, description); | 455 | return matchOutputInstruction(jsonInstruction, description); |
| 459 | } else if (instruction instanceof ModLambdaInstruction) { | 456 | } else if (instruction instanceof ModLambdaInstruction) { | ... | ... |
| ... | @@ -17,8 +17,8 @@ | ... | @@ -17,8 +17,8 @@ |
| 17 | "instructions": | 17 | "instructions": |
| 18 | [ | 18 | [ |
| 19 | {"type":"OUTPUT","port":-3}, | 19 | {"type":"OUTPUT","port":-3}, |
| 20 | - {"type":"DROP"} | 20 | + {"type":"NOACTION"} |
| 21 | ], | 21 | ], |
| 22 | "deferred":[] | 22 | "deferred":[] |
| 23 | } | 23 | } |
| 24 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 24 | +} | ... | ... |
| ... | @@ -10,7 +10,7 @@ | ... | @@ -10,7 +10,7 @@ |
| 10 | "port": -3 | 10 | "port": -3 |
| 11 | }, | 11 | }, |
| 12 | { | 12 | { |
| 13 | - "type": "DROP" | 13 | + "type": "NOACTION" |
| 14 | } | 14 | } |
| 15 | ], | 15 | ], |
| 16 | "deferred": [] | 16 | "deferred": [] |
| ... | @@ -24,4 +24,4 @@ | ... | @@ -24,4 +24,4 @@ |
| 24 | } | 24 | } |
| 25 | ] | 25 | ] |
| 26 | } | 26 | } |
| 27 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 27 | +} | ... | ... |
| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 8 | "instructions": | 8 | "instructions": |
| 9 | [ | 9 | [ |
| 10 | {"type":"OUTPUT","port":-3}, | 10 | {"type":"OUTPUT","port":-3}, |
| 11 | - {"type":"DROP"}, | 11 | + {"type":"NOACTION"}, |
| 12 | {"type":"L2MODIFICATION","subtype":"ETH_SRC","mac":"12:34:56:78:90:12"}, | 12 | {"type":"L2MODIFICATION","subtype":"ETH_SRC","mac":"12:34:56:78:90:12"}, |
| 13 | {"type":"L2MODIFICATION","subtype":"ETH_DST","mac":"98:76:54:32:01:00"}, | 13 | {"type":"L2MODIFICATION","subtype":"ETH_DST","mac":"98:76:54:32:01:00"}, |
| 14 | {"type":"L2MODIFICATION","subtype":"VLAN_ID","vlanId":22}, | 14 | {"type":"L2MODIFICATION","subtype":"VLAN_ID","vlanId":22}, | ... | ... |
| ... | @@ -382,7 +382,6 @@ public final class KryoNamespaces { | ... | @@ -382,7 +382,6 @@ public final class KryoNamespaces { |
| 382 | Criterion.class, | 382 | Criterion.class, |
| 383 | Criterion.Type.class, | 383 | Criterion.Type.class, |
| 384 | DefaultTrafficTreatment.class, | 384 | DefaultTrafficTreatment.class, |
| 385 | - Instructions.DropInstruction.class, | ||
| 386 | Instructions.NoActionInstruction.class, | 385 | Instructions.NoActionInstruction.class, |
| 387 | Instructions.OutputInstruction.class, | 386 | Instructions.OutputInstruction.class, |
| 388 | Instructions.GroupInstruction.class, | 387 | Instructions.GroupInstruction.class, | ... | ... |
| ... | @@ -118,7 +118,7 @@ public class DefaultSingleTablePipeline extends AbstractHandlerBehaviour impleme | ... | @@ -118,7 +118,7 @@ public class DefaultSingleTablePipeline extends AbstractHandlerBehaviour impleme |
| 118 | (fwd.treatment().tableTransition() == null) && | 118 | (fwd.treatment().tableTransition() == null) && |
| 119 | (!fwd.treatment().clearedDeferred())) { | 119 | (!fwd.treatment().clearedDeferred())) { |
| 120 | TrafficTreatment.Builder flowTreatment = DefaultTrafficTreatment.builder(); | 120 | TrafficTreatment.Builder flowTreatment = DefaultTrafficTreatment.builder(); |
| 121 | - flowTreatment.add(Instructions.createDrop()); | 121 | + flowTreatment.add(Instructions.createNoAction()); |
| 122 | treatment = flowTreatment.build(); | 122 | treatment = flowTreatment.build(); |
| 123 | } | 123 | } |
| 124 | 124 | ... | ... |
| ... | @@ -293,7 +293,7 @@ public class OpenVSwitchPipeline extends DefaultSingleTablePipeline | ... | @@ -293,7 +293,7 @@ public class OpenVSwitchPipeline extends DefaultSingleTablePipeline |
| 293 | // MAC table flow rules | 293 | // MAC table flow rules |
| 294 | if ((selector.getCriterion(Type.TUNNEL_ID) != null && selector | 294 | if ((selector.getCriterion(Type.TUNNEL_ID) != null && selector |
| 295 | .getCriterion(Type.ETH_DST) != null) | 295 | .getCriterion(Type.ETH_DST) != null) |
| 296 | - || tb.allInstructions().contains(Instructions.createDrop())) { | 296 | + || tb.allInstructions().contains(Instructions.createNoAction())) { |
| 297 | forTable = MAC_TABLE; | 297 | forTable = MAC_TABLE; |
| 298 | return reassemblyFlowRule(ruleBuilder, tb, transition, forTable); | 298 | return reassemblyFlowRule(ruleBuilder, tb, transition, forTable); |
| 299 | } | 299 | } | ... | ... |
| ... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
| 17 | "instructions": | 17 | "instructions": |
| 18 | [ | 18 | [ |
| 19 | {"type":"OUTPUT","port":-3}, | 19 | {"type":"OUTPUT","port":-3}, |
| 20 | - {"type":"DROP"} | 20 | + {"type":"NOACTION"} |
| 21 | ] | 21 | ] |
| 22 | } | 22 | } |
| 23 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 23 | +} | ... | ... |
| ... | @@ -10,7 +10,7 @@ | ... | @@ -10,7 +10,7 @@ |
| 10 | "port": -3 | 10 | "port": -3 |
| 11 | }, | 11 | }, |
| 12 | { | 12 | { |
| 13 | - "type": "DROP" | 13 | + "type": "NOACTION" |
| 14 | } | 14 | } |
| 15 | ] | 15 | ] |
| 16 | } | 16 | } |
| ... | @@ -23,4 +23,4 @@ | ... | @@ -23,4 +23,4 @@ |
| 23 | } | 23 | } |
| 24 | ] | 24 | ] |
| 25 | } | 25 | } |
| 26 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 26 | +} | ... | ... |
-
Please register or login to post a comment