Move Bug4079/Bug5410 tests from yang-parser to yang-model-util
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / Bug4079Test.java
similarity index 91%
rename from yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug4079Test.java
rename to yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/Bug4079Test.java
index 969f8d633e535fe495059b28d6883c50d224c5f0..5333c9882b4eae80d6c1b9a03f19803264c4ee45 100644 (file)
@@ -5,17 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
-package org.opendaylight.yangtools.yang.stmt;
+package org.opendaylight.yangtools.yang.model.util;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.lang.reflect.InvocationTargetException;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 import org.junit.Test;
-import org.opendaylight.yangtools.yang.model.util.RegexUtils;
 
 public class Bug4079Test {
 
@@ -109,7 +106,7 @@ public class Bug4079Test {
     }
 
     @Test(expected = PatternSyntaxException.class)
-    public void testInvalidPattern() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+    public void testInvalidPattern() {
         String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD("(\\\\p{IsBasicLatin})*+");
         assertEquals("^(\\\\p{IsBasicLatin})*+$", fixedUnicodeScriptPattern);
         // should throw exception
@@ -117,16 +114,18 @@ public class Bug4079Test {
     }
 
     @Test(expected = PatternSyntaxException.class)
-    public void testInvalidPattern2() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD("(\\p{IsSpecials}|\\\\\\\\p{IsBasicLatin})*+");
+    public void testInvalidPattern2() {
+        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD(
+            "(\\p{IsSpecials}|\\\\\\\\p{IsBasicLatin})*+");
         assertEquals("^(\\p{InSpecials}|\\\\\\\\p{IsBasicLatin})*+$", fixedUnicodeScriptPattern);
         // should throw exception
         Pattern.compile(fixedUnicodeScriptPattern);
     }
 
     @Test(expected = PatternSyntaxException.class)
-    public void testInvalidPattern3() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD("(\\\\\\\\\\\\p{IsBasicLatin}|\\p{IsTags})*+");
+    public void testInvalidPattern3() {
+        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD(
+            "(\\\\\\\\\\\\p{IsBasicLatin}|\\p{IsTags})*+");
         assertEquals("^(\\\\\\\\\\\\p{IsBasicLatin}|\\p{IsTags})*+$", fixedUnicodeScriptPattern);
         // should throw exception
         Pattern.compile(fixedUnicodeScriptPattern);