2 * Copyright (c) 2017 Cisco and/or its affiliates.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package io.fd.hc2vpp.docs.core.mock.binding;
19 import static io.fd.hc2vpp.docs.core.mock.binding.MockBindingModule.noOpProxy;
21 import com.google.inject.Provider;
22 import io.fd.hc2vpp.vppioam.impl.VppIoamModule;
23 import io.fd.vpp.jvpp.JVpp;
24 import io.fd.vpp.jvpp.JVppRegistry;
25 import io.fd.vpp.jvpp.ioamexport.future.FutureJVppIoamexportFacade;
26 import io.fd.vpp.jvpp.ioampot.future.FutureJVppIoampotFacade;
27 import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtraceFacade;
28 import java.io.IOException;
31 * Use to bypass jvpp registration
33 public class MockIoamModule extends VppIoamModule {
35 public MockIoamModule() {
36 super(MockTraceProvider.class, MockPotProvider.class, MockExportProvider.class);
39 private static class MockTraceProvider implements Provider<FutureJVppIoamtraceFacade> {
41 public FutureJVppIoamtraceFacade get() {
43 return new FutureJVppIoamtraceFacade(noOpProxy(JVppRegistry.class), noOpProxy(JVpp.class));
44 } catch (IOException e) {
45 throw new IllegalStateException(e);
50 private static class MockPotProvider implements Provider<FutureJVppIoampotFacade> {
53 public FutureJVppIoampotFacade get() {
55 return new FutureJVppIoampotFacade(noOpProxy(JVppRegistry.class), noOpProxy(JVpp.class));
56 } catch (IOException e) {
57 throw new IllegalStateException(e);
62 private static class MockExportProvider implements Provider<FutureJVppIoamexportFacade> {
65 public FutureJVppIoamexportFacade get() {
67 return new FutureJVppIoamexportFacade(noOpProxy(JVppRegistry.class), noOpProxy(JVpp.class));
68 } catch (IOException e) {
69 throw new IllegalStateException(e);