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
8 package org.opendaylight.controller.netconf.cli.io;
12 import junit.framework.Assert;
14 import org.junit.Test;
15 import org.opendaylight.controller.netconf.cli.commands.CommandConstants;
16 import org.opendaylight.yangtools.yang.common.QName;
18 import com.google.common.collect.Maps;
20 public class IOUtilTest {
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);