blob: c9f1754b97a6aa917c0a46938eba01a510d92c64 [file] [log] [blame]
Phaneendra Manda0f21ad62016-02-12 19:32:13 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Phaneendra Manda0f21ad62016-02-12 19:32:13 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.sfc.util;
18
19import org.onosproject.net.behaviour.ExtensionSelectorResolver;
20import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
21import org.onosproject.net.driver.Behaviour;
22import org.onosproject.net.driver.Driver;
23import org.onosproject.net.driver.DriverData;
24import org.onosproject.net.driver.DriverHandler;
25
26public class MockDriverHandler implements DriverHandler {
27
28 @Override
29 public Driver driver() {
30 return null;
31 }
32
33 @Override
34 public DriverData data() {
35 return null;
36 }
37
38 @Override
39 public <T extends Behaviour> T behaviour(Class<T> behaviourClass) {
40 if (behaviourClass == ExtensionSelectorResolver.class) {
41 return (T) new MockExtensionSelectorResolver();
42 } else if (behaviourClass == ExtensionTreatmentResolver.class) {
43 return (T) new MockExtensionTreatmentResolver();
44 }
45 return null;
46 }
47
48 @Override
49 public <T> T get(Class<T> serviceClass) {
50 return null;
51 }
52}