5a2445279b4df24214d0c998f8fa78ba6f17d3a2
[controller.git] / opendaylight / netconf / netconf-cli / src / test / java / org / opendaylight / controller / netconf / cli / io / IOUtilTest.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 package org.opendaylight.controller.netconf.cli.io;
9
10 import java.util.Map;
11
12 import junit.framework.Assert;
13
14 import org.junit.Test;
15 import org.opendaylight.controller.netconf.cli.commands.CommandConstants;
16 import org.opendaylight.yangtools.yang.common.QName;
17
18 import com.google.common.collect.Maps;
19
20 public class IOUtilTest {
21
22     @Test
23     public void testQNameFromKeyStringNew() throws Exception {
24         final String s = IOUtil.qNameToKeyString(CommandConstants.HELP_QNAME, "module");
25         final Map<String, QName> modulesMap = Maps.newHashMap();
26         modulesMap.put("module", QName.create(CommandConstants.HELP_QNAME, "module"));
27         final QName qName = IOUtil.qNameFromKeyString(s, modulesMap);
28         Assert.assertEquals(CommandConstants.HELP_QNAME, qName);
29     }
30 }