Merge "Adding FlowRef,GroupRef and MeterRef for the ErrorNotification Message"
[controller.git] / opendaylight / md-sal / sal-binding-it / src / test / java / org / opendaylight / controller / test / sal / binding / it / NoficationTest.java
index fdae91670c74ccd4ac5498f5bc4cd45ce2582e17..a55e395c5bf065f53c69dbc4afed81149e36bacc 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.test.sal.binding.it;
 
 import static org.junit.Assert.assertEquals;
@@ -5,16 +12,29 @@ import static org.junit.Assert.assertNotNull;
 
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.*;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
+import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.NotificationService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.NotificationListener;
+import org.opendaylight.yangtools.yang.binding.RpcService;
 
 public class NoficationTest extends AbstractTest {
 
@@ -86,16 +106,36 @@ public class NoficationTest extends AbstractTest {
          * The registration of the Consumer 2. SalFlowListener is registered
          * registered as notification listener.
          */
-        BindingAwareConsumer consumer2 = new BindingAwareConsumer() {
+        BindingAwareProvider provider = new BindingAwareProvider() {
+            
             @Override
-            public void onSessionInitialized(ConsumerContext session) {
+            public void onSessionInitiated(ProviderContext session) {
                 listener2Reg = session.getSALService(NotificationProviderService.class).registerNotificationListener(
                         listener2);
             }
+            
+            @Override
+            public void onSessionInitialized(ConsumerContext session) {
+                // TODO Auto-generated method stub
+                
+            }
+            
+            @Override
+            public Collection<? extends RpcService> getImplementations() {
+                // TODO Auto-generated method stub
+                return null;
+            }
+            
+            @Override
+            public Collection<? extends ProviderFunctionality> getFunctionality() {
+                // TODO Auto-generated method stub
+                return null;
+            }
+            
         };
 
         // registerConsumer method calls onSessionInitialized method above
-        broker.registerConsumer(consumer2, getBundleContext());
+        broker.registerProvider(provider, getBundleContext());
 
         /**
          * 3 notifications are published
@@ -185,12 +225,31 @@ public class NoficationTest extends AbstractTest {
         @Override
         public void onFlowRemoved(FlowRemoved notification) {
             removedFlows.add(notification);
-        };
+        }; 
 
         @Override
         public void onFlowUpdated(FlowUpdated notification) {
             updatedFlows.add(notification);
         }
 
+        @Override
+        public void onSwitchFlowRemoved(SwitchFlowRemoved notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public void onNodeErrorNotification(NodeErrorNotification notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public void onNodeExperimenterErrorNotification(
+                NodeExperimenterErrorNotification notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
     }
 }