9515240e932e76031109658e26e50b50ac44b6ba
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / cluster / datastore / node / utils / QNameFactoryTest.java
1 /*
2  * Copyright (c) 2014, 2015 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.cluster.datastore.node.utils;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertFalse;
13 import static org.junit.Assert.assertTrue;
14
15 import org.junit.Test;
16 import org.opendaylight.controller.cluster.datastore.util.TestModel;
17 import org.opendaylight.yangtools.yang.common.QName;
18
19 public class QNameFactoryTest {
20
21     @Test
22     public void testBasic() {
23         QName expected = TestModel.AUG_NAME_QNAME;
24         QName created = QNameFactory.create(expected.toString());
25
26         assertFalse(expected == created);
27
28         assertEquals(expected, created);
29
30         QName cached = QNameFactory.create(expected.toString());
31
32         assertEquals(expected, cached);
33
34         assertTrue(cached == created);
35     }
36 }