- testForIfFeature("/rfc7950/list-keys-test/incorrect-list-keys-test5.yang", exceptionMessage);
- }
-
- private static void testForIfFeature(final String yangSrcPath, final String exMsg) throws URISyntaxException,
- SourceException, IOException, YangSyntaxErrorException {
- try {
- StmtTestUtils.parseYangSource(yangSrcPath);
- fail("Test must fail: IF-FEATURE substatement is not allowed in LIST keys");
- } catch (final ReactorException e) {
- final Throwable cause = e.getCause();
- assertTrue(cause instanceof SourceException);
- assertTrue(cause.getMessage().startsWith(exMsg));
- }
- }
-
- private static void testForWhen(final String yangSrcPath, final String exMsg) throws URISyntaxException,
- SourceException, IOException, YangSyntaxErrorException {
- try {
- StmtTestUtils.parseYangSource(yangSrcPath);
- fail("Test must fail: WHEN substatement is not allowed in LIST keys");
- } catch (final ReactorException e) {
- final Throwable cause = e.getCause();
- assertTrue(cause instanceof SourceException);
- assertTrue(cause.getMessage().startsWith(exMsg));
- }