+/*
+ * 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;
package org.opendaylight.controller.test.sal.binding.it;
import static org.junit.Assert.assertEquals;
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.BindingAwareConsumer;
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.BindingAwareConsumer;
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.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.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.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;
- private FlowListener listener1 = new FlowListener();
- private FlowListener listener2 = new FlowListener();
+ private final FlowListener listener1 = new FlowListener();
+ private final FlowListener listener2 = new FlowListener();
private Registration<NotificationListener> listener1Reg;
private Registration<NotificationListener> listener2Reg;
private Registration<NotificationListener> listener1Reg;
private Registration<NotificationListener> listener2Reg;
* The registration of the Consumer 1. It retrieves Notification Service
* from MD-SAL and registers SalFlowListener as notification listener
* The registration of the Consumer 1. It retrieves Notification Service
* from MD-SAL and registers SalFlowListener as notification listener
*/
assertEquals(1, listener1.addedFlows.size());
assertEquals(0, listener1.addedFlows.get(0).getCookie().intValue());
*/
assertEquals(1, listener1.addedFlows.size());
assertEquals(0, listener1.addedFlows.get(0).getCookie().intValue());
* The registration of the Consumer 2. SalFlowListener is registered
* registered as notification listener.
*/
* The registration of the Consumer 2. SalFlowListener is registered
* registered as notification listener.
*/
+
+ @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;
+ }
+
/**
* Check that 3 notification was delivered to both listeners (first one
* received 4 in total, second 3 in total).
/**
* Check that 3 notification was delivered to both listeners (first one
* received 4 in total, second 3 in total).
*/
assertEquals(4, listener1.addedFlows.size());
assertEquals(3, listener2.addedFlows.size());
/**
* The second listener is closed (unregistered)
*/
assertEquals(4, listener1.addedFlows.size());
assertEquals(3, listener2.addedFlows.size());
/**
* The second listener is closed (unregistered)
* Check that first consumer received 5 notifications in total, second
* consumer received only three. Last notification was never received by
* second consumer because its listener was unregistered.
* Check that first consumer received 5 notifications in total, second
* consumer received only three. Last notification was never received by
* second consumer because its listener was unregistered.
*/
assertEquals(5, listener1.addedFlows.size());
assertEquals(3, listener2.addedFlows.size());
*/
assertEquals(5, listener1.addedFlows.size());
assertEquals(3, listener2.addedFlows.size());
/**
* Creates instance of the type FlowAdded. Only cookie value is set. It is
* used only for testing purpose.
/**
* Creates instance of the type FlowAdded. Only cookie value is set. It is
* used only for testing purpose.
* Implements
* {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener
* SalFlowListener} and contains attributes which keep lists of objects of
* Implements
* {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener
* SalFlowListener} and contains attributes which keep lists of objects of
+
+ }
+
+ @Override
+ public void onNodeErrorNotification(NodeErrorNotification notification) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onNodeExperimenterErrorNotification(
+ NodeExperimenterErrorNotification notification) {
+ // TODO Auto-generated method stub
+