Merge "DOMDataTree APIs"
[controller.git] / opendaylight / netconf / netconf-monitoring / src / test / java / org / opendaylight / controller / netconf / monitoring / osgi / NetconfMonitoringOperationServiceTest.java
1 /*
2  * Copyright (c) 2014 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.controller.netconf.monitoring.osgi;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.mockito.Mockito.mock;
13
14 import com.google.common.base.Optional;
15 import java.util.Collections;
16 import org.junit.Test;
17 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
18 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
19
20 public class NetconfMonitoringOperationServiceTest {
21     @Test
22     public void testGetters() throws Exception {
23         NetconfMonitoringService monitor = mock(NetconfMonitoringService.class);
24         NetconfMonitoringOperationService service = new NetconfMonitoringOperationService(monitor);
25         NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory serviceFactory = new NetconfMonitoringActivator.NetconfMonitoringOperationServiceFactory(service);
26
27         assertEquals(2, service.getNetconfOperations().size());
28
29         assertEquals(Optional.<String>absent(), serviceFactory.getCapabilities().iterator().next().getCapabilitySchema());
30         assertEquals(Collections.<String>emptyList(), serviceFactory.getCapabilities().iterator().next().getLocation());
31         assertEquals(Optional.of(MonitoringConstants.MODULE_REVISION), serviceFactory.getCapabilities().iterator().next().getRevision());
32         assertEquals(Optional.of(MonitoringConstants.MODULE_NAME), serviceFactory.getCapabilities().iterator().next().getModuleName());
33         assertEquals(Optional.of(MonitoringConstants.NAMESPACE), serviceFactory.getCapabilities().iterator().next().getModuleNamespace());
34         assertEquals(MonitoringConstants.URI, serviceFactory.getCapabilities().iterator().next().getCapabilityUri());
35     }
36 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.