blob: c715e78b2eb870559fcdb20fec730c83bce8f0fe [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.MseaUniEvcServiceManager;
22import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcServiceService;
23import org.onosproject.yms.app.yab.MockYmsManager;
24
25public class MockMseaUniEvcServiceManager extends MseaUniEvcServiceManager {
26 @Override
27 public void activate() {
28 try {
29 ymsService = new MockYmsManager();
30 ych = ymsService.getYangCodecHandler();
31 ych.addDeviceSchema(MseaUniEvcServiceService.class);
32 } catch (InstantiationException | IllegalAccessException e) {
33 log.error("Failed to load YMS Manager: " + e.getMessage());
34 e.printStackTrace();
35 } catch (IOException e) {
36 log.error("Failed to load YMS Manager: " + e.getMessage());
37 throw new UncheckedIOException(e);
38 }
39 }
40}