Bug 6261: Introduce resolution of deviation statement during SchemaContext assembly
[yangtools.git] / yang / yang-parser-impl / src / test / resources / deviation-resolution-test / deviation-replace / foo.yang
1 module foo {
2     namespace foo;
3     prefix foo;
4
5     revision 2017-01-20;
6
7     deviation "/my-leaf" {
8         deviate replace {
9             type uint32;
10             default 10;
11             units bytes;
12         }
13     }
14
15     deviation "/my-leaf-list-test" {
16         deviate replace {
17             min-elements 3;
18             max-elements 6;
19             config true;
20         }
21     }
22
23     deviation "/my-choice" {
24         deviate replace {
25             mandatory false;
26             foo:custom-property "new arg";
27         }
28     }
29
30     extension custom-property {
31         argument name;
32     }
33
34     leaf my-leaf {
35         type int32;
36         default 100;
37         units kilobytes;
38     }
39
40     leaf-list my-leaf-list-test {
41         type string;
42         min-elements 5;
43         max-elements 10;
44         config false;
45     }
46
47     choice my-choice {
48         mandatory true;
49         foo:custom-property "original arg";
50         case c1 {
51             leaf c1-leaf {
52                 type string;
53             }
54         }
55
56         case c2 {
57             leaf c2-leaf {
58                 type string;
59             }
60         }
61     }
62
63     container my-cont {
64         uses my-grouping {
65             refine my-used-leaf {
66                 default "def-val-added-by-refine";
67                 foo:custom-property "arg";
68             }
69         }
70     }
71
72     augment "/my-cont" {
73         leaf my-aug-leaf {
74             type int32;
75             default "def-val";
76             units "minutes";
77             foo:custom-property "arg";
78         }
79     }
80
81     deviation "/my-cont/my-aug-leaf" {
82         deviate replace {
83             type uint32;
84             default "new-def-val";
85             units "seconds";
86             foo:custom-property "new arg";
87         }
88     }
89
90     grouping my-grouping {
91         leaf my-used-leaf {
92             type int32;
93             units "days";
94         }
95     }
96
97     deviation "/my-cont/my-used-leaf" {
98         deviate replace {
99             type uint32;
100             default "new-def-val";
101             foo:custom-property "new arg";
102             units "weeks";
103         }
104     }
105 }