Fixup Augmentable and Identifiable methods changing
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / test / java / org / opendaylight / openflowplugin / extension / vendor / nicira / convertor / match / ArpThaConvertorTest.java
index 22f46b2b9296cb3985d46eeb12dc39370a106f09..7e13f66cbc11b97813cc86646fe88f53b43be007 100644 (file)
@@ -58,15 +58,17 @@ public class ArpThaConvertorTest {
                 .setNxmNxArpTha(nxArpThaBuilder.build());
         final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
 
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         arpThaConvertor = new ArpThaConvertor();
     }
 
     @Test
     public void testConvertToOFJava() throws Exception {
-        final MatchEntry matchEntry = arpThaConvertor.convert(extension);
-        Assert.assertEquals(MAC_ADDRESS.getValue(), ((ArpThaCaseValue)matchEntry.getMatchEntryValue()).getArpThaValues().getMacAddress().getValue());
+        final MatchEntry converted = arpThaConvertor.convert(extension);
+        Assert.assertEquals(MAC_ADDRESS.getValue(),
+                ((ArpThaCaseValue) converted.getMatchEntryValue()).getArpThaValues().getMacAddress().getValue());
     }
 
     @Test
@@ -79,22 +81,31 @@ public class ArpThaConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(arpThaCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpThaConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpThaConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpThaConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpThaConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxArpTha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpThaConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpThaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxArpTha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpThaConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpThaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxArpTha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
-
     }
-
 }