blob: af34a0211f649c56006767cd613bdab8202192a7 [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001/*
2 * Copyright 2017-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 */
16package org.onosproject.drivers.microsemi.yang;
17
18import java.io.IOException;
19import java.io.UncheckedIOException;
20
21import org.onosproject.drivers.microsemi.yang.impl.MseaCfmManager;
22import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfmService;
23import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.soam.fm.rev20160229.MseaSoamFmService;
24import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.soam.pm.rev20160229.MseaSoamPmService;
25import org.onosproject.yms.app.yab.MockYmsManager;
26
27public class MockMseaCfmManager extends MseaCfmManager {
28
29 @Override
30 public void activate() {
31 try {
32 ymsService = new MockYmsManager();
33 ych = ymsService.getYangCodecHandler();
34 ych.addDeviceSchema(MseaCfmService.class);
35 ych.addDeviceSchema(MseaSoamFmService.class);
36 ych.addDeviceSchema(MseaSoamPmService.class);
37 } catch (InstantiationException | IllegalAccessException e) {
38 log.error("Failed to load YMS Manager: " + e.getMessage());
39 e.printStackTrace();
40 } catch (IOException e) {
41 log.error("Failed to load YMS Manager: " + e.getMessage());
42 throw new UncheckedIOException(e);
43 }
44 }
45}