Ray Milkey
Committed by Gerrit Code Review

Unit tests to be sure drivers will load

Change-Id: I95cd5c7ffa52727cab409541b7dd0e6d5a8d0bd4
package org.onosproject.net.driver;
import java.util.Set;
import org.junit.Test;
import org.onosproject.net.DeviceId;
/**
* Base test class for driver loading.
*/
public abstract class AbstractDriverLoaderTest {
private class DriverAdminServiceAdapter implements DriverAdminService {
@Override
public Set<DriverProvider> getProviders() {
return null;
}
@Override
public void registerProvider(DriverProvider provider) {
}
@Override
public void unregisterProvider(DriverProvider provider) {
}
@Override
public Set<Driver> getDrivers() {
return null;
}
@Override
public Set<Driver> getDrivers(Class<? extends Behaviour> withBehaviour) {
return null;
}
@Override
public Driver getDriver(String mfr, String hw, String sw) {
return null;
}
@Override
public Driver getDriver(DeviceId deviceId) {
return null;
}
@Override
public DriverHandler createHandler(DeviceId deviceId, String... credentials) {
return null;
}
@Override
public Driver getDriver(String driverName) {
return null;
}
}
protected AbstractDriverLoader loader;
@Test
public void testLoader() {
loader.driverAdminService = new DriverAdminServiceAdapter();
loader.activate();
loader.deactivate();
}
}
......@@ -8,8 +8,14 @@ COMPILE_DEPS = [
'//lib:mibs-net-snmp',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.bti;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* BTI Drivers loader test.
*/
public class BtiDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new BtiDriversLoader();
}
}
......@@ -6,8 +6,14 @@ COMPILE_DEPS = [
'//protocols/rest/api:onos-protocols-rest-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.ciena;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Ciena drivers loader test.
*/
public class CienaDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new CienaDriversLoader();
}
}
......@@ -4,8 +4,14 @@ COMPILE_DEPS = [
'//protocols/netconf/api:onos-protocols-netconf-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.cisco;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Cisco drivers loader test.
*/
public class CiscoDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new CiscoDriversLoader();
}
}
......@@ -5,8 +5,14 @@ COMPILE_DEPS = [
'//protocols/openflow/api:onos-protocols-openflow-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.corsa;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Corsa drivers loader test.
*/
public class CorsaDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new CorsaDriversLoader();
}
}
......@@ -6,8 +6,14 @@ COMPILE_DEPS = [
'//core/store/serializers:onos-core-serializers',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.driver;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Default drivers loader test.
*/
public class DefaultDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new DefaultDriversLoader();
}
}
......@@ -4,8 +4,14 @@ COMPILE_DEPS = [
'//protocols/netconf/api:onos-protocols-netconf-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.fujitsu;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Fujistu driver loader test.
*/
public class FujitsuDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new FujitsuDriversLoader();
}
}
......@@ -6,8 +6,14 @@ COMPILE_DEPS = [
'//incubator/api:onos-incubator-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.lumentum;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Lumentum drivers loader test.
*/
public class LumentumDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new LumentumDriversLoader();
}
}
......@@ -4,8 +4,14 @@ COMPILE_DEPS = [
'//protocols/netconf/api:onos-protocols-netconf-api',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.netconf;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Netconf drivers loader test.
*/
public class NetconfDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new NetconfDriversLoader();
}
}
......@@ -5,8 +5,14 @@ COMPILE_DEPS = [
'//drivers/default:onos-drivers-default',
]
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
]
osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
)
......
package org.onosproject.drivers.optical;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* Optical drivers loader test.
*/
public class OpticalDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new OpticalDriversLoader();
}
}
package org.onosproject.drivers.ovsdb;
import org.junit.Before;
import org.onosproject.net.driver.AbstractDriverLoaderTest;
/**
* OVSDB drivers loader test.
*/
public class OvsdbDriversLoaderTest extends AbstractDriverLoaderTest {
@Before
public void setUp() {
loader = new OvsdbDriversLoader();
}
}