*/
package org.opendaylight.yangtools.yang.parser.impl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.FileNotFoundException;
import java.net.URI;
assertNotNull(pcreq);
QName expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "pcreq");
path.offer(expectedQName);
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, pcreq.getPath());
Set<DataSchemaNode> childNodes = pcreq.getChildNodes();
assertEquals(4, childNodes.size());
assertNotNull(version);
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "version");
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, version.getPath());
expectedQName = new QName(GD_NS, GD_REV, GD_PREF, "protocol-version");
path.offer(expectedQName);
- expectedPath = new SchemaPath(Lists.newArrayList(expectedQName), true);
+ expectedPath = SchemaPath.create(Lists.newArrayList(expectedQName), true);
assertEquals(expectedPath, version.getType().getPath());
assertEquals(Uint8.getInstance(), version.getType().getBaseType());
assertTrue(version.isAddedByUses());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, type.getPath());
expectedQName = new QName(GD_NS, GD_REV, GD_PREF, "int-ext");
path.offer(expectedQName);
- expectedPath = new SchemaPath(Lists.newArrayList(expectedQName), true);
+ expectedPath = SchemaPath.create(Lists.newArrayList(expectedQName), true);
assertEquals(expectedPath, type.getType().getPath());
UnionType union = (UnionType)type.getType().getBaseType();
assertEquals(BaseTypes.schemaPath(BaseTypes.constructQName("union")), union.getPath());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, requests.getPath());
assertFalse(requests.isAddedByUses());
childNodes = requests.getChildNodes();
assertNotNull(rp);
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "rp");
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, rp.getPath());
assertFalse(rp.isAddedByUses());
childNodes = rp.getChildNodes();
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, priority.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, priority.getPath());
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "uint8");
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
// TODO
//assertEquals(expectedPath, priority.getType().getPath());
assertEquals(Uint8.getInstance(), priority.getType().getBaseType());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, box.getPath());
assertTrue(box.isAddedByUses());
// * |-- |-- |-- |-- container order
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "order");
assertEquals(expectedQName, order.getQName());
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, order.getPath());
assertTrue(order.isAddedByUses());
assertTrue(order.isAugmenting());
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "delete");
assertEquals(expectedQName, delete.getQName());
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, delete.getPath());
assertEquals(Uint32.getInstance(), delete.getType());
assertTrue(delete.isAddedByUses());
assertEquals(expectedQName, setup.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, setup.getPath());
assertEquals(Uint32.getInstance(), setup.getType());
assertTrue(setup.isAddedByUses());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, pke.getPath());
assertFalse(pke.isAddedByUses());
// * |-- |-- |-- path-key
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "path-key");
assertEquals(expectedQName, pathKey.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, pathKey.getPath());
assertFalse(pathKey.isAddedByUses());
assertEquals(3, pathKey.getChildNodes().size());
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, pathKeys.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, pathKeys.getPath());
assertTrue(pathKeys.isAddedByUses());
childNodes = pathKeys.getChildNodes();
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "version");
assertEquals(expectedQName, version.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, version.getPath());
assertTrue(version.getType() instanceof ExtendedType);
assertEquals(Uint8.getInstance(), version.getType().getBaseType());
assertEquals(expectedQName, type.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, type.getPath());
assertTrue(type.getType() instanceof ExtendedType);
assertTrue(type.isAddedByUses());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, sc.getPath());
assertFalse(sc.isAddedByUses());
// * |-- |-- |-- container p2p
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "p2p");
assertEquals(expectedQName, p2p.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, p2p.getPath());
assertFalse(p2p.isAddedByUses());
// * |-- |-- |-- |-- container endpoints
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "endpoints");
assertEquals(expectedQName, endpoints.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, endpoints.getPath());
assertFalse(endpoints.isAddedByUses());
// * |-- |-- |-- |-- |-- leaf processing-rule
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, box.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, box.getPath());
assertTrue(box.isAddedByUses());
// * |-- |-- |-- |-- |-- choice address-family
assertEquals(expectedQName, af.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, af.getPath());
assertTrue(af.isAddedByUses());
// * |-- |-- |-- |-- container reported-route
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, reportedRoute.getPath());
assertFalse(reportedRoute.isAddedByUses());
// * |-- |-- |-- |-- |-- leaf processing-rule
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, subobjects.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, subobjects.getPath());
assertTrue(subobjects.isAddedByUses());
// * |-- |-- |-- |-- |-- container bandwidth
assertEquals(expectedQName, bandwidth.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, bandwidth.getPath());
assertFalse(bandwidth.isAddedByUses());
// * |-- |-- |-- |-- container bandwidth
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, bandwidth.getPath());
assertTrue(bandwidth.isAddedByUses());
// * |-- |-- |-- |-- |-- leaf processing-rule
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, bandwidth.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, bandwidthInner.getPath());
assertTrue(bandwidthInner.isAddedByUses());
// * |-- list svec
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, svec.getPath());
assertFalse(svec.isAddedByUses());
// * |-- |-- leaf link-diverse
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "link-diverse");
assertEquals(expectedQName, linkDiverse.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, linkDiverse.getPath());
assertEquals(BooleanType.getInstance(), linkDiverse.getType());
assertTrue(linkDiverse.isAddedByUses());
assertEquals(expectedQName, processingRule.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, metric.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, metric.getPath());
assertFalse(metric.isAddedByUses());
// * |-- |-- |-- leaf metric-type
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "metric-type");
assertEquals(expectedQName, metricType.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, metricType.getPath());
assertEquals(Uint8.getInstance(), metricType.getType());
assertTrue(metricType.isAddedByUses());
assertEquals(expectedQName, box.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, box.getPath());
assertTrue(box.isAddedByUses());
// * |-- |-- |-- leaf processing-rule
assertEquals(expectedQName, processingRule.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertNotNull(intExt);
List<QName> path = Lists.newArrayList(new QName(GD_NS, GD_REV, GD_PREF, "int-ext"));
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, intExt.getPath());
UnionType union = (UnionType)intExt.getBaseType();
assertNotNull(pv);
QName q1 = BaseTypes.constructQName("union");
- expectedPath = new SchemaPath(Lists.newArrayList(q1), true);
+ expectedPath = SchemaPath.create(Lists.newArrayList(q1), true);
assertEquals(expectedPath, union.getPath());
}