From 7a583394d0e81993e31c830a9d22f3ebb2a6de3e Mon Sep 17 00:00:00 2001 From: Srihari Raghavan Date: Sun, 26 Feb 2017 21:15:32 +0530 Subject: HC2VPP-63 Fix mistakenly used addStructuralReader. Thanks Jan Srnicek. Change-Id: I2b3eb827ebd98a9260a514041489c602e2d409e4 Signed-off-by: Srihari Raghavan --- .../io/fd/hc2vpp/vppioam/impl/VppIoamModule.java | 3 +- .../impl/config/IoamExportWriterCustomizer.java | 11 +++--- .../impl/config/IoamPotWriterCustomizer.java | 30 +++++++++-------- .../impl/config/IoamTraceWriterCustomizer.java | 9 ++--- .../vppioam/impl/config/VppIoamWriterFactory.java | 24 ++++++------- .../impl/oper/PotProfileReaderCustomizer.java | 14 ++++---- .../impl/oper/TraceProfileReaderCustomizer.java | 24 +++++++------ .../vppioam/impl/oper/VppIoamReaderFactory.java | 39 ++++++++++++++-------- .../impl/config/IoamPotWriterCustomizerTest.java | 20 +++++------ .../impl/oper/PotProfileReaderCustomizerTest.java | 10 +++--- 10 files changed, 102 insertions(+), 82 deletions(-) (limited to 'ioam') diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/VppIoamModule.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/VppIoamModule.java index 228653c1c..4c143131c 100755 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/VppIoamModule.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/VppIoamModule.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.fd.hc2vpp.vppioam.impl; import com.google.common.annotations.VisibleForTesting; @@ -36,7 +37,7 @@ import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtraceFacade; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** +/* * Glue code necessary for Honeycomb distribution to pick up the plugin classes */ public final class VppIoamModule extends AbstractModule { diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamExportWriterCustomizer.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamExportWriterCustomizer.java index 2172750d4..1d90b0e85 100644 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamExportWriterCustomizer.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamExportWriterCustomizer.java @@ -36,8 +36,8 @@ public class IoamExportWriterCustomizer extends FutureJVppIoamexportCustomizer private static final Logger LOG = LoggerFactory.getLogger(IoamExportWriterCustomizer.class); - public IoamExportWriterCustomizer(FutureJVppIoamexport jVppIoamexport){ - super(jVppIoamexport); + public IoamExportWriterCustomizer(FutureJVppIoamexport jVppIoamExport){ + super(jVppIoamExport); } @Override @@ -67,10 +67,11 @@ public class IoamExportWriterCustomizer extends FutureJVppIoamexportCustomizer private IoamExportIp6EnableDisableReply addExportProfile(IoamExport ioamExport, InstanceIdentifier id) throws WriteFailedException { IoamExportIp6EnableDisable request = new IoamExportIp6EnableDisable(); - if (ioamExport.isDisable()==null) + if (ioamExport.isDisable() == null) { request.isDisable = 1; - else - request.isDisable = (byte)(ioamExport.isDisable()?1:0); + } else { + request.isDisable = (byte)(ioamExport.isDisable() ? 1 : 0); + } request.srcAddress = ipv4AddressNoZoneToArray(ioamExport.getSourceAddress().getValue()); request.collectorAddress = ipv4AddressNoZoneToArray(ioamExport.getCollectorAddress().getValue()); return getReplyForCreate(getFutureJVppIoamexport() diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizer.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizer.java index 7df956e68..19b1069ee 100644 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizer.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizer.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.fd.hc2vpp.vppioam.impl.config; @@ -114,8 +115,9 @@ public class IoamPotWriterCustomizer extends FutureJVppIoampotCustomizer impleme LOG.info("POT profile deleted iid={}, added {}", id, dataBefore); } - private void addPotProfile(PotProfileSet potProfileSet, InstanceIdentifier id) throws WriteFailedException{ - for(PotProfileList potProfileList:potProfileSet.getPotProfileList()) { + private void addPotProfile(PotProfileSet potProfileSet, + InstanceIdentifier id) throws WriteFailedException { + for ( PotProfileList potProfileList : potProfileSet.getPotProfileList()) { writePotProfileList(potProfileList,potProfileSet.getName(),id); } } @@ -123,18 +125,18 @@ public class IoamPotWriterCustomizer extends FutureJVppIoampotCustomizer impleme private PotProfileAddReply writePotProfileList(PotProfileList potProfileList, String name, InstanceIdentifier id) throws WriteFailedException{ PotProfileAdd request = new PotProfileAdd(); - request.id = potProfileList.getIndex().getValue().byteValue(); - request.validator = (byte) (potProfileList.isValidator() ? 1 : 0); - request.secretShare = potProfileList.getSecretShare().longValue(); - request.prime = potProfileList.getPrimeNumber().longValue(); - request.secretKey = potProfileList.isValidator() ? potProfileList.getValidatorKey().longValue() : 0; - request.maxBits = potProfileList.getNumberOfBits().byteValue(); - request.lpc = potProfileList.getLpc().longValue(); - request.polynomialPublic = potProfileList.getPublicPolynomial().longValue(); - request.listNameLen = (byte) name.getBytes(StandardCharsets.UTF_8).length; - request.listName = name.getBytes(StandardCharsets.UTF_8); - - return getReplyForWrite(getFutureJVppIoampot().potProfileAdd(request).toCompletableFuture(), id); + request.id = potProfileList.getIndex().getValue().byteValue(); + request.validator = (byte) (potProfileList.isValidator() ? 1 : 0); + request.secretShare = potProfileList.getSecretShare().longValue(); + request.prime = potProfileList.getPrimeNumber().longValue(); + request.secretKey = potProfileList.isValidator() ? potProfileList.getValidatorKey().longValue() : 0; + request.maxBits = potProfileList.getNumberOfBits().byteValue(); + request.lpc = potProfileList.getLpc().longValue(); + request.polynomialPublic = potProfileList.getPublicPolynomial().longValue(); + request.listNameLen = (byte) name.getBytes(StandardCharsets.UTF_8).length; + request.listName = name.getBytes(StandardCharsets.UTF_8); + + return getReplyForWrite(getFutureJVppIoampot().potProfileAdd(request).toCompletableFuture(), id); } private PotProfileDelReply delPotProfile(PotProfileSet potProfileSet, InstanceIdentifier id) diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizer.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizer.java index 12347946f..a8478b931 100755 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizer.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/IoamTraceWriterCustomizer.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.fd.hc2vpp.vppioam.impl.config; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; @@ -92,7 +93,7 @@ public class IoamTraceWriterCustomizer extends FutureJVppIoamtraceCustomizer } public TraceProfileAddReply addTraceConfig(TraceConfig traceConfig, - final InstanceIdentifier id) throws Exception { + final InstanceIdentifier id) throws Exception { TraceProfileAdd traceProfileAdd = new TraceProfileAdd(); traceProfileAdd.traceType = traceConfig.getTraceType().byteValue(); //trace type @@ -102,9 +103,9 @@ public class IoamTraceWriterCustomizer extends FutureJVppIoamtraceCustomizer traceProfileAdd.nodeId = traceConfig.getNodeId().intValue(); // nodeid /* Write to VPP */ - final TraceProfileAddReply reply = getReplyForWrite((getFutureJVppIoamtrace(). - traceProfileAdd(traceProfileAdd). - toCompletableFuture()), id); + final TraceProfileAddReply reply = getReplyForWrite((getFutureJVppIoamtrace() + .traceProfileAdd(traceProfileAdd) + .toCompletableFuture()), id); return reply; } diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java index ba105eb39..5728327fa 100755 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/config/VppIoamWriterFactory.java @@ -38,19 +38,19 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class VppIoamWriterFactory implements WriterFactory { @Nonnull - private final FutureJVppIoamtrace jVppIoamtrace; + private final FutureJVppIoamtrace jVppIoamTrace; @Nonnull - private final FutureJVppIoampot jVppIoampot; + private final FutureJVppIoampot jVppIoamPot; @Nonnull - private final FutureJVppIoamexport jVppIoamexport; + private final FutureJVppIoamexport jVppIoamExport; @Inject - public VppIoamWriterFactory(@Nonnull final FutureJVppIoamtrace jVppIoamtrace, - @Nonnull final FutureJVppIoampot jVppIoampot, - @Nonnull final FutureJVppIoamexport jVppIoamexport) { - this.jVppIoamtrace = jVppIoamtrace; - this.jVppIoampot = jVppIoampot; - this.jVppIoamexport = jVppIoamexport; + public VppIoamWriterFactory(@Nonnull final FutureJVppIoamtrace jVppIoamTrace, + @Nonnull final FutureJVppIoampot jVppIoamPot, + @Nonnull final FutureJVppIoamexport jVppIoamExport) { + this.jVppIoamTrace = jVppIoamTrace; + this.jVppIoamPot = jVppIoamPot; + this.jVppIoamExport = jVppIoamExport; } @Override @@ -60,17 +60,17 @@ public class VppIoamWriterFactory implements WriterFactory { InstanceIdentifier.create(IoamTraceConfig.class).child(TraceConfig.class); registry.subtreeAdd(Sets.newHashSet(InstanceIdentifier.create(TraceConfig.class) .child(NodeInterfaces.class)), - new GenericListWriter<>(trId, new IoamTraceWriterCustomizer(jVppIoamtrace))); + new GenericListWriter<>(trId, new IoamTraceWriterCustomizer(jVppIoamTrace))); // POT Config final InstanceIdentifier potId = InstanceIdentifier.create(PotProfiles.class).child(PotProfileSet.class); registry.subtreeAdd(Sets.newHashSet(InstanceIdentifier.create(PotProfileSet.class) .child(PotProfileList.class)), - new GenericListWriter<>(potId, new IoamPotWriterCustomizer(jVppIoampot))); + new GenericListWriter<>(potId, new IoamPotWriterCustomizer(jVppIoamPot))); //Export Config final InstanceIdentifier exportId = InstanceIdentifier.create(IoamExport.class); - registry.add(new GenericWriter<>(exportId,new IoamExportWriterCustomizer(jVppIoamexport))); + registry.add(new GenericWriter<>(exportId,new IoamExportWriterCustomizer(jVppIoamExport))); } } diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizer.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizer.java index 860fc07df..f9d229a9c 100644 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizer.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizer.java @@ -46,8 +46,8 @@ public class PotProfileReaderCustomizer extends FutureJVppIoampotCustomizer impl private static final Logger LOG = LoggerFactory.getLogger(PotProfileReaderCustomizer.class); - public PotProfileReaderCustomizer(FutureJVppIoampot futureJVppIoampot){ - super(futureJVppIoampot); + public PotProfileReaderCustomizer(FutureJVppIoampot futureJVppIoamPot) { + super(futureJVppIoamPot); } @Nonnull @@ -101,7 +101,7 @@ public class PotProfileReaderCustomizer extends FutureJVppIoampotCustomizer impl final PotProfileShowConfigDetails details = reply.potProfileShowConfigDetails.get(0); - builder.setValidator(details.validator==1); + builder.setValidator(details.validator == 1); builder.setValidatorKey(BigInteger.valueOf(details.secretKey)); builder.setSecretShare(BigInteger.valueOf(details.secretShare)); builder.setPrimeNumber(BigInteger.valueOf(details.prime)); @@ -110,13 +110,13 @@ public class PotProfileReaderCustomizer extends FutureJVppIoampotCustomizer impl builder.setLpc(BigInteger.valueOf(details.lpc)); builder.setNumberOfBits(getMaxBitsfromBitmask(BigInteger.valueOf(details.bitMask))); - LOG.info("Item {} successfully read: {}",instanceIdentifier,builder.build()); + LOG.info("Item {} successfully read: {}",instanceIdentifier, builder.build()); } - private static short getMaxBitsfromBitmask (BigInteger bitmask){ + private static short getMaxBitsfromBitmask (BigInteger bitmask) { short numOfBits = 0; - while ((bitmask.and(BigInteger.ONE)).equals(BigInteger.ONE)){ - bitmask=bitmask.shiftRight(1); + while ((bitmask.and(BigInteger.ONE)).equals(BigInteger.ONE)) { + bitmask = bitmask.shiftRight(1); numOfBits++; } return numOfBits; diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/TraceProfileReaderCustomizer.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/TraceProfileReaderCustomizer.java index dee207b48..a6bb1ff76 100644 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/TraceProfileReaderCustomizer.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/TraceProfileReaderCustomizer.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.fd.hc2vpp.vppioam.impl.oper; import com.google.common.collect.Lists; @@ -50,7 +51,7 @@ public class TraceProfileReaderCustomizer extends FutureJVppIoamtraceCustomizer /** * Creates new builder that will be used to build read value. * - * @param id + * @param id Identifier */ @Nonnull @Override @@ -89,17 +90,18 @@ public class TraceProfileReaderCustomizer extends FutureJVppIoamtraceCustomizer LOG.debug("reading attribute for trace config {}",id); final TraceProfileShowConfig request = new TraceProfileShowConfig(); - TraceProfileShowConfigReply reply = getReplyForRead(getFutureJVppIoamtrace().traceProfileShowConfig(request) + TraceProfileShowConfigReply reply = getReplyForRead (getFutureJVppIoamtrace().traceProfileShowConfig(request) .toCompletableFuture(),id); - if(reply == null) { + if (reply == null) { LOG.debug("{} returned null as reply from vpp",id); return; } - if(reply.traceType == 0){ + if (reply.traceType == 0) { LOG.debug("{} no configured trace config found",id); return; } + builder.setNodeId((long) reply.nodeId); builder.setTraceAppData((long) reply.appData); builder.setTraceNumElt((short) reply.numElts); @@ -112,8 +114,8 @@ public class TraceProfileReaderCustomizer extends FutureJVppIoamtraceCustomizer /** * Merge read data into provided parent builder. * - * @param parentBuilder - * @param readValue + * @param parentBuilder Parent Builder + * @param readValue Read Value */ @Override public void merge(@Nonnull Builder parentBuilder, @Nonnull TraceConfig readValue) { @@ -123,6 +125,11 @@ public class TraceProfileReaderCustomizer extends FutureJVppIoamtraceCustomizer builder.setTraceConfig(traceConfigs); } + @Override + public void merge(@Nonnull final Builder builder, @Nonnull final List list) { + ((IoamTraceConfigBuilder) builder).setTraceConfig(list); + } + @Nonnull @Override public List getAllIds(@Nonnull final InstanceIdentifier instanceIdentifier, @@ -133,9 +140,4 @@ public class TraceProfileReaderCustomizer extends FutureJVppIoamtraceCustomizer return Lists.newArrayList(new TraceConfigKey("trace config")); } - - @Override - public void merge(@Nonnull final Builder builder, @Nonnull final List list) { - ((IoamTraceConfigBuilder) builder).setTraceConfig(list); - } } diff --git a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/VppIoamReaderFactory.java b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/VppIoamReaderFactory.java index ece73fa8c..1f6250f3d 100644 --- a/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/VppIoamReaderFactory.java +++ b/ioam/impl/src/main/java/io/fd/hc2vpp/vppioam/impl/oper/VppIoamReaderFactory.java @@ -13,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.fd.hc2vpp.vppioam.impl.oper; import io.fd.honeycomb.translate.impl.read.GenericInitListReader; +import io.fd.honeycomb.translate.impl.read.GenericListReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; import io.fd.vpp.jvpp.ioampot.future.FutureJVppIoampot; @@ -27,33 +29,41 @@ import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev170112.PotProfilesBuilder; import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev170112.pot.profile.PotProfileList; import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev170112.pot.profiles.PotProfileSet; +import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev170112.pot.profiles.PotProfileSetBuilder; +import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.ioam.sb.pot.rev170112.pot.profiles.PotProfileSetKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import javax.annotation.Nonnull; import javax.inject.Inject; +import java.util.Arrays; +import java.util.List; + public class VppIoamReaderFactory implements ReaderFactory { @Nonnull - FutureJVppIoamtrace jVppIoamtrace; + FutureJVppIoamtrace jVppIoamTrace; @Nonnull - FutureJVppIoampot jVppIoampot; + FutureJVppIoampot jVppIoamPot; @Inject - VppIoamReaderFactory(FutureJVppIoamtrace jVppIoamtrace, FutureJVppIoampot jVppIoampot){ + VppIoamReaderFactory(FutureJVppIoamtrace jVppIoamTrace, FutureJVppIoampot jVppIoamPot){ - this.jVppIoamtrace = jVppIoamtrace; - this.jVppIoampot = jVppIoampot; + this.jVppIoamTrace = jVppIoamTrace; + this.jVppIoamPot = jVppIoamPot; } /** * Initialize 1 or more readers and add them to provided registry. * - * @param registry + * @param registry Registry */ @Override public void init(@Nonnull ModifiableReaderRegistryBuilder registry) { + final PotProfileSetKey STATIC_INSTANCE_KEY = new PotProfileSetKey("static-pot-profile-instance"); + final List staticKeys = Arrays.asList(STATIC_INSTANCE_KEY); + //IoamTraceConfig (Structural) final InstanceIdentifier ioamTraceConfigId = InstanceIdentifier.create(IoamTraceConfig.class); registry.addStructuralReader(ioamTraceConfigId, IoamTraceConfigBuilder.class); @@ -61,20 +71,23 @@ public class VppIoamReaderFactory implements ReaderFactory { //TraceConfig final InstanceIdentifier traceConfigId = ioamTraceConfigId.child(TraceConfig.class); registry.add(new GenericInitListReader<>(traceConfigId, - new TraceProfileReaderCustomizer(jVppIoamtrace))); + new TraceProfileReaderCustomizer(jVppIoamTrace))); //PotProfiles (Structural) final InstanceIdentifier potProfilesInstanceIdentifier = InstanceIdentifier.create(PotProfiles.class); registry.addStructuralReader(potProfilesInstanceIdentifier, PotProfilesBuilder.class); + //PotProfileSet (Structural) - final InstanceIdentifier potProfileSetInstanceIdentifier = + final InstanceIdentifier potProfileSetInstanceIdentifier = potProfilesInstanceIdentifier.child(PotProfileSet.class); - //TODO - temporary disabled till HC2VPP-63 is resolved - //registry.addStructuralReader(potProfileSetInstanceIdentifier, PotProfileSetBuilder.class); + + registry.addStructuralListReader(potProfileSetInstanceIdentifier, PotProfileSetBuilder.class, staticKeys); + //PotProfileList - final InstanceIdentifier potProfileListInstanceIdentifier= potProfileSetInstanceIdentifier.child(PotProfileList.class); - registry.add(new GenericInitListReader<>(potProfileListInstanceIdentifier, - new PotProfileReaderCustomizer(jVppIoampot))); + final InstanceIdentifier potProfileListInstanceIdentifier = + potProfileSetInstanceIdentifier.child(PotProfileList.class); + registry.add(new GenericInitListReader<>(potProfileListInstanceIdentifier, + new PotProfileReaderCustomizer(jVppIoamPot))); } } diff --git a/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizerTest.java b/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizerTest.java index 65727a573..fa4c959c3 100644 --- a/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizerTest.java +++ b/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/config/IoamPotWriterCustomizerTest.java @@ -47,7 +47,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { @Mock - protected FutureJVppIoampot jVppIoampot; + protected FutureJVppIoampot jVppIoamPot; private IoamPotWriterCustomizer customizer; @@ -55,7 +55,7 @@ public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { @Override public void setUpTest() throws Exception { - customizer = new IoamPotWriterCustomizer(jVppIoampot); + customizer = new IoamPotWriterCustomizer(jVppIoamPot); } private static PotProfileList generatePotProfileList() { @@ -91,21 +91,21 @@ public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { private void whenPotAddThenSuccess() { final PotProfileAddReply reply = new PotProfileAddReply(); reply.context = 1; - doReturn(future(reply)).when(jVppIoampot).potProfileAdd(any(PotProfileAdd.class)); + doReturn(future(reply)).when(jVppIoamPot).potProfileAdd(any(PotProfileAdd.class)); } private void whenPotAddThenFailure() { - doReturn(failedFuture()).when(jVppIoampot).potProfileAdd(any(PotProfileAdd.class)); + doReturn(failedFuture()).when(jVppIoamPot).potProfileAdd(any(PotProfileAdd.class)); } private void whenPotDelThenSuccess() { final PotProfileDelReply reply = new PotProfileDelReply(); reply.context = 1; - doReturn(future(reply)).when(jVppIoampot).potProfileDel(any(PotProfileDel.class)); + doReturn(future(reply)).when(jVppIoamPot).potProfileDel(any(PotProfileDel.class)); } private void whenPotDelThenFailure() { - doReturn(failedFuture()).when(jVppIoampot).potProfileDel(any(PotProfileDel.class)); + doReturn(failedFuture()).when(jVppIoamPot).potProfileDel(any(PotProfileDel.class)); } private static PotProfileAdd generatePotProfileAdd() { @@ -141,7 +141,7 @@ public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { customizer.writeCurrentAttributes(id, potProfileSet, writeContext); - verify(jVppIoampot).potProfileAdd(generatePotProfileAdd()); + verify(jVppIoamPot).potProfileAdd(generatePotProfileAdd()); } @Test @@ -154,7 +154,7 @@ public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { try { customizer.writeCurrentAttributes(id, potProfileSet, writeContext); } catch (WriteFailedException e) { - verify(jVppIoampot).potProfileAdd(generatePotProfileAdd()); + verify(jVppIoamPot).potProfileAdd(generatePotProfileAdd()); return; } @@ -170,7 +170,7 @@ public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { customizer.deleteCurrentAttributes(id, potProfileSet, writeContext); - verify(jVppIoampot).potProfileDel(generatePotProfileDel(POT_TEST_NAME)); + verify(jVppIoamPot).potProfileDel(generatePotProfileDel(POT_TEST_NAME)); } @Test @@ -183,7 +183,7 @@ public class IoamPotWriterCustomizerTest extends WriterCustomizerTest { try { customizer.deleteCurrentAttributes(id, potProfileSet, writeContext); } catch (WriteFailedException e) { - verify(jVppIoampot).potProfileDel(generatePotProfileDel(POT_TEST_NAME)); + verify(jVppIoamPot).potProfileDel(generatePotProfileDel(POT_TEST_NAME)); return; } fail("WriteFailedException.DeleteFailedException was expected"); diff --git a/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizerTest.java b/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizerTest.java index 779ec19fe..80e71f610 100644 --- a/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizerTest.java +++ b/ioam/impl/src/test/java/io/fd/hc2vpp/vppioam/impl/oper/PotProfileReaderCustomizerTest.java @@ -45,19 +45,19 @@ public class PotProfileReaderCustomizerTest extends ListReaderCustomizerTest{ @Mock - FutureJVppIoampot jVppIoampot; + FutureJVppIoampot jVppIoamPot; - public PotProfileReaderCustomizerTest(){ + public PotProfileReaderCustomizerTest() { super(PotProfileList.class, PotProfileSetBuilder.class); } @Override protected ReaderCustomizer initCustomizer() { - return new PotProfileReaderCustomizer(jVppIoampot); + return new PotProfileReaderCustomizer(jVppIoamPot); } @Override - public void setUp(){ + public void setUp() { final PotProfileShowConfigDetailsReplyDump replyDump = new PotProfileShowConfigDetailsReplyDump(); final PotProfileShowConfigDetails replyDetails = new PotProfileShowConfigDetails(); replyDetails.bitMask = (long)0xF; @@ -69,7 +69,7 @@ public class PotProfileReaderCustomizerTest extends ListReaderCustomizerTest getPotProfileListId(int id){ -- cgit 1.2.3-korg