2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.restconf.utils.parser;
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertNotNull;
13 import static org.junit.Assert.assertNull;
14 import static org.junit.Assert.fail;
15 import static org.mockito.Mockito.when;
17 import com.google.common.base.Optional;
18 import com.google.common.collect.ImmutableClassToInstanceMap;
19 import com.google.common.collect.Maps;
20 import org.junit.Before;
21 import org.junit.Rule;
22 import org.junit.Test;
23 import org.junit.rules.ExpectedException;
24 import org.mockito.Mock;
25 import org.mockito.MockitoAnnotations;
26 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
27 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
28 import org.opendaylight.controller.md.sal.dom.broker.impl.mount.DOMMountPointServiceImpl;
29 import org.opendaylight.controller.md.sal.dom.broker.spi.mount.SimpleDOMMountPoint;
30 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
31 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContext;
32 import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
33 import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
34 import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
35 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
36 import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
37 import org.opendaylight.restconf.utils.RestconfConstants;
38 import org.opendaylight.yangtools.yang.common.QName;
39 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
40 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
41 import org.opendaylight.yangtools.yang.model.api.Module;
42 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
43 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
46 * Unit tests for {@link ParserIdentifier}
48 public class ParserIdentifierTest {
49 // mount point identifier
50 private static final String MOUNT_POINT_IDENT =
51 "mount-point:mount-container/point-number" + "/" + RestconfConstants.MOUNT;
53 // invalid mount point identifier
54 private static final String INVALID_MOUNT_POINT_IDENT =
55 "mount-point:point-number" + "/" + RestconfConstants.MOUNT;
57 // test identifier + expected result
58 private static final String TEST_IDENT =
59 "parser-identifier:cont1/cont2/listTest/list-in-grouping=name/leaf-A.B";
61 private static final String TEST_IDENT_RESULT =
62 "/(parser:identifier?revision=2016-06-02)cont1/cont2/listTest/listTest/list-in-grouping/"
63 + "list-in-grouping[{(parser:identifier?revision=2016-06-02)name=name}]/leaf-A.B";
65 // test identifier with nodes defined in other modules using augmentation + expected result
66 private static final String TEST_IDENT_OTHERS =
67 "parser-identifier-included:list-1=name,2016-06-02/parser-identifier:augment-leaf";
69 private static final String TEST_IDENT_OTHERS_RESULT =
70 "/(parser:identifier:included?revision=2016-06-02)list-1/list-1"
71 + "[{(parser:identifier:included?revision=2016-06-02)name=name, "
72 + "(parser:identifier:included?revision=2016-06-02)revision=2016-06-02}]"
73 + "/AugmentationIdentifier{childNames=[(parser:identifier?revision=2016-06-02)augment-leaf]}/"
74 + "(parser:identifier?revision=2016-06-02)augment-leaf";
76 // invalid test identifier
77 private static final String INVALID_TEST_IDENT =
78 "parser-identifier:cont2/listTest/list-in-grouping=name/leaf-A.B";
80 // schema context with test modules
81 private SchemaContext schemaContext;
82 // contains the same modules but it is different object (it can be compared with equals)
83 private SchemaContext schemaContextOnMountPoint;
85 private static final String TEST_MODULE_NAME = "test-module";
86 private static final String TEST_MODULE_REVISION = "2016-06-02";
87 private static final String TEST_MODULE_NAMESPACE = "test:module";
89 // mount point and mount point service
90 private DOMMountPoint mountPoint;
91 private DOMMountPointService mountPointService;
93 // mock mount point and mount point service
95 private DOMMountPoint mockMountPoint;
97 private DOMMountPointService mockMountPointService;
100 public final ExpectedException thrown = ExpectedException.none();
103 public void setup() throws Exception {
104 MockitoAnnotations.initMocks(this);
105 this.schemaContext = YangParserTestUtils.parseYangSources(TestRestconfUtils.loadFiles("/parser-identifier"));
106 this.schemaContextOnMountPoint =
107 YangParserTestUtils.parseYangSources(TestRestconfUtils.loadFiles("/parser-identifier"));
109 // create and register mount point
110 this.mountPoint = SimpleDOMMountPoint.create(
111 YangInstanceIdentifier.builder()
112 .node(QName.create("mount:point", "2016-06-02", "mount-container"))
113 .node(QName.create("mount:point", "2016-06-02", "point-number"))
115 ImmutableClassToInstanceMap.copyOf(Maps.newHashMap()),
116 this.schemaContextOnMountPoint
119 this.mountPointService = new DOMMountPointServiceImpl();
120 ((DOMMountPointServiceImpl) this.mountPointService).registerMountPoint(this.mountPoint);
122 // register mount point with null schema context
123 when(this.mockMountPoint.getSchemaContext()).thenReturn(null);
124 when(this.mockMountPointService.getMountPoint(YangInstanceIdentifier.EMPTY)).thenReturn(Optional.of(this.mockMountPoint));
128 * {@link ParserIdentifier#toInstanceIdentifier(String, SchemaContext)} tests
132 * Positive test of creating <code>InstanceIdentifierContext</code> from identifier when all nodes are defined
136 public void toInstanceIdentifierTest() {
137 final InstanceIdentifierContext<?> context = ParserIdentifier.toInstanceIdentifier(
138 TEST_IDENT, this.schemaContext, Optional.absent());
140 assertEquals("Returned not expected identifier",
141 TEST_IDENT_RESULT, context .getInstanceIdentifier().toString());
145 * Positive test of creating <code>InstanceIdentifierContext</code> from identifier when nodes are defined in
149 public void toInstanceIdentifierOtherModulesTest() {
150 final InstanceIdentifierContext<?> context = ParserIdentifier.toInstanceIdentifier(
151 TEST_IDENT_OTHERS, this.schemaContext, Optional.absent());
153 assertEquals("Returned not expected identifier",
154 TEST_IDENT_OTHERS_RESULT, context.getInstanceIdentifier().toString());
158 * Positive test of creating <code>InstanceIdentifierContext</code> from identifier containing
159 * {@link RestconfConstants#MOUNT}.
162 public void toInstanceIdentifierMountPointTest() {
163 final InstanceIdentifierContext<?> context = ParserIdentifier.toInstanceIdentifier(
164 MOUNT_POINT_IDENT + "/" + TEST_IDENT, this.schemaContext, Optional.of(this.mountPointService));
166 assertEquals("Returned not expected identifier",
167 TEST_IDENT_RESULT.toString(), context.getInstanceIdentifier().toString());
169 assertEquals("Mount point not found",
170 this.mountPoint, context.getMountPoint());
172 assertEquals("Schema context from mount point expected",
173 this.schemaContextOnMountPoint, context.getSchemaContext());
177 * Test of creating <code>InstanceIdentifierContext</code> when identifier is <code>null</code>.
178 * <code>{@link YangInstanceIdentifier#EMPTY}</code> should be returned.
181 public void toInstanceIdentifierNullIdentifierTest() {
182 final InstanceIdentifierContext<?> context = ParserIdentifier.toInstanceIdentifier(
183 null, this.schemaContext, Optional.absent());
184 assertEquals("Returned not expected identifier",
185 YangInstanceIdentifier.EMPTY, context.getInstanceIdentifier());
189 * Negative test of creating <code>InstanceIdentifierContext</code> when <code>SchemaContext</code> is
190 * <code>null</code>. Test fails expecting <code>NullPointerException</code>.
193 public void toInstanceIdentifierNullSchemaContextNegativeTest() {
194 this.thrown.expect(NullPointerException.class);
195 ParserIdentifier.toInstanceIdentifier(TEST_IDENT, null, Optional.absent());
199 * Api path can be empty. <code>YangInstanceIdentifier.EMPTY</code> is expected to be returned.
202 public void toInstanceIdentifierEmptyIdentifierTest() {
203 final InstanceIdentifierContext<?> context = ParserIdentifier.toInstanceIdentifier(
204 "", this.schemaContext, Optional.absent());
205 assertEquals("Returned not expected identifier",
206 YangInstanceIdentifier.EMPTY, context.getInstanceIdentifier());
210 * Negative test with invalid test identifier. Test should fail with <code>IllegalArgumentException</code>.
213 public void toInstanceIdentifierInvalidIdentifierNegativeTest() {
214 this.thrown.expect(IllegalArgumentException.class);
215 ParserIdentifier.toInstanceIdentifier(INVALID_TEST_IDENT, this.schemaContext, Optional.absent());
219 * Negative test when identifier contains {@link RestconfConstants#MOUNT} but identifier part is not valid. Test
220 * should fail with <code>IllegalArgumentException</code>.
223 public void toInstanceIdentifierMountPointInvalidIdentifierNegativeTest() {
224 this.thrown.expect(IllegalArgumentException.class);
225 ParserIdentifier.toInstanceIdentifier(INVALID_MOUNT_POINT_IDENT, this.schemaContext, Optional.of(this.mountPointService));
229 * Negative test when <code>DOMMountPoint</code> cannot be found. Test is expected to fail with
230 * <code>RestconfDocumentedException</code> error type, error tag and error status code are
231 * compared to expected values.
234 public void toInstanceIdentifierMissingMountPointNegativeTest() {
236 ParserIdentifier.toInstanceIdentifier(
237 "" + "/" + RestconfConstants.MOUNT, this.schemaContext, Optional.of(this.mountPointService));
238 fail("Test should fail due to missing mount point");
239 } catch (final RestconfDocumentedException e) {
240 assertEquals("Not expected error type",
241 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
242 assertEquals("Not expected error tag",
243 ErrorTag.DATA_MISSING, e.getErrors().get(0).getErrorTag());
244 assertEquals("Not expected error status code",
245 404, e.getErrors().get(0).getErrorTag().getStatusCode());
250 * Negative test when <code>{@link DOMMountPointService}</code> is absent. Test is expected to fail with
251 * <code>RestconfDocumentedException</code> error type, error tag and error status code are
252 * compared to expected values.
255 public void toInstanceIdentifierMissingMountPointServiceNegativeTest() {
257 ParserIdentifier.toInstanceIdentifier(RestconfConstants.MOUNT, this.schemaContext, Optional.absent());
258 fail("Test should fail due to absent mount point service");
259 } catch (final RestconfDocumentedException e) {
260 assertEquals("Not expected error type",
261 ErrorType.APPLICATION, e.getErrors().get(0).getErrorType());
262 assertEquals("Not expected error tag",
263 ErrorTag.OPERATION_FAILED, e.getErrors().get(0).getErrorTag());
264 assertEquals("Not expected error status code",
265 500, e.getErrors().get(0).getErrorTag().getStatusCode());
270 * {@link ParserIdentifier#makeQNameFromIdentifier(String)} tests
274 * Positive test of making <code>QName</code> from identifier and compare values from returned <code>QName</code>
275 * to expected values.
278 public void makeQNameFromIdentifierTest() {
279 final QName qName = ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_NAME + "/" + TEST_MODULE_REVISION);
281 assertNotNull("QName should be created", qName);
282 assertEquals("Returned not expected module name",
283 TEST_MODULE_NAME, qName.getLocalName());
284 assertEquals("Returned not expected module revision",
285 TEST_MODULE_REVISION, qName.getFormattedRevision());
289 * Negative test when supplied identifier is in invalid format and then revision is not parsable.
290 * <code>RestconfDocumentedException</code> is expected and error type, error tag and error status code are
291 * compared to expected values.
294 public void makeQNameFromIdentifierInvalidIdentifierNegativeTest() {
296 ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME);
297 fail("Test should fail due to invalid identifier format");
298 } catch (final RestconfDocumentedException e) {
299 assertEquals("Not expected error type",
300 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
301 assertEquals("Not expected error tag",
302 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
303 assertEquals("Not expected error status code",
304 400, e.getErrors().get(0).getErrorTag().getStatusCode());
309 * Negative test when supplied identifier is too short (contains only module name).
310 * <code>RestconfDocumentedException</code> is expected and error type, error tag and error status code are
311 * compared to expected values.
314 public void makeQNameFromIdentifierTooShortIdentifierNegativeTest() {
316 ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_NAME);
317 fail("Test should fail due to too short identifier format");
318 } catch (final RestconfDocumentedException e) {
319 assertEquals("Not expected error type",
320 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
321 assertEquals("Not expected error tag",
322 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
323 assertEquals("Not expected error status code",
324 400, e.getErrors().get(0).getErrorTag().getStatusCode());
329 * Positive test of making <code>QName</code> from identifier for module behind mount point. Value from returned
330 * <code>QName</code> are compared to expected values.
333 public void makeQNameFromIdentifierMountTest() {
334 final QName qName = ParserIdentifier.makeQNameFromIdentifier(
339 + TEST_MODULE_REVISION);
341 assertNotNull("QName should be created", qName);
342 assertEquals("Returned not expected module name",
343 TEST_MODULE_NAME, qName.getLocalName());
344 assertEquals("Returned not expected module revision",
345 TEST_MODULE_REVISION, qName.getFormattedRevision());
349 * Negative test when supplied identifier for module behind mount point is in invalid format and then revision is
350 * not parsable. <code>RestconfDocumentedException</code> is expected and error type, error tag and error status
351 * code are compared to expected values.
354 public void makeQNameFromIdentifierMountPointInvalidIdentifierNegativeTest() {
356 ParserIdentifier.makeQNameFromIdentifier(
359 + TEST_MODULE_REVISION
363 fail("Test should fail due to invalid identifier format");
364 } catch (final RestconfDocumentedException e) {
365 assertEquals("Not expected error type",
366 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
367 assertEquals("Not expected error tag",
368 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
369 assertEquals("Not expected error status code",
370 400, e.getErrors().get(0).getErrorTag().getStatusCode());
375 * Negative test when supplied identifier for module behind mount point is too short (contains only module name).
376 * <code>RestconfDocumentedException</code> is expected and error type, error tag and error status code
377 * are compared to expected values.
380 public void makeQNameFromIdentifierMountPointTooShortIdentifierNegativeTest() {
382 ParserIdentifier.makeQNameFromIdentifier(
387 fail("Test should fail due to too short identifier format");
388 } catch (final RestconfDocumentedException e) {
389 assertEquals("Not expected error type",
390 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
391 assertEquals("Not expected error tag",
392 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
393 assertEquals("Not expected error status code",
394 400, e.getErrors().get(0).getErrorTag().getStatusCode());
399 * Negative test trying to make <code>QName</code> from <code>null</code> identifier. Test is expected to fail with
400 * <code>NullPointerException</code>.
403 public void makeQNameFromIdentifierNullIdentifierNegativeTest() {
404 this.thrown.expect(NullPointerException.class);
405 ParserIdentifier.makeQNameFromIdentifier(null);
409 * Negative test trying to make <code>QName</code> from empty identifier. Test is expected to fail with
410 * <code>RestconfDocumentedException</code>. Error type, error tag and error status code is compared to expected
414 public void makeQNameFromIdentifierEmptyIdentifierNegativeTest() {
416 ParserIdentifier.makeQNameFromIdentifier("");
417 fail("Test should fail due to empty identifier");
418 } catch (final RestconfDocumentedException e) {
419 assertEquals("Not expected error type",
420 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
421 assertEquals("Not expected error tag",
422 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
423 assertEquals("Not expected error status code",
424 400, e.getErrors().get(0).getErrorTag().getStatusCode());
429 * Negative test with identifier containing double slash. Between // there is one empty string which will be
430 * incorrectly considered to be module revision. Test is expected to fail with
431 * <code>RestconfDocumentedException</code> and error type, error tag and error status code are compared to
435 public void makeQNameFromIdentifierDoubleSlashNegativeTest() {
437 ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_NAME + "//" + TEST_MODULE_REVISION);
438 fail("Test should fail due to identifier containing double slash");
439 } catch (final RestconfDocumentedException e) {
440 assertEquals("Not expected error type",
441 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
442 assertEquals("Not expected error tag",
443 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
444 assertEquals("Not expected error status code",
445 400, e.getErrors().get(0).getErrorTag().getStatusCode());
450 * {@link ParserIdentifier#toSchemaExportContextFromIdentifier(SchemaContext, String, DOMMountPointService)} tests
454 * Positive test of getting <code>SchemaExportContext</code>. Expected module name, revision and namespace are
458 public void toSchemaExportContextFromIdentifierTest() {
459 final SchemaExportContext exportContext = ParserIdentifier.
460 toSchemaExportContextFromIdentifier(this.schemaContext, TEST_MODULE_NAME + "/" + TEST_MODULE_REVISION, null);
462 assertNotNull("Export context should be parsed", exportContext);
464 final Module module = exportContext.getModule();
465 assertNotNull("Export context should contains test module", module);
467 assertEquals("Returned not expected module name",
468 TEST_MODULE_NAME, module.getName());
469 assertEquals("Returned not expected module revision",
470 TEST_MODULE_REVISION, SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision()));
471 assertEquals("Returned not expected module namespace",
472 TEST_MODULE_NAMESPACE, module.getNamespace().toString());
476 * Test of getting <code>SchemaExportContext</code> when desired module is not found.
477 * <code>SchemaExportContext</code> should be created but module should be set to <code>null</code>.
480 public void toSchemaExportContextFromIdentifierNotFoundTest() {
481 final SchemaExportContext exportContext = ParserIdentifier.toSchemaExportContextFromIdentifier(
483 "not-existing-module" + "/" + "2016-01-01",
486 assertNotNull("Export context should be parsed", exportContext);
487 assertNull("Not-existing module should be null", exportContext.getModule());
491 * Negative test trying to get <code>SchemaExportContext</code> with invalid identifier. Test is expected to fail
492 * with <code>RestconfDocumentedException</code> error type, error tag and error status code are compared to
496 public void toSchemaExportContextFromIdentifierInvalidIdentifierNegativeTest() {
498 ParserIdentifier.toSchemaExportContextFromIdentifier(
499 this.schemaContext, TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME, null);
500 fail("Test should fail due to invalid identifier supplied");
501 } catch (final RestconfDocumentedException e) {
502 assertEquals("Not expected error type",
503 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
504 assertEquals("Not expected error tag",
505 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
506 assertEquals("Not expected error status code",
507 400, e.getErrors().get(0).getErrorTag().getStatusCode());
512 * Positive test of getting <code>SchemaExportContext</code> for module behind mount point.
513 * Expected module name, revision and namespace are verified.
516 public void toSchemaExportContextFromIdentifierMountPointTest() {
517 final SchemaExportContext exportContext = ParserIdentifier.toSchemaExportContextFromIdentifier(
519 MOUNT_POINT_IDENT + "/" + TEST_MODULE_NAME + "/" + TEST_MODULE_REVISION,
520 this.mountPointService);
522 final Module module = exportContext.getModule();
523 assertNotNull("Export context should contains test module", module);
525 assertEquals("Returned not expected module name",
526 TEST_MODULE_NAME, module.getName());
527 assertEquals("Returned not expected module revision",
528 TEST_MODULE_REVISION, SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision()));
529 assertEquals("Returned not expected module namespace",
530 TEST_MODULE_NAMESPACE, module.getNamespace().toString());
534 * Negative test of getting <code>SchemaExportContext</code> when desired module is not found behind mount point.
535 * <code>SchemaExportContext</code> should be still created but module should be set to <code>null</code>.
538 public void toSchemaExportContextFromIdentifierMountPointNotFoundTest() {
539 final SchemaExportContext exportContext = ParserIdentifier.toSchemaExportContextFromIdentifier(
541 MOUNT_POINT_IDENT + "/" + "not-existing-module" + "/" + "2016-01-01",
542 this.mountPointService);
544 assertNotNull("Export context should be parsed", exportContext);
545 assertNull("Not-existing module should be null", exportContext.getModule());
549 * Negative test trying to get <code>SchemaExportContext</code> behind mount point with invalid identifier. Test is
550 * expected to fail with <code>RestconfDocumentedException</code> error type, error tag and error status code are
551 * compared to expected values.
554 public void toSchemaExportContextFromIdentifierMountPointInvalidIdentifierNegativeTest() {
556 ParserIdentifier.toSchemaExportContextFromIdentifier(
558 MOUNT_POINT_IDENT + "/" + TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME,
559 this.mountPointService);
561 fail("Test should fail due to invalid identifier supplied");
562 } catch (final RestconfDocumentedException e) {
563 assertEquals("Not expected error type",
564 RestconfError.ErrorType.PROTOCOL, e.getErrors().get(0).getErrorType());
565 assertEquals("Not expected error tag",
566 RestconfError.ErrorTag.INVALID_VALUE, e.getErrors().get(0).getErrorTag());
567 assertEquals("Not expected error status code",
568 400, e.getErrors().get(0).getErrorTag().getStatusCode());
573 * Negative test of getting <code>SchemaExportContext</code> when supplied identifier is null.
574 * <code>NullPointerException</code> is expected. <code>DOMMountPointService</code> is not used.
577 public void toSchemaExportContextFromIdentifierNullIdentifierNegativeTest() {
578 this.thrown.expect(NullPointerException.class);
579 ParserIdentifier.toSchemaExportContextFromIdentifier(this.schemaContext, null, null);
583 * Negative test of of getting <code>SchemaExportContext</code> when supplied <code>SchemaContext</code> is
584 * <code>null</code>. Test is expected to fail with <code>NullPointerException</code>.
587 public void toSchemaExportContextFromIdentifierNullSchemaContextNegativeTest() {
588 this.thrown.expect(NullPointerException.class);
589 ParserIdentifier.toSchemaExportContextFromIdentifier(null, TEST_MODULE_NAME + "/" + TEST_MODULE_REVISION, null);
593 * Negative test of of getting <code>SchemaExportContext</code> when supplied <code>SchemaContext</code> is
594 * <code>null</code> and identifier specifies module behind mount point. Test is expected to fail with
595 * <code>NullPointerException</code>.
598 public void toSchemaExportContextFromIdentifierMountPointNullSchemaContextNegativeTest() {
599 this.thrown.expect(NullPointerException.class);
600 ParserIdentifier.toSchemaExportContextFromIdentifier(
606 + TEST_MODULE_REVISION,
607 this.mountPointService);
611 * Negative test of of getting <code>SchemaExportContext</code> when supplied <code>DOMMountPointService</code>
612 * is <code>null</code> and identifier defines module behind mount point. Test is expected to fail with
613 * <code>NullPointerException</code>.
616 public void toSchemaExportContextFromIdentifierNullMountPointServiceNegativeTest() {
617 this.thrown.expect(NullPointerException.class);
618 ParserIdentifier.toSchemaExportContextFromIdentifier(
624 + TEST_MODULE_REVISION,
629 * Negative test of of getting <code>SchemaExportContext</code> when <code>SchemaContext</code> behind mount
630 * point is <code>null</code>. Test is expected to fail with <code>NullPointerException</code>.
633 public void toSchemaExportContextFromIdentifierNullSchemaContextBehindMountPointNegativeTest() {
634 this.thrown.expect(NullPointerException.class);
635 ParserIdentifier.toSchemaExportContextFromIdentifier(
638 + RestconfConstants.MOUNT
642 + TEST_MODULE_REVISION,
643 this.mockMountPointService);