diff options
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces')
4 files changed, 25 insertions, 24 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java index 4b7489f8e..ac0a003d8 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java @@ -117,7 +117,7 @@ public class AclCustomizerTest extends WriterCustomizerTest { try { customizer.writeCurrentAttributes(id, acl, writeContext); - } catch (WriteFailedException.CreateFailedException e) { + } catch (WriteFailedException e) { assertTrue(e.getCause() instanceof VppBaseCallException); verify(api).inputAclSetInterface(generateInputAclSetInterface((byte) 1, IF_INDEX, ACL_TABLE_INDEX)); return; @@ -146,7 +146,7 @@ public class AclCustomizerTest extends WriterCustomizerTest { try { customizer.deleteCurrentAttributes(id, acl, writeContext); - } catch (WriteFailedException.DeleteFailedException e) { + } catch (WriteFailedException e) { assertTrue(e.getCause() instanceof VppBaseCallException); verify(api).inputAclSetInterface(generateInputAclSetInterface((byte) 0, IF_INDEX, ACL_TABLE_INDEX)); return; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java index 7effc876e..3cedc4f71 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java @@ -26,6 +26,10 @@ import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.vpp.util.TagRewriteOperation; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.VppInvocationException; +import io.fd.vpp.jvpp.core.dto.L2InterfaceVlanTagRewrite; +import io.fd.vpp.jvpp.core.dto.L2InterfaceVlanTagRewriteReply; import org.junit.Assert; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; @@ -40,10 +44,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.RewriteBuilder; import org.opendaylight.yangtools.yang.binding.ChildOf; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.VppInvocationException; -import io.fd.vpp.jvpp.core.dto.L2InterfaceVlanTagRewrite; -import io.fd.vpp.jvpp.core.dto.L2InterfaceVlanTagRewriteReply; public class RewriteCustomizerTest extends WriterCustomizerTest { @@ -68,10 +68,10 @@ public class RewriteCustomizerTest extends WriterCustomizerTest { private static InstanceIdentifier<Rewrite> getVlanTagRewriteId(final String name, final long index) { final Class<ChildOf<? super SubInterface>> child = (Class) Rewrite.class; final InstanceIdentifier id = - InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(name)).augmentation( - SubinterfaceAugmentation.class).child(SubInterfaces.class) - .child(SubInterface.class, new SubInterfaceKey(index)) - .child(child); + InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(name)).augmentation( + SubinterfaceAugmentation.class).child(SubInterfaces.class) + .child(SubInterface.class, new SubInterfaceKey(index)) + .child(child); return id; } @@ -96,7 +96,7 @@ public class RewriteCustomizerTest extends WriterCustomizerTest { */ private void whenL2InterfaceVlanTagRewriteThenSuccess() { doReturn(future(new L2InterfaceVlanTagRewriteReply())).when(api) - .l2InterfaceVlanTagRewrite(any(L2InterfaceVlanTagRewrite.class)); + .l2InterfaceVlanTagRewrite(any(L2InterfaceVlanTagRewrite.class)); } /** @@ -133,7 +133,7 @@ public class RewriteCustomizerTest extends WriterCustomizerTest { try { customizer.writeCurrentAttributes(VLAN_IID, vlanTagRewrite, writeContext); - } catch (WriteFailedException.CreateFailedException e) { + } catch (WriteFailedException e) { assertTrue(e.getCause() instanceof VppBaseCallException); verify(api).l2InterfaceVlanTagRewrite(generateL2InterfaceVlanTagRewrite(VLAN_IF_INDEX, op)); return; @@ -151,7 +151,7 @@ public class RewriteCustomizerTest extends WriterCustomizerTest { customizer.updateCurrentAttributes(VLAN_IID, before, after, writeContext); verify(api) - .l2InterfaceVlanTagRewrite(generateL2InterfaceVlanTagRewrite(VLAN_IF_INDEX, TagRewriteOperation.pop_1)); + .l2InterfaceVlanTagRewrite(generateL2InterfaceVlanTagRewrite(VLAN_IF_INDEX, TagRewriteOperation.pop_1)); } @Test @@ -163,10 +163,11 @@ public class RewriteCustomizerTest extends WriterCustomizerTest { try { customizer.updateCurrentAttributes(VLAN_IID, before, after, writeContext); - } catch (WriteFailedException.UpdateFailedException e) { + } catch (WriteFailedException e) { assertTrue(e.getCause() instanceof VppBaseCallException); verify(api) - .l2InterfaceVlanTagRewrite(generateL2InterfaceVlanTagRewrite(VLAN_IF_INDEX, TagRewriteOperation.pop_1)); + .l2InterfaceVlanTagRewrite( + generateL2InterfaceVlanTagRewrite(VLAN_IF_INDEX, TagRewriteOperation.pop_1)); return; } fail("WriteFailedException.UpdateFailedException was expected"); @@ -187,7 +188,7 @@ public class RewriteCustomizerTest extends WriterCustomizerTest { try { customizer.deleteCurrentAttributes(VLAN_IID, null, writeContext); - } catch (WriteFailedException.DeleteFailedException e) { + } catch (WriteFailedException e) { Assert.assertTrue(e.getCause() instanceof VppBaseCallException); verifyL2InterfaceVlanTagRewriteDeleteWasInvoked(); return; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RoutingCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RoutingCustomizerTest.java index 930e3d14f..6c7d05823 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RoutingCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RoutingCustomizerTest.java @@ -59,7 +59,7 @@ public class RoutingCustomizerTest extends WriterCustomizerTest { verify(api).swInterfaceSetTable(expectedRequest(vrfId)); } - @Test(expected = WriteFailedException.CreateFailedException.class) + @Test(expected = WriteFailedException.class) public void testWriteFailed() throws WriteFailedException { when(api.swInterfaceSetTable(any())).thenReturn(failedFuture()); customizer.writeCurrentAttributes(IID, routing(213), writeContext); @@ -72,7 +72,7 @@ public class RoutingCustomizerTest extends WriterCustomizerTest { verifyZeroInteractions(api); } - @Test(expected = WriteFailedException.UpdateFailedException.class) + @Test(expected = WriteFailedException.class) public void testUpdateFailed() throws WriteFailedException { when(api.swInterfaceSetTable(any())).thenReturn(failedFuture()); customizer.updateCurrentAttributes(IID, routing(123L), routing(321L), writeContext); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizerTest.java index f5ec496ef..e754ec9c1 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceAclCustomizerTest.java @@ -55,9 +55,9 @@ public class SubInterfaceAclCustomizerTest extends WriterCustomizerTest { private static final int TABLE_INDEX = 123; private static final InstanceIdentifier<Ingress> IID = - InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(IF_NAME)).augmentation( - SubinterfaceAugmentation.class).child(SubInterfaces.class) - .child(SubInterface.class, new SubInterfaceKey(SUBIF_ID)).child(Acl.class).child(Ingress.class); + InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(IF_NAME)).augmentation( + SubinterfaceAugmentation.class).child(SubInterfaces.class) + .child(SubInterface.class, new SubInterfaceKey(SUBIF_ID)).child(Acl.class).child(Ingress.class); @Mock private VppClassifierContextManager classifyTableContext; @@ -67,7 +67,7 @@ public class SubInterfaceAclCustomizerTest extends WriterCustomizerTest { @Override protected void setUp() throws Exception { customizer = new SubInterfaceAclCustomizer(api, new NamingContext("prefix", IFC_TEST_INSTANCE), - classifyTableContext); + classifyTableContext); defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_TEST_INSTANCE); defineMapping(mappingContext, SUBIF_NAME, SUBIF_INDEX, IFC_TEST_INSTANCE); when(classifyTableContext.getTableIndex(TABLE_NAME, mappingContext)).thenReturn(TABLE_INDEX); @@ -80,7 +80,7 @@ public class SubInterfaceAclCustomizerTest extends WriterCustomizerTest { verify(api).inputAclSetInterface(expectedIp4AclRequest()); } - @Test(expected = WriteFailedException.CreateFailedException.class) + @Test(expected = WriteFailedException.class) public void testCreateFailed() throws WriteFailedException { when(api.inputAclSetInterface(any())).thenReturn(failedFuture()); customizer.writeCurrentAttributes(IID, ip4Acl(), writeContext); @@ -98,7 +98,7 @@ public class SubInterfaceAclCustomizerTest extends WriterCustomizerTest { verify(api).inputAclSetInterface(expectedIp6AclRequest()); } - @Test(expected = WriteFailedException.DeleteFailedException.class) + @Test(expected = WriteFailedException.class) public void testDeleteFailed() throws WriteFailedException { when(api.inputAclSetInterface(any())).thenReturn(failedFuture()); customizer.deleteCurrentAttributes(IID, ip4Acl(), writeContext); |