Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / java / org / opendaylight / controller / model / parser / builder / TestUtils.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.controller.model.parser.builder;\r
9 \r
10 import java.net.URI;\r
11 import java.util.ArrayList;\r
12 import java.util.List;\r
13 \r
14 import org.opendaylight.controller.yang.common.QName;\r
15 import org.opendaylight.controller.yang.model.api.SchemaPath;\r
16 \r
17 \r
18 public class TestUtils {\r
19 \r
20         private TestUtils () {\r
21         }\r
22 \r
23         public static SchemaPath createSchemaPath(boolean absolute, URI namespace, String... path) {\r
24                 List<QName> names = new ArrayList<QName>();\r
25                 QName qname;\r
26                 for(String pathPart : path) {\r
27                         qname = new QName(namespace, pathPart);\r
28                         names.add(qname);\r
29                 }\r
30                 return new SchemaPath(names, absolute);\r
31         }\r
32 \r
33 }\r