Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 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 | |
Gaurav Agrawal | c5f6327 | 2016-06-16 13:09:53 +0530 | [diff] [blame] | 17 | package org.onosproject.yangutils.plugin.manager; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 18 | |
| 19 | import java.io.IOException; |
| 20 | import java.util.ListIterator; |
| 21 | import org.junit.Test; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 22 | import org.onosproject.yangutils.datamodel.YangContainer; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 23 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
| 24 | import org.onosproject.yangutils.datamodel.YangLeaf; |
| 25 | import org.onosproject.yangutils.datamodel.YangList; |
| 26 | import org.onosproject.yangutils.datamodel.YangModule; |
| 27 | import org.onosproject.yangutils.datamodel.YangNode; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 28 | import org.onosproject.yangutils.datamodel.YangTypeDef; |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 29 | import org.onosproject.yangutils.linker.exceptions.LinkerException; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 30 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
| 31 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
| 32 | |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 33 | import static org.hamcrest.CoreMatchers.nullValue; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 34 | import static org.hamcrest.MatcherAssert.assertThat; |
| 35 | import static org.hamcrest.core.Is.is; |
Gaurav Agrawal | 72cd1b7 | 2016-06-30 13:28:14 +0530 | [diff] [blame] | 36 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY; |
| 37 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
| 38 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; |
| 39 | import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 40 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; |
Bharat saraswal | 96dfef0 | 2016-06-16 00:29:12 +0530 | [diff] [blame] | 41 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED; |
| 42 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Test cases for testing "type" intra file linking. |
| 46 | */ |
| 47 | public class IntraFileTypeLinkingTest { |
| 48 | |
| 49 | private final YangUtilsParserManager manager = new YangUtilsParserManager(); |
| 50 | |
| 51 | /** |
| 52 | * Checks self resolution when typedef and leaf using type are siblings. |
| 53 | */ |
| 54 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 55 | public void processSelfResolutionWhenTypeAndTypedefAtRootLevel() |
| 56 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 57 | |
| 58 | YangNode node = manager.getDataModel("src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevel.yang"); |
| 59 | |
| 60 | // Check whether the data model tree returned is of type module. |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 61 | assertThat(node instanceof YangModule, is(true)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 62 | |
| 63 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 64 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 65 | |
| 66 | // Check whether the module name is set correctly. |
| 67 | YangModule yangNode = (YangModule) node; |
| 68 | assertThat(yangNode.getName(), is("Test")); |
| 69 | |
| 70 | ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator(); |
| 71 | YangLeaf leafInfo = leafIterator.next(); |
| 72 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 73 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 74 | assertThat(leafInfo.getDataType().getDataTypeName(), is("hello")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 75 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 76 | |
| 77 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 78 | is((YangTypeDef) node.getChild())); |
| 79 | |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 80 | assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED)); |
| 81 | |
| 82 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 83 | |
| 84 | // Check for the effective built-in type. |
| 85 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING)); |
| 86 | |
| 87 | // Check for the restriction. |
| 88 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 89 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 90 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 91 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Checks self resolution when typedef and leaf using type are at different |
| 96 | * level where typedef is at the root. |
| 97 | */ |
| 98 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 99 | public void processSelfFileLinkingTypedefAtRootTypeTwoLevelInHierarchy() |
| 100 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 101 | |
| 102 | YangNode node = |
| 103 | manager.getDataModel("src/test/resources/SelfFileLinkingTypedefAtRootTypeTwoLevelInHierarchy.yang"); |
| 104 | |
| 105 | // Check whether the data model tree returned is of type module. |
| 106 | assertThat((node instanceof YangModule), is(true)); |
| 107 | |
| 108 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 109 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 110 | |
| 111 | // Check whether the module name is set correctly. |
| 112 | YangModule yangNode = (YangModule) node; |
| 113 | assertThat(yangNode.getName(), is("Test")); |
| 114 | |
| 115 | YangContainer yangContainer = (YangContainer) node.getChild().getNextSibling(); |
| 116 | |
| 117 | YangList yangList = (YangList) yangContainer.getChild(); |
| 118 | |
| 119 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 120 | YangLeaf leafInfo = leafIterator.next(); |
| 121 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 122 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 123 | assertThat(leafInfo.getDataType().getDataTypeName(), is("hello")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 124 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 125 | |
| 126 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 127 | is((YangTypeDef) node.getChild())); |
| 128 | |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 129 | assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED)); |
| 130 | |
| 131 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 132 | |
| 133 | // Check for the effective built-in type. |
| 134 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING)); |
| 135 | |
| 136 | // Check for the restriction. |
| 137 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 138 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 139 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 140 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Checks self resolution when typedef and leaf using type are at different |
| 145 | * level where typedef is at the root and defined after parent holder |
| 146 | * of type. |
| 147 | */ |
| 148 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 149 | public void processSelfFileLinkingTypedefAtRootIsAfterContainerHavingType() |
| 150 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 151 | |
| 152 | YangNode node = |
| 153 | manager.getDataModel("src/test/resources/SelfFileLinkingTypedefAtRootIsAfterContainerHavingType.yang"); |
| 154 | |
| 155 | // Check whether the data model tree returned is of type module. |
| 156 | assertThat((node instanceof YangModule), is(true)); |
| 157 | |
| 158 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 159 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 160 | |
| 161 | // Check whether the module name is set correctly. |
| 162 | YangModule yangNode = (YangModule) node; |
| 163 | assertThat(yangNode.getName(), is("Test")); |
| 164 | |
| 165 | YangContainer yangContainer = (YangContainer) node.getChild(); |
| 166 | |
| 167 | YangList yangList = (YangList) yangContainer.getChild(); |
| 168 | |
| 169 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 170 | YangLeaf leafInfo = leafIterator.next(); |
| 171 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 172 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 173 | assertThat(leafInfo.getDataType().getDataTypeName(), is("hello")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 174 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 175 | |
| 176 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 177 | is((YangTypeDef) node.getChild().getNextSibling())); |
| 178 | |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 179 | assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED)); |
| 180 | |
| 181 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 182 | |
| 183 | // Check for the effective built-in type. |
| 184 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING)); |
| 185 | |
| 186 | // Check for the restriction. |
| 187 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 188 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 189 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 190 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | /** |
| 194 | * Checks self resolution when typedef and leaf using type are at different |
| 195 | * level where typedef is at the level of root+1 and defined after parent |
| 196 | * holder of type. |
| 197 | */ |
| 198 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 199 | public void processSelfFileLinkingTypedefAtMiddleLevelAfterParentHolder() |
| 200 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 201 | |
| 202 | YangNode node = |
| 203 | manager.getDataModel("src/test/resources/SelfFileLinkingTypedefAtMiddleLevelAfterParentHolder.yang"); |
| 204 | |
| 205 | // Check whether the data model tree returned is of type module. |
| 206 | assertThat((node instanceof YangModule), is(true)); |
| 207 | |
| 208 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 209 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 210 | |
| 211 | // Check whether the module name is set correctly. |
| 212 | YangModule yangNode = (YangModule) node; |
| 213 | assertThat(yangNode.getName(), is("Test")); |
| 214 | |
| 215 | YangContainer yangContainer = (YangContainer) node.getChild(); |
| 216 | |
| 217 | YangList yangList = (YangList) yangContainer.getChild(); |
| 218 | |
| 219 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 220 | YangLeaf leafInfo = leafIterator.next(); |
| 221 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 222 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 223 | assertThat(leafInfo.getDataType().getDataTypeName(), is("hello")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 224 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 225 | |
| 226 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 227 | is((YangTypeDef) yangContainer.getChild().getNextSibling())); |
| 228 | |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 229 | assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED)); |
| 230 | |
| 231 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 232 | |
| 233 | // Check for the effective built-in type. |
| 234 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING)); |
| 235 | |
| 236 | // Check for the restriction. |
| 237 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 238 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 239 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 240 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Checks self resolution when typedef hierarchical references are present. |
| 245 | */ |
| 246 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 247 | public void processSelfFileLinkingWithTypdefHierarchicalReference() |
| 248 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 249 | |
| 250 | YangNode node = |
| 251 | manager.getDataModel("src/test/resources/SelfFileLinkingWithTypdefHierarchicalReference.yang"); |
| 252 | |
| 253 | // Check whether the data model tree returned is of type module. |
| 254 | assertThat((node instanceof YangModule), is(true)); |
| 255 | |
| 256 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 257 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 258 | |
| 259 | // Check whether the module name is set correctly. |
| 260 | YangModule yangNode = (YangModule) node; |
| 261 | assertThat(yangNode.getName(), is("Test")); |
| 262 | |
| 263 | YangContainer yangContainer = (YangContainer) node.getChild().getNextSibling(); |
| 264 | |
| 265 | YangList yangList = (YangList) yangContainer.getChild(); |
| 266 | |
| 267 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 268 | YangLeaf leafInfo = leafIterator.next(); |
| 269 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 270 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 271 | assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 272 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 273 | |
| 274 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 275 | is((YangTypeDef) yangList.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 276 | assertThat(leafInfo.getDataType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 277 | is(RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 278 | |
| 279 | YangTypeDef typeDef1 = (YangTypeDef) yangList.getChild(); |
| 280 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 281 | assertThat(((YangDerivedInfo<?>) typeDef1.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 282 | is((YangTypeDef) yangContainer.getChild().getNextSibling())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 283 | assertThat(typeDef1.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 284 | is(RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 285 | |
| 286 | YangTypeDef typeDef2 = (YangTypeDef) yangContainer.getChild().getNextSibling(); |
| 287 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 288 | assertThat(((YangDerivedInfo<?>) typeDef2.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 289 | is((YangTypeDef) node.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 290 | assertThat(typeDef2.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 291 | is(RESOLVED)); |
| 292 | |
| 293 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 294 | |
| 295 | // Check for the effective built-in type. |
| 296 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(INT32)); |
| 297 | |
| 298 | // Check for the restriction. |
| 299 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 300 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 301 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 302 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | /** |
| 306 | * Checks self resolution when typedef hierarchical references are present |
| 307 | * with last type is unresolved. |
| 308 | */ |
| 309 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 310 | public void processSelfFileLinkingWithTypdefHierarchicalRefUnresolved() |
| 311 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 312 | |
| 313 | YangNode node = |
| 314 | manager.getDataModel("src/test/resources/SelfFileLinkingWithTypdefHierarchicalRefUnresolved.yang"); |
| 315 | |
| 316 | // Check whether the data model tree returned is of type module. |
| 317 | assertThat((node instanceof YangModule), is(true)); |
| 318 | |
| 319 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 320 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 321 | |
| 322 | // Check whether the module name is set correctly. |
| 323 | YangModule yangNode = (YangModule) node; |
| 324 | assertThat(yangNode.getName(), is("Test")); |
| 325 | |
| 326 | YangContainer yangContainer = (YangContainer) node.getChild().getNextSibling(); |
| 327 | |
| 328 | YangList yangList = (YangList) yangContainer.getChild(); |
| 329 | |
| 330 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 331 | YangLeaf leafInfo = leafIterator.next(); |
| 332 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 333 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 334 | assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 335 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 336 | |
| 337 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 338 | is((YangTypeDef) yangList.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 339 | assertThat(leafInfo.getDataType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 340 | is(INTRA_FILE_RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 341 | |
| 342 | YangTypeDef typeDef1 = (YangTypeDef) yangList.getChild(); |
| 343 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 344 | assertThat(((YangDerivedInfo<?>) typeDef1.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 345 | is((YangTypeDef) yangContainer.getChild().getNextSibling())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 346 | assertThat(typeDef1.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 347 | is(INTRA_FILE_RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 348 | |
| 349 | YangTypeDef typeDef2 = (YangTypeDef) yangContainer.getChild().getNextSibling(); |
| 350 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 351 | assertThat(((YangDerivedInfo<?>) typeDef2.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 352 | is((YangTypeDef) node.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 353 | assertThat(typeDef2.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 354 | is(INTRA_FILE_RESOLVED)); |
| 355 | |
| 356 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 357 | |
| 358 | // Check for the effective built-in type. |
| 359 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(nullValue())); |
| 360 | |
| 361 | // Check for the restriction. |
| 362 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 363 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 364 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 365 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | /** |
| 369 | * Checks self resolution when type uses prefix of self module. |
| 370 | */ |
| 371 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 372 | public void processSelfFileLinkingWithTypeWithSelfModulePrefix() |
| 373 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 374 | |
| 375 | YangNode node = |
| 376 | manager.getDataModel("src/test/resources/SelfFileLinkingWithTypeWithSelfModulePrefix.yang"); |
| 377 | |
| 378 | // Check whether the data model tree returned is of type module. |
| 379 | assertThat((node instanceof YangModule), is(true)); |
| 380 | |
| 381 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 382 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 383 | |
| 384 | // Check whether the module name is set correctly. |
| 385 | YangModule yangNode = (YangModule) node; |
| 386 | assertThat(yangNode.getName(), is("Test")); |
| 387 | |
| 388 | YangContainer yangContainer = (YangContainer) node.getChild().getNextSibling(); |
| 389 | |
| 390 | YangList yangList = (YangList) yangContainer.getChild(); |
| 391 | |
| 392 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 393 | YangLeaf leafInfo = leafIterator.next(); |
| 394 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 395 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 396 | assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 397 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 398 | |
| 399 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 400 | is((YangTypeDef) yangList.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 401 | assertThat(leafInfo.getDataType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 402 | is(RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 403 | |
| 404 | YangTypeDef typeDef1 = (YangTypeDef) yangList.getChild(); |
| 405 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 406 | assertThat(((YangDerivedInfo<?>) typeDef1.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 407 | is((YangTypeDef) yangContainer.getChild().getNextSibling())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 408 | assertThat(typeDef1.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 409 | is(RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 410 | |
| 411 | YangTypeDef typeDef2 = (YangTypeDef) yangContainer.getChild().getNextSibling(); |
| 412 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 413 | assertThat(((YangDerivedInfo<?>) typeDef2.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 414 | is((YangTypeDef) node.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 415 | assertThat(typeDef2.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 416 | is(RESOLVED)); |
| 417 | |
| 418 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 419 | |
| 420 | // Check for the effective built-in type. |
| 421 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(INT32)); |
| 422 | |
| 423 | // Check for the restriction. |
| 424 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 425 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 426 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 427 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 428 | } |
| 429 | |
| 430 | /** |
| 431 | * Checks self resolution when some type uses prefix of self module |
| 432 | * some uses external prefix. |
| 433 | */ |
| 434 | @Test |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 435 | public void processSelfFileLinkingWithTypeWithSelfAndExternalPrefixMix() |
| 436 | throws IOException, ParserException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 437 | |
| 438 | YangNode node = |
| 439 | manager.getDataModel("src/test/resources/SelfFileLinkingWithTypeWithSelfAndExternalPrefixMix.yang"); |
| 440 | |
| 441 | // Check whether the data model tree returned is of type module. |
| 442 | assertThat((node instanceof YangModule), is(true)); |
| 443 | |
| 444 | // Check whether the node type is set properly to module. |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 445 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 446 | |
| 447 | // Check whether the module name is set correctly. |
| 448 | YangModule yangNode = (YangModule) node; |
| 449 | assertThat(yangNode.getName(), is("Test")); |
| 450 | |
| 451 | YangContainer yangContainer = (YangContainer) node.getChild().getNextSibling(); |
| 452 | |
| 453 | YangList yangList = (YangList) yangContainer.getChild(); |
| 454 | |
| 455 | ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator(); |
| 456 | YangLeaf leafInfo = leafIterator.next(); |
| 457 | |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 458 | assertThat(leafInfo.getName(), is("invalid-interval")); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 459 | assertThat(leafInfo.getDataType().getDataTypeName(), is("FirstClass")); |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 460 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 461 | |
| 462 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 463 | is((YangTypeDef) yangList.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 464 | assertThat(leafInfo.getDataType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 465 | is(INTRA_FILE_RESOLVED)); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 466 | |
| 467 | YangTypeDef typeDef1 = (YangTypeDef) yangList.getChild(); |
| 468 | |
| 469 | YangTypeDef typeDef2 = (YangTypeDef) yangContainer.getChild().getNextSibling(); |
| 470 | |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 471 | assertThat(((YangDerivedInfo<?>) typeDef2.getTypeDefBaseType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 472 | is((YangTypeDef) node.getChild())); |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 473 | assertThat(typeDef2.getTypeDefBaseType().getResolvableStatus(), |
Gaurav Agrawal | cfa1c41 | 2016-05-03 00:41:48 +0530 | [diff] [blame] | 474 | is(RESOLVED)); |
| 475 | |
| 476 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 477 | |
| 478 | // Check for the effective built-in type. |
| 479 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(nullValue())); |
| 480 | |
| 481 | // Check for the restriction. |
| 482 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 483 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 484 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 485 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | /** |
| 489 | * Check self resolution when type referred typedef is not available in |
| 490 | * file. |
| 491 | */ |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 492 | @Test(expected = LinkerException.class) |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 493 | public void processSelfResolutionWhenTypeReferredTypedefNotDefined() |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 494 | throws IOException, LinkerException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 495 | |
| 496 | YangNode node = |
| 497 | manager.getDataModel("src/test/resources/SelfResolutionWhenTypeReferredTypedefNotDefined.yang"); |
| 498 | } |
| 499 | |
| 500 | /** |
| 501 | * Checks self resolution when typedef and leaf using type are at different |
| 502 | * level where typedef is is not an ancestor of type. |
| 503 | */ |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 504 | @Test(expected = LinkerException.class) |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 505 | public void processSelfFileLinkingTypedefNotFound() |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 506 | throws IOException, LinkerException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 507 | |
| 508 | YangNode node = manager.getDataModel("src/test/resources/SelfFileLinkingTypedefNotFound.yang"); |
| 509 | } |
| 510 | |
| 511 | /** |
| 512 | * Checks hierarchical self resolution with self resolution failure scenario. |
| 513 | */ |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 514 | @Test(expected = LinkerException.class) |
Vinod Kumar S | d4deb06 | 2016-04-15 18:08:57 +0530 | [diff] [blame] | 515 | public void processSelfFileLinkingWithHierarchicalTypeFailureScenario() |
Gaurav Agrawal | 95b416c | 2016-06-07 14:00:26 +0530 | [diff] [blame] | 516 | throws IOException, LinkerException { |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 517 | |
| 518 | YangNode node = |
| 519 | manager.getDataModel("src/test/resources/SelfFileLinkingWithHierarchicalTypeFailureScenario.yang"); |
| 520 | } |
Gaurav Agrawal | 0d43bb5 | 2016-05-17 18:06:38 +0530 | [diff] [blame] | 521 | |
| 522 | /** |
| 523 | * Checks self resolution when typedef and leaf using type are siblings for binary type. |
| 524 | */ |
| 525 | @Test |
| 526 | public void processSelfResolutionWhenTypeAndTypedefAtRootLevelForBinary() |
| 527 | throws IOException, ParserException { |
| 528 | |
| 529 | YangNode node |
| 530 | = manager.getDataModel("src/test/resources/SelfResolutionWhenTypeAndTypedefAtRootLevelForBinary.yang"); |
| 531 | |
| 532 | // Check whether the data model tree returned is of type module. |
| 533 | assertThat(node instanceof YangModule, is(true)); |
| 534 | |
| 535 | // Check whether the node type is set properly to module. |
| 536 | assertThat(node.getNodeType(), is(MODULE_NODE)); |
| 537 | |
| 538 | // Check whether the module name is set correctly. |
| 539 | YangModule yangNode = (YangModule) node; |
| 540 | assertThat(yangNode.getName(), is("ospf")); |
| 541 | |
| 542 | ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator(); |
| 543 | YangLeaf leafInfo = leafIterator.next(); |
| 544 | |
| 545 | assertThat(leafInfo.getName(), is("typedef14")); |
| 546 | assertThat(leafInfo.getDataType().getDataTypeName(), is("type14")); |
| 547 | assertThat(leafInfo.getDataType().getDataType(), is(DERIVED)); |
| 548 | |
| 549 | assertThat(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef(), |
| 550 | is((YangTypeDef) node.getChild())); |
| 551 | |
| 552 | assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED)); |
| 553 | |
| 554 | YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo(); |
| 555 | |
| 556 | // Check for the effective built-in type. |
| 557 | assertThat(derivedInfo.getEffectiveBuiltInType(), is(BINARY)); |
| 558 | |
| 559 | // Check for the restriction. |
| 560 | assertThat(derivedInfo.getLengthRestrictionString(), is(nullValue())); |
| 561 | assertThat(derivedInfo.getRangeRestrictionString(), is(nullValue())); |
| 562 | assertThat(derivedInfo.getPatternRestriction(), is(nullValue())); |
| 563 | assertThat(derivedInfo.getResolvedExtendedInfo(), is(nullValue())); |
| 564 | } |
Gaurav Agrawal | d9d6cc8 | 2016-03-29 02:17:23 +0530 | [diff] [blame] | 565 | } |