[ONOS-4350] Inter file linking implementation and inter-jar linking framework
Change-Id: I71a26ba3e0b9d17261e78a9313fe7f047195932e
diff --git a/src/test/resources/SelfFileLinkingTypedefNotFound.yang b/src/test/resources/SelfFileLinkingTypedefNotFound.yang
index 9248598..523f0b4 100644
--- a/src/test/resources/SelfFileLinkingTypedefNotFound.yang
+++ b/src/test/resources/SelfFileLinkingTypedefNotFound.yang
@@ -6,13 +6,13 @@
list valid {
key "invalid-interval";
leaf invalid-interval {
- type hello;
+ type Ant:hello;
}
}
}
container isis {
typedef hello {
- type String;
+ type string;
}
}
}
diff --git a/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang b/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang
index 71d1947..d622196 100644
--- a/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang
+++ b/src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang
@@ -3,7 +3,7 @@
namespace http://huawei.com;
prefix Ant;
typedef Percentage {
- type INT;
+ type Ant:INT;
}
container ospf {
list valid {
diff --git a/src/test/resources/SelfResolutionNestedGroupingWithUnresolvedUses.yang b/src/test/resources/SelfResolutionNestedGroupingWithUnresolvedUses.yang
index 4dbc1a2..b2ab735 100644
--- a/src/test/resources/SelfResolutionNestedGroupingWithUnresolvedUses.yang
+++ b/src/test/resources/SelfResolutionNestedGroupingWithUnresolvedUses.yang
@@ -2,9 +2,9 @@
yang-version 1;
namespace http://huawei.com;
prefix Ant;
- container test{
- leaf leaf2{
- type String;
+ container test {
+ leaf leaf2 {
+ type string;
}
grouping treat {
grouping create {
@@ -13,5 +13,5 @@
}
}
}
- uses treat;
+ uses Ant:treat;
}
diff --git a/src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevelForBinary.yang b/src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevelForBinary.yang
new file mode 100644
index 0000000..d6ff30e
--- /dev/null
+++ b/src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevelForBinary.yang
@@ -0,0 +1,17 @@
+module ospf {
+ namespace "urn:cisco:params:xml:ns:yang:ospf";
+ // replace with IANA namespace when assigned
+ prefix ospf;
+ revision 2020-10-20 {
+ description
+ "Initial revision.";
+ }
+
+ typedef type14 {
+ type binary;
+ }
+
+ leaf typedef14 {
+ type type14;
+ }
+}
diff --git a/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang b/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang
index 499e10d..33f90c9 100644
--- a/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang
+++ b/src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang
@@ -3,9 +3,9 @@
namespace http://huawei.com;
prefix Ant;
leaf invalid-interval {
- type hello;
+ type Ant:hello;
}
typedef hi {
- type String;
+ type string;
}
}
diff --git a/src/test/resources/hierarchicalinterfiletype/ietf-inet-types.yang b/src/test/resources/hierarchicalinterfiletype/ietf-inet-types.yang
new file mode 100644
index 0000000..38f209f
--- /dev/null
+++ b/src/test/resources/hierarchicalinterfiletype/ietf-inet-types.yang
@@ -0,0 +1,15 @@
+ module ietf-inet-types {
+
+ yang-version 1;
+
+ namespace
+ "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+
+ prefix inet;
+
+
+
+ typedef uri {
+ type string;
+ }
+ }
diff --git a/src/test/resources/hierarchicalinterfiletype/ietf-network-topology.yang b/src/test/resources/hierarchicalinterfiletype/ietf-network-topology.yang
new file mode 100644
index 0000000..6e9dfb7
--- /dev/null
+++ b/src/test/resources/hierarchicalinterfiletype/ietf-network-topology.yang
@@ -0,0 +1,17 @@
+ module ietf-network-topology {
+ yang-version 1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";
+ prefix nt;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ import ietf-network {
+ prefix nd;
+ }
+ leaf source-node {
+ type nd:node-id;
+ description
+ "Source node identifier, must be in same topology.";
+ }
+ }
diff --git a/src/test/resources/hierarchicalinterfiletype/ietf-network.yang b/src/test/resources/hierarchicalinterfiletype/ietf-network.yang
new file mode 100644
index 0000000..1f15b40
--- /dev/null
+++ b/src/test/resources/hierarchicalinterfiletype/ietf-network.yang
@@ -0,0 +1,16 @@
+ module ietf-network {
+ yang-version 1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-network";
+ prefix nd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ typedef node-id {
+ type inet:uri;
+ description
+ "Identifier for a node.";
+ }
+
+ }
diff --git a/src/test/resources/hierarchicalintrawithinterfiletype/ietf-inet-types.yang b/src/test/resources/hierarchicalintrawithinterfiletype/ietf-inet-types.yang
new file mode 100644
index 0000000..48d13c6
--- /dev/null
+++ b/src/test/resources/hierarchicalintrawithinterfiletype/ietf-inet-types.yang
@@ -0,0 +1,13 @@
+ module ietf-inet-types {
+
+ yang-version 1;
+
+ namespace
+ "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+
+ prefix inet;
+
+ typedef uri {
+ type string;
+ }
+ }
diff --git a/src/test/resources/hierarchicalintrawithinterfiletype/ietf-network.yang b/src/test/resources/hierarchicalintrawithinterfiletype/ietf-network.yang
new file mode 100644
index 0000000..e35d0f5
--- /dev/null
+++ b/src/test/resources/hierarchicalintrawithinterfiletype/ietf-network.yang
@@ -0,0 +1,22 @@
+ module ietf-network {
+ yang-version 1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-network";
+ prefix nd;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+ leaf node-ref {
+ type node-id;
+ description
+ "Used to reference a node.
+ Nodes are identified relative to the network they are
+ contained in.";
+ }
+
+ typedef node-id {
+ type inet:uri;
+ description
+ "Identifier for a node.";
+ }
+ }
diff --git a/src/test/resources/interfiletype/module1.yang b/src/test/resources/interfiletype/module1.yang
new file mode 100644
index 0000000..3c60bd6
--- /dev/null
+++ b/src/test/resources/interfiletype/module1.yang
@@ -0,0 +1,14 @@
+module module1 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ import module2 {
+ prefix p;
+ }
+ leaf invalid-interval {
+ type p:hello;
+ }
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfiletype/module2.yang b/src/test/resources/interfiletype/module2.yang
new file mode 100644
index 0000000..6784c45
--- /dev/null
+++ b/src/test/resources/interfiletype/module2.yang
@@ -0,0 +1,8 @@
+module module2 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant2;
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfiletypewithinclude/module1.yang b/src/test/resources/interfiletypewithinclude/module1.yang
new file mode 100644
index 0000000..d1d4db3
--- /dev/null
+++ b/src/test/resources/interfiletypewithinclude/module1.yang
@@ -0,0 +1,9 @@
+module module1 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ include module2;
+ leaf invalid-interval {
+ type hello;
+ }
+}
diff --git a/src/test/resources/interfiletypewithinclude/module2.yang b/src/test/resources/interfiletypewithinclude/module2.yang
new file mode 100644
index 0000000..8e47100
--- /dev/null
+++ b/src/test/resources/interfiletypewithinclude/module2.yang
@@ -0,0 +1,9 @@
+submodule module2 {
+ yang-version 1;
+ belongs-to module1 {
+ prefix "module1";
+ }
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfiletypewithrevision/module1.yang b/src/test/resources/interfiletypewithrevision/module1.yang
new file mode 100644
index 0000000..180511d
--- /dev/null
+++ b/src/test/resources/interfiletypewithrevision/module1.yang
@@ -0,0 +1,15 @@
+module module1 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ import module2 {
+ prefix p;
+ revision-date 2007-06-09;
+ }
+ leaf invalid-interval {
+ type p:hello;
+ }
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfiletypewithrevision/module2.yang b/src/test/resources/interfiletypewithrevision/module2.yang
new file mode 100644
index 0000000..fd99872
--- /dev/null
+++ b/src/test/resources/interfiletypewithrevision/module2.yang
@@ -0,0 +1,11 @@
+module module2 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant2;
+ revision 2007-06-09 {
+ description "Initial revision.";
+ }
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfiletypewithrevisioninname/module1.yang b/src/test/resources/interfiletypewithrevisioninname/module1.yang
new file mode 100644
index 0000000..180511d
--- /dev/null
+++ b/src/test/resources/interfiletypewithrevisioninname/module1.yang
@@ -0,0 +1,15 @@
+module module1 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ import module2 {
+ prefix p;
+ revision-date 2007-06-09;
+ }
+ leaf invalid-interval {
+ type p:hello;
+ }
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfiletypewithrevisioninname/module2@2007-06-09.yang b/src/test/resources/interfiletypewithrevisioninname/module2@2007-06-09.yang
new file mode 100644
index 0000000..fd99872
--- /dev/null
+++ b/src/test/resources/interfiletypewithrevisioninname/module2@2007-06-09.yang
@@ -0,0 +1,11 @@
+module module2 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant2;
+ revision 2007-06-09 {
+ description "Initial revision.";
+ }
+ typedef hello {
+ type string;
+ }
+}
diff --git a/src/test/resources/interfileuses/module1.yang b/src/test/resources/interfileuses/module1.yang
new file mode 100644
index 0000000..69df326
--- /dev/null
+++ b/src/test/resources/interfileuses/module1.yang
@@ -0,0 +1,9 @@
+module module1 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ import module2 {
+ prefix p;
+ }
+ uses p:hello;
+}
diff --git a/src/test/resources/interfileuses/module2.yang b/src/test/resources/interfileuses/module2.yang
new file mode 100644
index 0000000..5bb3616
--- /dev/null
+++ b/src/test/resources/interfileuses/module2.yang
@@ -0,0 +1,10 @@
+module module2 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ grouping hello {
+ leaf hello {
+ type string;
+ }
+ }
+}
diff --git a/src/test/resources/interfileuseswithinclude/module1.yang b/src/test/resources/interfileuseswithinclude/module1.yang
new file mode 100644
index 0000000..41899d9
--- /dev/null
+++ b/src/test/resources/interfileuseswithinclude/module1.yang
@@ -0,0 +1,7 @@
+module module1 {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ include module2;
+ uses hello;
+}
diff --git a/src/test/resources/interfileuseswithinclude/module2.yang b/src/test/resources/interfileuseswithinclude/module2.yang
new file mode 100644
index 0000000..1b423d9
--- /dev/null
+++ b/src/test/resources/interfileuseswithinclude/module2.yang
@@ -0,0 +1,11 @@
+submodule module2 {
+ yang-version 1;
+ belongs-to module1 {
+ prefix "module1";
+ }
+ grouping hello {
+ leaf hello {
+ type string;
+ }
+ }
+}