Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following test cases used and modified the standard stores model seen above.

Key

...

Testing with groovy

The following cases were tested in YangTextSchemaSourceSetSpec.groovy using the test method 'Building a valid YangTextSchemaSourceSet using #filenameCase filename) passes'.

Key

**Green cell for case number indicates that tests have passed

**Red cell for case number indicates that tests have failed

Case #DescriptionJAVA objectNotes
1
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside container statement before all other substatements
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }

    typedef year {...}

    container bookstore {
        book-store:sync-flag "on";
		...
        leaf bookstore-name {...}
		list categories {..}
...
}


  • extension declared after all other substatements of container still passed
2
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside a leaf statement (child of a container) before all other substatements
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }

    typedef year {...}

    container bookstore {
		...
        leaf bookstore-name {
	      book-store:sync-flag "on"; 
		}
		list categories {..}
...
}


  • Extension declared after type-statement inside leaf statement (child of a container) still passed
3
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside list statement (child of a container) before all other substatements
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }

    typedef year {...}

    container bookstore {
		...
        leaf bookstore-name {...}
		list categories {
		 	book-store:sync-flag "on";
			key "code";
			...  
		}
...
}


  • Extension declared after key-statement inside list statement (child of a container) still passed
4
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside leaf statement (child of list node from case #3) before all its substatements
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
 	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }
    typedef year {...}

    container bookstore {
        leaf bookstore-name {...}

    list categories {
        key "code";
        leaf code {
            book-store:sync-flag "on";
            type string;
        }
        leaf name {...}
        list books {...}
...
}


  • Extension declared after type-statement inside leaf statement (child of list node from case #3) still passed
5
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside list node (child of list node from case #4) before key-statement of list
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
 	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }
    typedef year {...}

    container bookstore {
        leaf bookstore-name {...}

    list categories {
        key "code";
        leaf code {...}
        leaf name {...}
        list books {
		 book-store:sync-flag "on";
		...
		}
...
}


  • extension declared after key-statement of the list statement still passed
6
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside leaf-list node (child of list node from case #5) before all other substatements
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
 	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }
    typedef year {...}

    container bookstore {
        leaf bookstore-name {...}

    list categories {
        key "code";
        leaf code {...}
        leaf name {...}
        list books {
			leaf-list authors{
			  book-store:sync-flag "on"; 
			}
		}
...
}


  • extension declared after type-statement of leaf-list still passed
7
  • extension defined as substatement in the module with argument statement as its substatement
  • extension used inside module
  • extension declared before container node
  • extension contained argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }

    typedef year {...}

    book-store:sync-flag "on"; 

    container bookstore {...}
}


  • data tree still only has one direct child (container node) as with the standard stores model
  • value of the argument is not seen?
8
  • scenario the same as case 1 but the extension was used in the container statement without an argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag{
        description "This extension allows to tag nodes with a sync flag";
        argument "value";
    }

    typedef year {...}

    container bookstore {
        book-store:sync-flag;
		...
}


  • same extension declaration/usage fails for:
      • scenarios in all cases 2-7
9
  • extension defined as substatement in the module without argument statement as its substatement
  • extension used inside container statement before all other substatements
  • extension declared has no argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag;

    typedef year {...}

    container bookstore {
        book-store:sync-flag;
		...
        leaf bookstore-name {...}
		list categories {..}
...
}


  • use of the same definition and declaration of the extension on this case for cases #1-7 passes
10
  • extension defined as substatement in the module without argument statement as its substatement
  • extension used twice
    • inside container statement before all other substatements
    • inside leaf statement (child of container statement)
  • extension declared has no argument
Code Block
collapsetrue
module stores {
    yang-version 1.1;
	...
    extension sync-flag;

    typedef year {...}

    container bookstore {
        book-store:sync-flag;
		...
        leaf bookstore-name {
			book-store:sync-flag;
		}
		list categories {..}
...
}




Parsing an instance using the model