2 * Copyright (c) 2017 Pantheon Technologies s.r.o. 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.yangtools.yang.common;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertThrows;
13 import java.util.AbstractMap.SimpleImmutableEntry;
14 import org.junit.jupiter.api.Test;
16 public class YangNamesTest {
18 public void testParseFileName() {
19 assertEquals(new SimpleImmutableEntry<>("foo", null), YangNames.parseFilename("foo"));
20 assertEquals(new SimpleImmutableEntry<>("foo", "bar"), YangNames.parseFilename("foo@bar"));
21 assertEquals(new SimpleImmutableEntry<>("foo@bar", "baz"), YangNames.parseFilename("foo@bar@baz"));
25 public void testParseFileNameNull() {
26 assertThrows(NullPointerException.class, () -> YangNames.parseFilename(null));