add OvsdbModule & OvsdbModuleTest
authorMichael Vorburger <mike@vorburger.ch>
Fri, 21 Dec 2018 16:42:57 +0000 (17:42 +0100)
committerMichael Vorburger <mike@vorburger.ch>
Wed, 1 Jul 2020 23:38:30 +0000 (01:38 +0200)
This requires https://jira.opendaylight.org/browse/OVSDB-474.

Signed-off-by: Michael Vorburger <mike@vorburger.ch>
src/main/java/org/opendaylight/ovsdb/simple/OvsdbModule.java [new file with mode: 0644]
src/test/java/org/opendaylight/ovsdb/simple/test/OvsdbModuleTest.java [new file with mode: 0644]

diff --git a/src/main/java/org/opendaylight/ovsdb/simple/OvsdbModule.java b/src/main/java/org/opendaylight/ovsdb/simple/OvsdbModule.java
new file mode 100644 (file)
index 0000000..0fb47ad
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2018 Red Hat, 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.ovsdb.simple;
+
+import org.opendaylight.infrautils.inject.guice.AutoWiringModule;
+import org.opendaylight.infrautils.inject.guice.GuiceClassPathBinder;
+
+public class OvsdbModule extends AutoWiringModule {
+
+    public OvsdbModule(GuiceClassPathBinder classPathBinder) {
+        super(classPathBinder, "org.opendaylight.ovsdb");
+    }
+
+}
diff --git a/src/test/java/org/opendaylight/ovsdb/simple/test/OvsdbModuleTest.java b/src/test/java/org/opendaylight/ovsdb/simple/test/OvsdbModuleTest.java
new file mode 100644 (file)
index 0000000..f4229da
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018 Red Hat, 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.ovsdb.simple.test;
+
+import javax.inject.Inject;
+import org.junit.Rule;
+import org.opendaylight.aaa.simple.CertModule;
+import org.opendaylight.controller.simple.InMemoryControllerModule;
+import org.opendaylight.infrautils.inject.guice.GuiceClassPathBinder;
+import org.opendaylight.infrautils.inject.guice.testutils.AnnotationsModule;
+import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
+import org.opendaylight.infrautils.ready.guice.ReadyModule;
+import org.opendaylight.infrautils.simple.DiagStatusModule;
+import org.opendaylight.infrautils.simple.testutils.AbstractSimpleDistributionTest;
+import org.opendaylight.infrautils.web.WebModule;
+import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundProvider;
+import org.opendaylight.ovsdb.lib.OvsdbConnection;
+import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
+import org.opendaylight.ovsdb.simple.OvsdbModule;
+import org.opendaylight.ovsdb.southbound.SouthboundProvider;
+
+public class OvsdbModuleTest extends AbstractSimpleDistributionTest {
+
+    private static final GuiceClassPathBinder CLASS_PATH_BINDER = new GuiceClassPathBinder("org.opendaylight");
+
+    public @Rule GuiceRule guice = new GuiceRule(new OvsdbModule(CLASS_PATH_BINDER), new CertModule(),
+            new InMemoryControllerModule(), new DiagStatusModule(), new WebModule(), new ReadyModule(),
+            new AnnotationsModule());
+
+    @Inject OvsdbConnection ovsdbConnection;
+    @Inject SouthboundProvider southboundProvider;
+    @Inject OvsdbConnectionService ovsdbConnectionService;
+    @Inject HwvtepSouthboundProvider hwvtepSouthboundProvider;
+
+}