General issue: In case of uncompilable XPathExpression, 30/27730/5
authorMartin Ciglan <mciglan@cisco.com>
Thu, 1 Oct 2015 09:33:20 +0000 (11:33 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 2 Oct 2015 09:33:21 +0000 (09:33 +0000)
log warning rather than throwing exception.

Change-Id: I16b45cf57b9cf57e21221101cf66335059718982
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/retest/LeafRefContextTreeBuilderTest.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/Utils.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/test/AugmentTest.java

index cd4140b039cfa7ee188031599712832d40f56139..64baa60f88e37acd1343a62b972464ef807e0f5c 100644 (file)
@@ -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());
index d688ec50ab06ff6156c4fd2db7fe09ebb0a4197c..389456e361f7b4a7efd603c63325dc0a65ded59e 100644 (file)
@@ -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);
         }
     }
 
index defa39070eba4257203854473b239a7428740dd4..76503fea51c4285577053f4d31f2e657db9101e5 100644 (file)
@@ -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();