Fix netconf-connector-config groupId
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / FakeCapability.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.netconf.test.tool;
10
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.config.util.capability.BasicCapability;
13 import org.opendaylight.controller.config.util.capability.YangModuleCapability;
14
15 /**
16  * Can be passed instead of YangModuleCapability when building capabilities
17  * in NetconfDeviceSimulator when testing various schema resolution related exceptions.
18  *
19  */
20 public class FakeCapability extends BasicCapability {
21     private final YangModuleCapability moduleCapability;
22
23     public FakeCapability(final YangModuleCapability moduleCapability) {
24         super(moduleCapability.getCapabilityUri());
25         this.moduleCapability = moduleCapability;
26     }
27
28     @Override
29     public Optional<String> getModuleNamespace() {
30         return moduleCapability.getModuleNamespace();
31     }
32
33     @Override
34     public Optional<String> getModuleName() {
35         return moduleCapability.getModuleName();
36     }
37
38     @Override
39     public Optional<String> getRevision() {
40         return moduleCapability.getRevision();
41     }
42
43     /**
44      l*
45      * @return empty schema source to trigger schema resolution exception.
46      */
47     @Override
48     public Optional<String> getCapabilitySchema() {
49         return Optional.absent();
50     }
51 }