@Test public void testAssignFromPatPool() { int poolStart = 2000; int poolEnd = 3000; Transformation transformation = always().apply(assignSourcePort(poolStart, poolEnd)).build(); Transition transition = _toTransition.toTransition(transformation); BDD poolBdd = _pkt.getSrcPort().geq(poolStart).and(_pkt.getSrcPort().leq(poolEnd)); BDD nonPoolPortBdd = _pkt.getSrcPort().value(poolEnd + 2); BDD expectedOut = _portTransformationProtocols.imp(poolBdd); BDD actualOut = transition.transitForward(_one); assertThat(actualOut, equalTo(expectedOut)); expectedOut = _portTransformationProtocols.imp(poolBdd); actualOut = transition.transitForward(expectedOut); assertThat(actualOut, equalTo(expectedOut)); expectedOut = _portTransformationProtocols.not(); actualOut = transition.transitForward(expectedOut); assertThat(actualOut, equalTo(expectedOut)); BDD expectedIn = _one; BDD actualIn = transition.transitBackward(_portTransformationProtocols.imp(poolBdd)); assertThat(actualIn, equalTo(expectedIn)); expectedIn = _zero; actualIn = transition.transitBackward(_portTransformationProtocols.and(nonPoolPortBdd)); assertThat(actualIn, equalTo(expectedIn)); expectedIn = _portTransformationProtocols.not(); actualIn = transition.transitBackward(expectedIn); assertThat(actualIn, equalTo(expectedIn)); }
public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); Transition toTransition(@Nullable Transformation transformation); Transition toReturnFlowTransition(@Nullable Transformation transformation); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); Transition toTransition(@Nullable Transformation transformation); Transition toReturnFlowTransition(@Nullable Transformation transformation);  }