blob: f91e629fe46502334a345f97affa6193e22aa5ea [file] [log] [blame]
Ray Milkey85267002016-11-16 11:06:35 -08001/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
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 */
Ray Milkeye022ef62016-06-08 15:17:19 -070016package org.onosproject.net.driver;
17
Ray Milkeye022ef62016-06-08 15:17:19 -070018import org.junit.Test;
Thomas Vachuskae7ea6882016-07-22 10:22:46 -070019
20import java.util.Set;
Ray Milkeye022ef62016-06-08 15:17:19 -070021
22/**
23 * Base test class for driver loading.
24 */
25public abstract class AbstractDriverLoaderTest {
26
Thomas Vachuskae7ea6882016-07-22 10:22:46 -070027 private class DriverAdminServiceAdapter extends DriverServiceAdapter implements DriverAdminService {
Ray Milkeye022ef62016-06-08 15:17:19 -070028 @Override
29 public Set<DriverProvider> getProviders() {
30 return null;
31 }
32
33 @Override
34 public void registerProvider(DriverProvider provider) {
Ray Milkeye022ef62016-06-08 15:17:19 -070035 }
36
37 @Override
38 public void unregisterProvider(DriverProvider provider) {
Ray Milkeye022ef62016-06-08 15:17:19 -070039 }
40
41 @Override
Thomas Vachuskae7ea6882016-07-22 10:22:46 -070042 public Class<? extends Behaviour> getBehaviourClass(String className) {
Ray Milkeye022ef62016-06-08 15:17:19 -070043 return null;
44 }
45 }
46
47 protected AbstractDriverLoader loader;
48
49 @Test
50 public void testLoader() {
51 loader.driverAdminService = new DriverAdminServiceAdapter();
52 loader.activate();
53 loader.deactivate();
54 }
55}