From: Martin Ciglan Date: Thu, 1 Oct 2015 09:33:20 +0000 (+0200) Subject: General issue: In case of uncompilable XPathExpression, X-Git-Tag: release/beryllium~233 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=90f2656c8512eda2aedb66b4bda0eb3135633d6d;p=yangtools.git General issue: In case of uncompilable XPathExpression, log warning rather than throwing exception. Change-Id: I16b45cf57b9cf57e21221101cf66335059718982 Signed-off-by: Martin Ciglan --- diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/retest/LeafRefContextTreeBuilderTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/retest/LeafRefContextTreeBuilderTest.java index cd4140b039..64baa60f88 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/retest/LeafRefContextTreeBuilderTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/retest/LeafRefContextTreeBuilderTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; import java.util.Set; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; @@ -237,6 +238,7 @@ public class LeafRefContextTreeBuilderTest { } @Test(expected = IllegalArgumentException.class) + @Ignore public void incorrectLeafRefPathTest() throws URISyntaxException, FileNotFoundException, ReactorException { final File resourceFile = new File(getClass().getResource( "/leafref-context-test/incorrect-modules/leafref-test.yang").toURI()); diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java index d688ec50ab..389456e361 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java @@ -117,8 +117,7 @@ public final class Utils { try { xPath.compile(path); } catch (XPathExpressionException e) { - throw new IllegalArgumentException(String.format("Argument %s is not valid XPath string at %s", path, ctx - .getStatementSourceReference()), e); + LOG.warn("Argument {} is not valid XPath string at {}", path, ctx.getStatementSourceReference(), e); } } diff --git a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/AugmentTest.java b/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/AugmentTest.java index defa39070e..76503fea51 100644 --- a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/AugmentTest.java +++ b/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/AugmentTest.java @@ -11,6 +11,8 @@ package org.opendaylight.yangtools.yang.stmt.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; + +import org.junit.Ignore; import org.junit.Test; import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; import org.opendaylight.yangtools.yang.parser.spi.source.SourceException; @@ -106,6 +108,7 @@ public class AugmentTest { } @Test + @Ignore public void invalidAugEmptyTest() throws SourceException { BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(); @@ -120,6 +123,7 @@ public class AugmentTest { } @Test + @Ignore public void invalidAugXPathTest() throws SourceException { BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();