}
}
- private GeneralAugMatchNodesNodeTableFlow generalAugMatchBuilder(
+ private static GeneralAugMatchNodesNodeTableFlow generalAugMatchBuilder(
GeneralAugMatchNodesNodeTableFlow existingAugmentations, EricAugMatchNodesNodeTableFlow ericAugMatch,
Class<? extends ExtensionKey> extentionKey) {
Map<ExtensionListKey, ExtensionList> extensions = null;
}
}
- private GeneralAugMatchNodesNodeTableFlow generalAugMatchBuilder(
+ private static GeneralAugMatchNodesNodeTableFlow generalAugMatchBuilder(
GeneralAugMatchNodesNodeTableFlow existingAugmentations, NxAugMatchNodesNodeTableFlow nxAugMatch,
Class<? extends ExtensionKey> extentionKey) {
* in IPv4 Header.
* @return short
*/
- private short generateId() {
+ private static short generateId() {
Random randomgen = new Random();
return (short) randomgen.nextInt(Short.MAX_VALUE + 1);
}
}
// see GENIUS-237 why we do this optimization instead of using Entity.toString()
- private String getEntityIdentifierString(String entityType, String entityName) {
+ private static String getEntityIdentifierString(String entityType, String entityName) {
return new StringBuilder(entityType.length() + entityName.length()).append(entityType).append(entityName)
.toString();
}
private static final int FIN_IDLE_TIMEOUT = 8;
private static final int FIN_HARD_TIMEOUT = 9;
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionLearnNodesNodeTableFlowApplyActionsCase);
NxActionLearnNodesNodeTableFlowApplyActionsCase nxAction =
(NxActionLearnNodesNodeTableFlowApplyActionsCase) action.getAction();
verifyAction(buildActionLearn().buildAction());
}
- private ActionLearn buildActionLearn() {
+ private static ActionLearn buildActionLearn() {
return new ActionLearn(IDLE_TIMEOUT, HARD_TIMEOUT, PRIORITY, COOKIE, FLAGS, TABLE_ID, FIN_IDLE_TIMEOUT,
FIN_HARD_TIMEOUT,
Arrays.asList(
public class ActionLoadIpToSpaTest {
private static final String IP_ADDRESS = "1.2.3.4";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionLoadIpToSpa(IP_ADDRESS).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
public class ActionLoadMacToShaTest {
private static final String MAC_ADDRESS = "11:22:33:44:55:66";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionLoadMacToSha(new MacAddress(MAC_ADDRESS)).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
@Test
public void generateAction() {
ActionInfo actionInfo = new ActionLoadMacToSha(new MacAddress(MAC_ADDRESS));
- assertEquals(("MacAddress{_value=" + MAC_ADDRESS + "}"),
+ assertEquals("MacAddress{_value=" + MAC_ADDRESS + "}",
((ActionLoadMacToSha) actionInfo).getAddress().toString());
}
* Test class for {@link ActionMoveSourceDestinationEth}.
*/
public class ActionMoveSourceDestinationEthTest {
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionMoveSourceDestinationEth().buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
* Test class for {@link ActionMoveSourceDestinationIp}.
*/
public class ActionMoveSourceDestinationIpTest {
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionMoveSourceDestinationIp().buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
* Test class for {@link ActionMoveSourceDestinationIpv6}.
*/
public class ActionMoveSourceDestinationIpv6Test {
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionMoveSourceDestinationIpv6().buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
verifyAction(new ActionNxLoadInPort(VALUE).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
verifyAction(new ActionNxLoadMetadata(VALUE, START, END).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionCase =
(NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
private static final String IP_ADDRESS = "1.2.3.4";
private static final String IP_MASK = "32";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetDestinationIp(new Ipv4Prefix(IP_ADDRESS + "/" + IP_MASK)).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer3Match());
@Test
public void generateAction() {
ActionInfo actionInfo = new ActionSetDestinationIp(IP_ADDRESS);
- assertEquals(("Ipv4Prefix{_value=" + IP_ADDRESS + "/" + IP_MASK + "}"),
+ assertEquals("Ipv4Prefix{_value=" + IP_ADDRESS + "/" + IP_MASK + "}",
((ActionSetDestinationIp) actionInfo).getDestination().toString());
}
}
public class ActionSetFieldEthernetDestinationTest {
private static final String MAC_ADDRESS = "11:22:33:44:55:66";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetFieldEthernetDestination(new MacAddress(MAC_ADDRESS)).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getEthernetMatch());
public void generateAction() {
ActionInfo actionInfo = new ActionSetFieldEthernetDestination(new MacAddress(MAC_ADDRESS));
actionInfo.buildAction();
- assertEquals(("MacAddress{_value=" + MAC_ADDRESS + "}"),
+ assertEquals("MacAddress{_value=" + MAC_ADDRESS + "}",
((ActionSetFieldEthernetDestination) actionInfo).getDestination().toString());
}
}
public class ActionSetFieldEthernetSourceTest {
private static final String MAC_ADDRESS = "11:22:33:44:55:66";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetFieldEthernetSource(new MacAddress(MAC_ADDRESS)).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getEthernetMatch());
public void generateAction() {
ActionInfo actionInfo = new ActionSetFieldEthernetSource(new MacAddress(MAC_ADDRESS));
actionInfo.buildAction();
- assertEquals(("MacAddress{_value=" + MAC_ADDRESS + "}"),
+ assertEquals("MacAddress{_value=" + MAC_ADDRESS + "}",
((ActionSetFieldEthernetSource) actionInfo).getSource().toString());
}
}
public class ActionSetIcmpTypeTest {
private static final short TYPE = (short) 2;
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetIcmpType(TYPE).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getIcmpv4Match());
public class ActionSetIcmpv6TypeTest {
private static final short TYPE = (short) 129;
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetIcmpv6Type(TYPE).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getIcmpv6Match());
private static final String IP_ADDRESS = "1.2.3.4";
private static final String IP_MASK = "32";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetSourceIp(new Ipv4Prefix(IP_ADDRESS + "/" + IP_MASK)).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer3Match());
@Test
public void generateAction() {
ActionInfo actionInfo = new ActionSetSourceIp(IP_ADDRESS);
- assertEquals(("Ipv4Prefix{_value=" + IP_ADDRESS + "/" + IP_MASK + "}"),
+ assertEquals("Ipv4Prefix{_value=" + IP_ADDRESS + "/" + IP_MASK + "}",
((ActionSetSourceIp) actionInfo).getSource().toString());
}
}
private static final String IP_ADDRESS = "2001:db8::1";
private static final String IP_MASK = "128";
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetSourceIpv6(new Ipv6Prefix(IP_ADDRESS + "/" + IP_MASK)).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer3Match());
@Test
public void generateAction() {
ActionInfo actionInfo = new ActionSetSourceIpv6(IP_ADDRESS);
- assertEquals(("Ipv6Prefix{_value=" + IP_ADDRESS + "/" + IP_MASK + "}"),
+ assertEquals("Ipv6Prefix{_value=" + IP_ADDRESS + "/" + IP_MASK + "}",
((ActionSetSourceIpv6) actionInfo).getSource().toString());
}
}
public class ActionSetTcpDestinationPortTest {
private static final int PORT = 22;
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetTcpDestinationPort(PORT).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer4Match());
public class ActionSetTcpSourcePortTest {
private static final int PORT = 22;
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetTcpSourcePort(PORT).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer4Match());
public class ActionSetUdpDestinationPortTest {
private static final int PORT = 22;
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetUdpDestinationPort(PORT).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer4Match());
public class ActionSetUdpSourcePortTest {
private static final int PORT = 22;
- private XtendBeanGenerator generator = new XtendBeanGenerator();
+ private final XtendBeanGenerator generator = new XtendBeanGenerator();
@Test
public void actionInfoTest() {
verifyAction(new ActionSetUdpSourcePort(PORT).buildAction());
}
- private void verifyAction(Action action) {
+ private static void verifyAction(Action action) {
assertTrue(action.getAction() instanceof SetFieldCase);
SetFieldCase actionCase = (SetFieldCase) action.getAction();
assertNotNull(actionCase.getSetField().getLayer4Match());
verifyInstructionInfo(INSTRUCTION_INFO);
}
- private void verifyInstructionInfo(InstructionInfo instructionInfo) {
+ private static void verifyInstructionInfo(InstructionInfo instructionInfo) {
Instruction instruction = instructionInfo.buildInstruction(2);
assertEquals(2, instruction.key().getOrder().intValue());
assertTrue(instruction.getInstruction() instanceof ApplyActionsCase);
verifyInstructionInfo(INSTRUCTION_INFO);
}
- private void verifyInstructionInfo(InstructionInfo instructionInfo) {
+ private static void verifyInstructionInfo(InstructionInfo instructionInfo) {
Instruction instruction = instructionInfo.buildInstruction(2);
assertEquals(2, instruction.key().getOrder().intValue());
assertTrue(instruction.getInstruction() instanceof ClearActionsCase);
verifyInstructionInfo(INSTRUCTION_INFO);
}
- private void verifyInstructionInfo(InstructionInfo instructionInfo) {
+ private static void verifyInstructionInfo(InstructionInfo instructionInfo) {
Instruction instruction = instructionInfo.buildInstruction(2);
assertEquals(2, instruction.key().getOrder().intValue());
assertTrue(instruction.getInstruction() instanceof GoToTableCase);
verifyInstructionInfo(INSTRUCTION_INFO);
}
- private void verifyInstructionInfo(InstructionInfo instructionInfo) {
+ private static void verifyInstructionInfo(InstructionInfo instructionInfo) {
Instruction instruction = instructionInfo.buildInstruction(2);
assertEquals(2, instruction.key().getOrder().intValue());
assertTrue(instruction.getInstruction() instanceof WriteActionsCase);
assertEqualBeans(rebuildFlow(expected), rebuildFlow(actual));
}
- private Flow rebuildFlow(Flow flow) {
+ private static Flow rebuildFlow(Flow flow) {
FlowBuilder flowBuilder = new FlowBuilder(flow);
InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
if (flow.getInstructions() != null) {
}
}
- private List<FlowEntity> sortFlows(Iterable<FlowEntity> flowsToSort) {
+ private static List<FlowEntity> sortFlows(Iterable<FlowEntity> flowsToSort) {
List<FlowEntity> sortedFlows = Lists.newArrayList(flowsToSort);
sortedFlows.sort((flow1, flow2) -> ComparisonChain.start()
.compare(flow1.getTableId(), flow2.getTableId())
.testEquals();
}
- private MatchInPort newMatchInPort1() {
+ private static MatchInPort newMatchInPort1() {
return new MatchInPort(Uint64.ONE, 123);
}
- private MatchInPort newMatchInPort2() {
+ private static MatchInPort newMatchInPort2() {
return new MatchInPort(Uint64.valueOf(10), 456);
}
-
}