2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.mdsal.dom.broker.test;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
14 import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
16 import org.opendaylight.mdsal.dom.api.DOMMountPoint;
17 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
18 import org.opendaylight.mdsal.dom.api.DOMMountPointService.DOMMountPointBuilder;
19 import com.google.common.base.Optional;
20 import org.junit.Before;
21 import org.junit.Test;
22 import org.opendaylight.yangtools.yang.common.QName;
23 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
25 public class MountPointServiceTest {
27 private DOMMountPointService mountService;
28 private static final YangInstanceIdentifier PATH = YangInstanceIdentifier.of(QName.create("namespace", "12-12-2012", "top"));
32 mountService = new DOMMountPointServiceImpl();
36 public void createSimpleMountPoint() {
37 Optional<DOMMountPoint> mountNotPresent = mountService.getMountPoint(PATH);
38 assertFalse(mountNotPresent.isPresent());
39 DOMMountPointBuilder mountBuilder = mountService.createMountPoint(PATH);
40 mountBuilder.register();
42 Optional<DOMMountPoint> mountPresent = mountService.getMountPoint(PATH);
43 assertTrue(mountPresent.isPresent());