blob: b65b9481e13967ab8adf5d05b4b27a15e1eafcdd [file] [log] [blame]
Vidyashree Rama1db15562016-05-17 16:16:15 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yangutils.parser.impl.listeners;
18
19import java.io.IOException;
20import java.util.ListIterator;
21
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053022import org.junit.Rule;
Vidyashree Rama1db15562016-05-17 16:16:15 +053023import org.junit.Test;
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053024import org.junit.rules.ExpectedException;
25import org.onosproject.yangutils.datamodel.YangDerivedInfo;
Vidyashree Rama1db15562016-05-17 16:16:15 +053026import org.onosproject.yangutils.datamodel.YangNode;
27import org.onosproject.yangutils.datamodel.YangModule;
28import org.onosproject.yangutils.datamodel.YangLeaf;
29import org.onosproject.yangutils.datamodel.YangChoice;
30import org.onosproject.yangutils.datamodel.YangContainer;
31import org.onosproject.yangutils.datamodel.YangNodeType;
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053032import org.onosproject.yangutils.datamodel.YangType;
33import org.onosproject.yangutils.datamodel.YangTypeDef;
34import org.onosproject.yangutils.datamodel.utils.builtindatatype.DataTypeException;
35import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
36import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt64;
Vidyashree Rama1db15562016-05-17 16:16:15 +053037import org.onosproject.yangutils.parser.exceptions.ParserException;
38import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
39
40import static org.hamcrest.core.Is.is;
41import static org.junit.Assert.assertThat;
42
43/**
44 * Test cases for testing default listener functionality.
45 */
46public class DefaultListenerTest {
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053047 @Rule
48 public ExpectedException thrown = ExpectedException.none();
Vidyashree Rama1db15562016-05-17 16:16:15 +053049
50 private final YangUtilsParserManager manager = new YangUtilsParserManager();
51
52 /**
53 * Checks if default value is set correctly.
54 */
55 @Test
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053056 public void processDefaultValueInLeafSubStatement() throws IOException, ParserException {
Vidyashree Rama1db15562016-05-17 16:16:15 +053057
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053058 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueInLeafSubStatement.yang");
Vidyashree Rama1db15562016-05-17 16:16:15 +053059 // Check whether the data model tree returned is of type module.
60 assertThat((node instanceof YangModule), is(true));
61
62 // Check whether the node type is set properly to module.
63 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
64
65 // Check whether the module name is set correctly.
66 YangModule yangNode = (YangModule) node;
67 assertThat(yangNode.getName(), is("Test"));
68
69 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
70 YangLeaf leafInfo = leafIterator.next();
71
72 assertThat(leafInfo.getName(), is("invalid-interval"));
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053073 assertThat(leafInfo.getDefaultValueInString(), is("1"));
Vidyashree Rama1db15562016-05-17 16:16:15 +053074 }
75
76 /**
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053077 * Validates default invalid value in leaf.
Vidyashree Rama1db15562016-05-17 16:16:15 +053078 */
79 @Test
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053080 public void processDefaultInalueInLeafSubStatement() throws IOException, ParserException {
Vidyashree Rama1db15562016-05-17 16:16:15 +053081
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +053082 thrown.expect(DataTypeException.class);
83 thrown.expectMessage("YANG file error : Input value \"x\" is not a valid uint16.");
84
85 manager.getDataModel("src/test/resources/default/DefaultInvalidValueInLeafSubStatement.yang");
86 }
87
88 /**
89 * Validates default case value in choice statement.
90 */
91 @Test
92 public void processDefaultCaseInChoiceSubStatement() throws IOException, ParserException {
93
94 YangNode node = manager.getDataModel("src/test/resources/default/DefaultCaseInChoiceSubStatement.yang");
Vidyashree Rama1db15562016-05-17 16:16:15 +053095 // Check whether the data model tree returned is of type module.
96 assertThat((node instanceof YangModule), is(true));
97
98 // Check whether the node type is set properly to module.
99 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
100
101 // Check whether the module name is set correctly.
102 YangModule yangNode = (YangModule) node;
103 assertThat(yangNode.getName(), is("Test"));
104
105 YangContainer yangContainer = (YangContainer) yangNode.getChild();
106 assertThat(yangContainer.getName(), is("food"));
107
108 YangChoice yangChoice = (YangChoice) yangContainer.getChild();
109 assertThat(yangChoice.getName(), is("snack"));
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530110 assertThat(yangChoice.getDefaultValueInString(), is("sports-arena"));
111 }
112
113 /**
114 * Validates default invalide case in choice statement.
115 */
116 @Test
117 public void processDefaultInvalidCaseInChoiceSubStatement() throws IOException, ParserException {
118
119 thrown.expect(ParserException.class);
120 thrown.expectMessage("Internal parser error detected: Invalid content in choice \"snack\" after processing.");
121
122 manager.getDataModel("src/test/resources/default/DefaultInvalidValueInChoiceSubStmt.yang");
123 }
124
125 /**
126 * Validates default value in typedef.
127 */
128 @Test
129 public void processDefaultInTypedef() throws IOException, ParserException {
130
131 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueInTypeDef.yang");
132 // Check whether the data model tree returned is of type module.
133 assertThat((node instanceof YangModule), is(true));
134
135 // Check whether the node type is set properly to module.
136 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
137
138 // Check whether the module name is set correctly.
139 YangModule yangNode = (YangModule) node;
140 assertThat(yangNode.getName(), is("Test"));
141
142 // check typedef
143 YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
144 assertThat(typedef.getName(), is("topInt"));
145 assertThat(typedef.getDefaultValueInString(), is("10"));
146
147 YangType type = typedef.getTypeList().iterator().next();
148 assertThat(type.getDataType(), is(YangDataTypes.INT64));
149 assertThat(type.getDataTypeName(), is("int64"));
150
151 // check leaf
152 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
153 YangLeaf leafInfo = leafIterator.next();
154 assertThat(leafInfo.getName(), is("myValue"));
155
156 // Check leaf reffered typedef
157 assertThat(leafInfo.getDataType().getDataTypeName(), is("topInt"));
158 assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
159 YangType<YangDerivedInfo> typeDerived = (YangType<YangDerivedInfo>) leafInfo.getDataType();
160 YangDerivedInfo derivedInfo = (YangDerivedInfo) typeDerived.getDataTypeExtendedInfo();
161 YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
162 assertThat(prevTypedef.getName(), is("topInt"));
163 assertThat(prevTypedef.getDefaultValueInString(), is("10"));
164 YangType topType = prevTypedef.getTypeList().iterator().next();
165 assertThat(topType.getDataType(), is(YangDataTypes.INT64));
166 assertThat(topType.getDataTypeName(), is("int64"));
167 YangType<YangInt64> typeInt64 = (YangType<YangInt64>) topType;
168 YangInt64 int64Obj = typeInt64.getDataTypeExtendedInfo();
169 }
170
171 /**
172 * Validates invalid default value in typedef.
173 */
174 @Test
175 public void processInvalidDefaultValueInTypdeDef() throws IOException, ParserException {
176 thrown.expect(DataTypeException.class);
177 thrown.expectMessage("YANG file error : Input value \"x\" is not a valid int64.");
178
179 manager.getDataModel("src/test/resources/default/DefaultInvalidValueInTypeDef.yang");
180 }
181
182 /**
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530183 * Validates default invalid value in typedef.
184 */
185 @Test
186 public void processDefaultInvalidValueInTypedef() throws IOException, ParserException {
187 thrown.expect(DataTypeException.class);
188 thrown.expectMessage("YANG file error : Input value \"0\" is not a valid INT32");
189
190 manager.getDataModel("src/test/resources/default/DefaultInvalidValueWithRangeInTypedef.yang");
191 }
192
193 /**
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530194 * Validates default value decimal64 in leaf.
195 */
196 @Test
197 public void processDefaultValueDecimal64InLeaf() throws IOException, ParserException {
198
199 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueDecimal64InLeaf.yang");
200 // Check whether the data model tree returned is of type module.
201 assertThat((node instanceof YangModule), is(true));
202
203 // Check whether the node type is set properly to module.
204 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
205
206 // Check whether the module name is set correctly.
207 YangModule yangNode = (YangModule) node;
208 assertThat(yangNode.getName(), is("Test"));
209
210 // check leaf
211 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
212 YangLeaf leafInfo = leafIterator.next();
213
214 // check the default value
215 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
216 assertThat(leafInfo.getName(), is("mydecimal"));
217 assertThat(leafInfo.getDefaultValueInString(), is("5"));
218 }
219
220 /**
221 * Validates default invalid value decimal64 in leaf.
222 */
223 @Test
224 public void processDefaultInvalidValueDecimal64InLeaf() throws IOException, ParserException {
225 thrown.expect(DataTypeException.class);
226 thrown.expectMessage("YANG file error : Input value \"x\" is not a valid decimal64.");
227
228 manager.getDataModel("src/test/resources/default/DefaultInvalidValueDecimal64InLeaf.yang");
229 }
230
231 /**
232 * Validates default value string in leaf.
233 */
234 @Test
235 public void processDefaultValueStringInLeaf() throws IOException, ParserException {
236
237 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueStringInLeaf.yang");
238 // Check whether the data model tree returned is of type module.
239 assertThat((node instanceof YangModule), is(true));
240
241 // Check whether the node type is set properly to module.
242 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
243
244 // Check whether the module name is set correctly.
245 YangModule yangNode = (YangModule) node;
246 assertThat(yangNode.getName(), is("Test"));
247
248 // check leaf
249 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
250 YangLeaf leafInfo = leafIterator.next();
251
252 // check the default value
253 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
254 assertThat(leafInfo.getName(), is("MyString"));
255 assertThat(leafInfo.getDefaultValueInString(), is("2bB"));
256 }
257
258 /**
259 * Validates default invalid value string in leaf.
260 */
261 @Test
262 public void processDefaultInvalidValueStringInLeaf() throws IOException, ParserException {
263 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530264 thrown.expectMessage("YANG file error : Input value \"2bB2bB\" is not a valid STRING");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530265
266 manager.getDataModel("src/test/resources/default/DefaultInvalidValueStringInLeaf.yang");
267 }
268
269 /**
270 * Validates default value boolean in leaf.
271 */
272 @Test
273 public void processDefaultValueBooleanInLeaf() throws IOException, ParserException {
274
275 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueBooleanInLeaf.yang");
276 // Check whether the data model tree returned is of type module.
277 assertThat((node instanceof YangModule), is(true));
278
279 // Check whether the node type is set properly to module.
280 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
281
282 // Check whether the module name is set correctly.
283 YangModule yangNode = (YangModule) node;
284 assertThat(yangNode.getName(), is("Test"));
285
286 // check leaf
287 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
288 YangLeaf leafInfo = leafIterator.next();
289
290 // check the default value
291 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
292 assertThat(leafInfo.getName(), is("myboolean"));
293 assertThat(leafInfo.getDefaultValueInString(), is("true"));
294 }
295
296 /**
297 * Validates default invalid value boolean in leaf.
298 */
299 @Test
300 public void processDefaultInvalidValueBooleanInLeaf() throws IOException, ParserException {
301 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530302 thrown.expectMessage("YANG file error : Input value \"yes\" is not a valid BOOLEAN");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530303
304 manager.getDataModel("src/test/resources/default/DefaultInvalidValueBooleanInLeaf.yang");
305 }
306
307 /**
308 * Validates default value enumeration in leaf.
309 */
310 @Test
311 public void processDefaultValueEnumberationInLeaf() throws IOException, ParserException {
312
313 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueEnumerationInLeaf.yang");
314 // Check whether the data model tree returned is of type module.
315 assertThat((node instanceof YangModule), is(true));
316
317 // Check whether the node type is set properly to module.
318 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
319
320 // Check whether the module name is set correctly.
321 YangModule yangNode = (YangModule) node;
322 assertThat(yangNode.getName(), is("Test"));
323
324 // check leaf
325 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
326 YangLeaf leafInfo = leafIterator.next();
327
328 // check the default value
329 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
330 assertThat(leafInfo.getName(), is("myenum"));
331 assertThat(leafInfo.getDefaultValueInString(), is("one"));
332 }
333
334 /**
335 * Validates default invalid value enumeration in leaf.
336 */
337 @Test
338 public void processDefaultInvalidValueEnumberationInLeaf() throws IOException, ParserException {
339 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530340 thrown.expectMessage("YANG file error : Input value \"xyz\" is not a valid ENUMERATION");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530341
342 manager.getDataModel("src/test/resources/default/DefaultInvalidValueEnumerationInLeaf.yang");
343 }
344
345 /**
346 * Validates default value bits in leaf.
347 */
348 @Test
349 public void processDefaultValueBitsInLeaf() throws IOException, ParserException {
350
351 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueBitsInLeaf.yang");
352 // Check whether the data model tree returned is of type module.
353 assertThat((node instanceof YangModule), is(true));
354
355 // Check whether the node type is set properly to module.
356 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
357
358 // Check whether the module name is set correctly.
359 YangModule yangNode = (YangModule) node;
360 assertThat(yangNode.getName(), is("Test"));
361
362 // check leaf
363 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
364 YangLeaf leafInfo = leafIterator.next();
365
366 // check the default value
367 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
368 assertThat(leafInfo.getName(), is("mybits"));
369 assertThat(leafInfo.getDefaultValueInString(), is("auto-sense-speed"));
370 }
371
372 /**
373 * Validates default invalid value bits in leaf.
374 */
375 @Test
376 public void processDefaultInvalidValueBitsInLeaf() throws IOException, ParserException {
377 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530378 thrown.expectMessage("YANG file error : Input value \"xyz\" is not a valid BITS");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530379
380 manager.getDataModel("src/test/resources/default/DefaultInvalidValueBitsInLeaf.yang");
381 }
382
383 /**
384 * Validates default value binary in leaf.
385 */
386 @Test
387 public void processDefaultValueBinaryInLeaf() throws IOException, ParserException {
388
389 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueBinaryInLeaf.yang");
390 // Check whether the data model tree returned is of type module.
391 assertThat((node instanceof YangModule), is(true));
392
393 // Check whether the node type is set properly to module.
394 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
395
396 // Check whether the module name is set correctly.
397 YangModule yangNode = (YangModule) node;
398 assertThat(yangNode.getName(), is("Test"));
399
400 // check leaf
401 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
402 YangLeaf leafInfo = leafIterator.next();
403
404 // check the default value
405 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
406 assertThat(leafInfo.getName(), is("message"));
407 assertThat(leafInfo.getDefaultValueInString(), is("10010010"));
408 }
409
410 /**
411 * Validates default invalid value binary in leaf.
412 */
413 @Test
414 public void processDefaultInvlaidValueBinaryInLeaf() throws IOException, ParserException {
415 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530416 thrown.expectMessage("YANG file error : Input value \"000\" is not a valid BINARY");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530417
418 manager.getDataModel("src/test/resources/default/DefaultInvalidValueBinaryInLeaf.yang");
419 }
420
421 /**
422 * Validates default value empty in leaf.
423 */
424 @Test
425 public void processDefaultValueEmptyInLeaf() throws IOException, ParserException {
426 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530427 thrown.expectMessage("YANG file error : Input value \"something\" is not allowed for a data type EMPTY");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530428
429 manager.getDataModel("src/test/resources/default/DefaultValueEmptyInLeaf.yang");
430 }
431
432 /**
433 * Validates default value union in leaf.
434 */
435 @Test
436 public void processDefaultValueUnionInLeaf() throws IOException, ParserException {
437
438 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueUnionInLeaf.yang");
439 // Check whether the data model tree returned is of type module.
440 assertThat((node instanceof YangModule), is(true));
441
442 // Check whether the node type is set properly to module.
443 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
444
445 // Check whether the module name is set correctly.
446 YangModule yangNode = (YangModule) node;
447 assertThat(yangNode.getName(), is("Test"));
448
449 // check leaf
450 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
451 YangLeaf leafInfo = leafIterator.next();
452
453 // check the default value
454 // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
455 assertThat(leafInfo.getName(), is("message"));
456 assertThat(leafInfo.getDefaultValueInString(), is("unbounded"));
457 }
458
459 /**
460 * Validates default invalid value union in leaf.
461 */
462 @Test
463 public void processDefaultInvalidValueUnionInLeaf() throws IOException, ParserException {
464 thrown.expect(DataTypeException.class);
Mahesh Poojary S98675a92016-07-27 15:36:42 +0530465 thrown.expectMessage("YANG file error : Input value \"xyz\" is not a valid UNION");
Mahesh Poojary Sbbd48492016-07-19 10:58:07 +0530466
467 manager.getDataModel("src/test/resources/default/DefaultInvalidValueUnionInLeaf.yang");
468 }
469
470 /**
471 * Validates default value in multiple typedef.
472 */
473 @Test
474 public void processDefaultInMultiTypedef() throws IOException, ParserException {
475
476 YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueInMultiTypeDef.yang");
477 // Check whether the data model tree returned is of type module.
478 assertThat((node instanceof YangModule), is(true));
479
480 // Check whether the node type is set properly to module.
481 assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
482
483 // Check whether the module name is set correctly.
484 YangModule yangNode = (YangModule) node;
485 assertThat(yangNode.getName(), is("Test"));
486
487 // check typedef
488 YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
489 assertThat(typedef.getName(), is("topInt"));
490 assertThat(typedef.getDefaultValueInString(), is("10"));
491
492 YangType type = typedef.getTypeList().iterator().next();
493 assertThat(type.getDataType(), is(YangDataTypes.INT64));
494 assertThat(type.getDataTypeName(), is("int64"));
495
496 // check leaf
497 ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
498 YangLeaf leafInfo = leafIterator.next();
499 assertThat(leafInfo.getName(), is("lowInt"));
500
501 // check leaf type
502 assertThat(leafInfo.getName(), is("lowInt"));
503 assertThat(leafInfo.getDataType().getDataTypeName(), is("midInt"));
504 YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
505 assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
506 YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
507
508 // check previous typedef
509 YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
510 assertThat(prevTypedef.getName(), is("midInt"));
511 type = prevTypedef.getTypeList().iterator().next();
512 assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
513 derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
514
515 // check top typedef
516 YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
517 assertThat(topTypedef.getName(), is("topInt"));
518 assertThat(topTypedef.getDefaultValueInString(), is("10"));
519 YangType topType = topTypedef.getTypeList().iterator().next();
520 assertThat(topType.getDataType(), is(YangDataTypes.INT64));
521 assertThat(topType.getDataTypeName(), is("int64"));
522 YangType<YangInt64> typeInt64 = (YangType<YangInt64>) topType;
523 YangInt64 int64Obj = typeInt64.getDataTypeExtendedInfo();
Vidyashree Rama1db15562016-05-17 16:16:15 +0530524 }
525}