BUG-1520 coverage tests for config-api 34/10234/7
authorFilip Tehlar <ftehlar@cisco.com>
Mon, 25 Aug 2014 11:11:22 +0000 (13:11 +0200)
committerFilip Tehlar <ftehlar@cisco.com>
Wed, 27 Aug 2014 11:01:30 +0000 (13:01 +0200)
Change-Id: I497ad8717ad98ca58f34a1b5052b779481b6a665
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
opendaylight/config/config-api/pom.xml
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttribute.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java [new file with mode: 0644]
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeTest.java [new file with mode: 0644]
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeValidationExceptionTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ModuleIdentifierTest.java [new file with mode: 0644]
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ValidationExceptionTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/CommitStatusTest.java [new file with mode: 0644]
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/ConfigRegistryConstantsTest.java [new file with mode: 0644]
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtilTest.java

index 58a93a188b1886194ceed42845a16524126a0cd2..e145bd2db0de394d64492e64aeeeea5ce432bd8f 100644 (file)
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
     </dependency>
+      <dependency>
+          <groupId>org.opendaylight.yangtools</groupId>
+          <artifactId>mockito-configuration</artifactId>
+      </dependency>
   </dependencies>
 
   <build>
index 649b1eb4676e6ab7dfc2ef81f8b13d2b74753e15..7ce602ae49685600ec4d9a990465ce2ce69398b4 100644 (file)
@@ -39,8 +39,7 @@ public class JmxAttribute {
 
         JmxAttribute that = (JmxAttribute) o;
 
-        if (attributeName != null ? !attributeName.equals(that.attributeName)
-                : that.attributeName != null) {
+        if (!attributeName.equals(that.attributeName)) {
             return false;
         }
 
@@ -49,7 +48,7 @@ public class JmxAttribute {
 
     @Override
     public int hashCode() {
-        return attributeName != null ? attributeName.hashCode() : 0;
+        return attributeName.hashCode();
     }
 
     @Override
diff --git a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java
new file mode 100644 (file)
index 0000000..6e8ece3
--- /dev/null
@@ -0,0 +1,71 @@
+package org.opendaylight.controller.config.api;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+
+import javax.management.*;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.*;
+
+public class IdentityAttributeRefTest {
+
+    IdentityAttributeRef attr = new IdentityAttributeRef("attr");
+
+    @Test
+    public void testConstructor() throws Exception {
+        String param = new String("attr");
+        Assert.assertEquals(attr.getqNameOfIdentity(), param);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testConstructor2() throws Exception {
+        IdentityAttributeRef attr = new IdentityAttributeRef(null);
+    }
+
+    @Test
+    public void testHashCode() throws Exception {
+        Assert.assertEquals(attr.hashCode(), new String("attr").hashCode());
+    }
+
+    @Test
+    public void testEqual() throws Exception {
+        Assert.assertEquals(attr, attr);
+    }
+
+    @Test
+    public void testEqual2() throws Exception {
+        Assert.assertEquals(attr, new IdentityAttributeRef("attr"));
+    }
+
+    @Test
+    public void testNotEqual() throws Exception {
+        Assert.assertNotEquals(attr, new IdentityAttributeRef("different"));
+    }
+
+    @Test
+    public void testResolveIdentity() throws Exception {
+        DependencyResolver res = mock(DependencyResolver.class);
+        IdentityAttributeRef a = new IdentityAttributeRef("abcd");
+        doReturn(SubIdentity.class).when(res).resolveIdentity(a, Identity.class);
+        a.resolveIdentity(res, Identity.class);
+        verify(res).resolveIdentity(a, Identity.class);
+    }
+
+    @Test
+    public void testValidateIdentity() throws Exception {
+        DependencyResolver res = mock(DependencyResolver.class);
+        JmxAttribute jmxAttr = new JmxAttribute("abc");
+        doNothing().when(res).validateIdentity(attr, Identity.class, jmxAttr);
+        attr.validateIdentity(res, Identity.class, jmxAttr);
+        verify(res).validateIdentity(attr, Identity.class, jmxAttr);
+    }
+
+    static class Identity extends BaseIdentity {}
+
+    static class SubIdentity extends Identity {}
+}
diff --git a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeTest.java b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeTest.java
new file mode 100644 (file)
index 0000000..39609a0
--- /dev/null
@@ -0,0 +1,53 @@
+package org.opendaylight.controller.config.api;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class JmxAttributeTest {
+
+    @Test
+    public void testJmxAttribute() throws Exception {
+        JmxAttribute attr = new JmxAttribute("test");
+        assertEquals("test", attr.getAttributeName());
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        JmxAttribute attr = new JmxAttribute("test");
+        assertEquals(attr.toString(), new JmxAttribute("test").toString());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testJmxAttributeInvalid() throws Exception {
+        JmxAttribute attr = new JmxAttribute(null);
+    }
+
+    @Test
+    public void testJmxAttributeEqual() throws Exception {
+        JmxAttribute a1 = new JmxAttribute("test_string");
+        JmxAttribute a2 = new JmxAttribute("test_string");
+        assertEquals(a1, a2);
+    }
+
+    @Test
+    public void testJmxAttributeNotEqual() throws Exception {
+        JmxAttribute a1 = new JmxAttribute("test_string");
+        JmxAttribute a2 = new JmxAttribute("different");
+        assertNotEquals(a1, a2);
+    }
+
+    @Test
+    public void testJmxAttributeEqual2() throws Exception {
+        JmxAttribute a1 = new JmxAttribute("test_string");
+        assertNotNull(a1);
+    }
+
+    @Test
+    public void testJmxAttributeHashCode() throws Exception {
+        JmxAttribute a1 = new JmxAttribute("test_string");
+        assertEquals(a1.hashCode(), new String("test_string").hashCode());
+    }
+}
index 7a057bbccb9985262698cc1d48a7f34bc63a329a..f6e7dfb505ed486fb80cb8a5bc7f6799536abed0 100644 (file)
@@ -1,47 +1,87 @@
 package org.opendaylight.controller.config.api;
 
-import static org.junit.Assert.assertEquals;
+import java.nio.file.AccessDeniedException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 import com.google.common.collect.Lists;
+import org.hamcrest.CoreMatchers;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import javax.management.Query;
+
+import static org.junit.Assert.*;
+
 public class JmxAttributeValidationExceptionTest {
 
     private JmxAttribute jmxAttribute = new JmxAttribute("attr1");
-    private JmxAttribute jmxAttribute2 = new JmxAttribute("attr2");
 
-    @Before
-    public void setUp() throws Exception {
+    @Test
+    public void testJmxAttributeValidationExceptionElement() throws Exception {
+        JmxAttribute attributeName = new JmxAttribute("attr_name");
+        JmxAttributeValidationException e = new JmxAttributeValidationException(attributeName);
+        assertThat(e.getAttributeNames(), CoreMatchers.hasItem(attributeName));
+    }
 
+    @Test
+    public void testJmxAttributeValidationExceptionList() throws Exception {
+        List attributeNames = new ArrayList<JmxAttribute>();
+        attributeNames.add(new JmxAttribute("att1"));
+        attributeNames.add(new JmxAttribute("att2"));
+        attributeNames.add(new JmxAttribute("att3"));
+        JmxAttributeValidationException e = new JmxAttributeValidationException(attributeNames);
+        assertEquals(e.getAttributeNames(), attributeNames);
     }
 
     @Test
-    public void testGetAttributeNames() throws Exception {
+    public void testJmxAttributeValidationExceptionList2() throws Exception {
+        List attributeNames = new ArrayList<JmxAttribute>();
+        attributeNames.add(new JmxAttribute("att1"));
+        attributeNames.add(new JmxAttribute("att2"));
+        attributeNames.add(new JmxAttribute("att3"));
+        JmxAttributeValidationException e = new JmxAttributeValidationException("exception str",
+                new AccessDeniedException(""), attributeNames);
+        assertEquals(e.getAttributeNames(), attributeNames);
+    }
 
+    @Test
+    public void testJmxAttributeValidationExceptionJmxElement() throws Exception {
+        JmxAttribute attributeName = new JmxAttribute("attr_name");
+        JmxAttributeValidationException e = new JmxAttributeValidationException("exception str",
+                new AccessDeniedException(""), attributeName);
+        assertEquals(e.getAttributeNames(), Arrays.asList(attributeName));
     }
 
     @Test
     public void testCheckNotNull() throws Exception {
         try {
-            JmxAttributeValidationException.checkNotNull(false, "message", jmxAttribute);
+            JmxAttributeValidationException.checkNotNull(false, jmxAttribute);
         } catch (JmxAttributeValidationException e) {
             assertJmxEx(e, jmxAttribute.getAttributeName() + " " + "message", jmxAttribute);
         }
     }
 
     @Test
-    public void testWrap() throws Exception {
+    public void testCheckCondition() throws Exception {
+        JmxAttributeValidationException.checkCondition(true, "message", jmxAttribute);
+    }
 
+    @Test(expected = JmxAttributeValidationException.class)
+    public void testJmxAttributeValidationException() throws Exception {
+        JmxAttributeValidationException.wrap(new Exception("tmp"), jmxAttribute);
     }
 
-    @Test
-    public void testCheckCondition() throws Exception {
-        try {
-            JmxAttributeValidationException.checkCondition(false, "message", jmxAttribute);
-        } catch (JmxAttributeValidationException e) {
-            assertJmxEx(e, jmxAttribute.getAttributeName() + " " + "message", jmxAttribute);
-        }
+    @Test(expected = JmxAttributeValidationException.class)
+    public void testJmxAttributeValidationException2() throws Exception {
+        JmxAttributeValidationException.wrap(new Exception("tmp"), "message", jmxAttribute);
+    }
+
+    @Test(expected = JmxAttributeValidationException.class)
+    public void testCheckConditionFalse() throws Exception {
+        JmxAttributeValidationException.checkCondition(false, "message", jmxAttribute);
     }
 
     private void assertJmxEx(JmxAttributeValidationException e, String message, JmxAttribute... attrNames) {
diff --git a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ModuleIdentifierTest.java b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ModuleIdentifierTest.java
new file mode 100644 (file)
index 0000000..c0e584a
--- /dev/null
@@ -0,0 +1,63 @@
+package org.opendaylight.controller.config.api;
+
+import junit.framework.Assert;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+
+public class ModuleIdentifierTest {
+    String fact = new String("factory");
+    String inst = new String("instance");
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testConstructor() throws Exception {
+        ModuleIdentifier m = new ModuleIdentifier(null, "instance");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testConstructor2() throws Exception {
+        ModuleIdentifier m = new ModuleIdentifier("name", null);
+    }
+
+    @Test
+    public void testEquals() throws Exception {
+
+        ModuleIdentifier m1 = new ModuleIdentifier(fact, inst);
+        assertEquals(m1, new ModuleIdentifier(fact, inst));
+    }
+
+    @Test
+    public void testEquals2() throws Exception {
+        assertNotEquals(new ModuleIdentifier(fact, inst), null);
+    }
+
+    @Test
+    public void testEquals3() throws Exception {
+        assertNotEquals(new ModuleIdentifier(fact, inst), new ModuleIdentifier(fact, "i"));
+    }
+
+    @Test
+    public void testEquals4() throws Exception {
+        assertNotEquals(new ModuleIdentifier(fact, inst), new ModuleIdentifier("f", inst));
+    }
+
+    @Test
+    public void testEquals5() throws Exception {
+        ModuleIdentifier m1 = new ModuleIdentifier(fact, inst);
+        assertEquals(m1, m1);
+    }
+
+    @Test
+    public void testHashCode() throws Exception {
+        int hash = new ModuleIdentifier(fact, inst).hashCode();
+        assertEquals(hash, new ModuleIdentifier("factory", "instance").hashCode());
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals( new ModuleIdentifier("factory", "instance").toString(),
+                new ModuleIdentifier("factory", "instance").toString());
+    }
+}
index 1809e458606bd928d7e68ffe83bef287e1736be2..30712c966dfdb1c5b61109f043ce552039b1d084 100644 (file)
@@ -3,11 +3,14 @@ package org.opendaylight.controller.config.api;
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertTrue;
 import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertThat;
 import static org.junit.matchers.JUnitMatchers.containsString;
 
 import com.google.common.collect.Lists;
 import java.util.Map;
+
+import org.junit.Assert;
 import org.junit.Test;
 
 public class ValidationExceptionTest {
@@ -51,4 +54,107 @@ public class ValidationExceptionTest {
         }
         fail("Duplicate exception should have failed");
     }
+
+    @Test
+    public void testGetTrace() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp = new ValidationException.ExceptionMessageWithStackTrace();
+        exp.setTrace("trace");
+        Assert.assertEquals(exp.getTrace(), "trace");
+    }
+
+    @Test
+    public void testSetMessage() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp = new ValidationException.ExceptionMessageWithStackTrace();
+        exp.setMessage("message");
+        Assert.assertEquals(exp.getMessage(), "message");
+    }
+
+    @Test
+    public void testHashCode() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp = new ValidationException.ExceptionMessageWithStackTrace();
+        Assert.assertEquals(exp.hashCode(), new ValidationException.ExceptionMessageWithStackTrace().hashCode());
+    }
+
+    @Test
+    public void testExceptionMessageWithStackTraceConstructor() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        Assert.assertEquals(exp, exp);
+    }
+
+    @Test
+    public void testExceptionMessageWithStackTraceConstructor2() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        Assert.assertNotEquals(exp, null);
+    }
+
+    @Test
+    public void testExceptionMessageWithStackTraceConstructor3() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        Assert.assertNotEquals(exp, new Exception());
+    }
+
+    @Test
+    public void testExceptionMessageWithStackTraceConstructor4() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        Assert.assertEquals(exp, new ValidationException.ExceptionMessageWithStackTrace("string1", "string2"));
+    }
+
+    @Test
+    public void testEqual() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        ValidationException.ExceptionMessageWithStackTrace exp2 =
+                new ValidationException.ExceptionMessageWithStackTrace(null, "string2");
+        Assert.assertNotEquals(exp, exp2);
+    }
+
+    @Test
+    public void testEqual2() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        ValidationException.ExceptionMessageWithStackTrace exp2 =
+                new ValidationException.ExceptionMessageWithStackTrace("different", "string2");
+        Assert.assertNotEquals(exp, exp2);
+    }
+
+
+    @Test
+    public void testEqual3() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        ValidationException.ExceptionMessageWithStackTrace exp2 =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", null);
+        Assert.assertNotEquals(exp, exp2);
+    }
+
+    @Test
+    public void testEqual4() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        ValidationException.ExceptionMessageWithStackTrace exp2 =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "different");
+        Assert.assertNotEquals(exp, exp2);
+    }
+
+    @Test
+    public void testEqual5() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace(null, "string2");
+        ValidationException.ExceptionMessageWithStackTrace exp2 =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        Assert.assertNotEquals(exp, exp2);
+    }
+
+    @Test
+    public void testEqual6() throws Exception {
+        ValidationException.ExceptionMessageWithStackTrace exp =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", null);
+        ValidationException.ExceptionMessageWithStackTrace exp2 =
+                new ValidationException.ExceptionMessageWithStackTrace("string1", "string2");
+        Assert.assertNotEquals(exp, exp2);
+    }
 }
\ No newline at end of file
diff --git a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/CommitStatusTest.java b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/CommitStatusTest.java
new file mode 100644 (file)
index 0000000..36ebc9d
--- /dev/null
@@ -0,0 +1,63 @@
+package org.opendaylight.controller.config.api.jmx;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.management.ObjectName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CommitStatusTest {
+    List newInst = new ArrayList<ObjectName>();
+    List reusedInst = new ArrayList<ObjectName>();
+    List recreatedInst = new ArrayList<ObjectName>();
+
+    @Before
+    public void setUp() throws Exception {
+        newInst.add(new ObjectName("domain: key1 = value1 , key2 = value2"));
+        reusedInst.add(new ObjectName("o2: key = val"));
+        recreatedInst.add(new ObjectName("o3: key = k"));
+    }
+    @Test
+    public void testCommitStatus() throws Exception {
+        CommitStatus status = new CommitStatus(newInst, reusedInst, recreatedInst);
+        Assert.assertEquals(status.getNewInstances(), newInst);
+        Assert.assertEquals(status.getRecreatedInstances(), recreatedInst);
+        Assert.assertEquals(status.getReusedInstances(), reusedInst);
+    }
+
+    @Test
+    public void testEqual() throws Exception {
+        CommitStatus status = new CommitStatus(newInst, reusedInst, recreatedInst);
+        Assert.assertEquals(status, new CommitStatus(newInst, reusedInst, recreatedInst));
+        Assert.assertEquals(status.toString(), new CommitStatus(newInst, reusedInst, recreatedInst).toString());
+        Assert.assertEquals(status, status);
+    }
+
+    @Test
+    public void testHashCode() throws Exception {
+        CommitStatus status = new CommitStatus(newInst, reusedInst, recreatedInst);
+        Assert.assertEquals(status.hashCode(), new CommitStatus(newInst, reusedInst, recreatedInst).hashCode());
+    }
+
+    @Test
+    public void testNotEqual() throws Exception {
+        List newInst2 = new ArrayList<ObjectName>();
+        List reusedInst2 = new ArrayList<ObjectName>();
+        List recreatedInst2 = new ArrayList<ObjectName>();
+
+        newInst2.add(new ObjectName("first: key1 = value1"));
+        reusedInst2.add(new ObjectName("second: key = val"));
+        recreatedInst2.add(new ObjectName("third: key = k"));
+
+        CommitStatus status = new CommitStatus(newInst, reusedInst, recreatedInst);
+        Assert.assertNotEquals(status, null);
+        Assert.assertNotEquals(status, new Object());
+        Assert.assertNotEquals(status, new CommitStatus(newInst2, reusedInst, recreatedInst));
+        Assert.assertNotEquals(status, new CommitStatus(newInst, reusedInst2, recreatedInst));
+        Assert.assertNotEquals(status, new CommitStatus(newInst, reusedInst, recreatedInst2));
+
+        CommitStatus status2 = new CommitStatus(newInst, reusedInst, recreatedInst);
+    }
+}
diff --git a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/ConfigRegistryConstantsTest.java b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/ConfigRegistryConstantsTest.java
new file mode 100644 (file)
index 0000000..e19211d
--- /dev/null
@@ -0,0 +1,13 @@
+package org.opendaylight.controller.config.api.jmx;
+
+
+import org.junit.Test;
+import org.opendaylight.controller.config.api.jmx.constants.ConfigRegistryConstants;
+
+public class ConfigRegistryConstantsTest {
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCreateON() throws Exception {
+        ConfigRegistryConstants.createON("test.<:", "asd", "asd");
+    }
+}
index d3d8469dfba7b0409a0c7738be2b43ca76f4a57b..02c1c4b9815ff55843e1abb74e99b0b529d48349 100644 (file)
@@ -14,6 +14,8 @@ import static org.junit.Assert.assertTrue;
 
 import com.google.common.base.Throwables;
 import com.google.common.collect.Maps;
+
+import java.util.HashMap;
 import java.util.Map;
 import javax.management.ObjectName;
 import junit.framework.Assert;
@@ -159,4 +161,15 @@ public class ObjectNameUtilTest {
 
         fail(test + " should have failed on " + ex);
     }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCreateON() throws Exception {
+        ObjectNameUtil.createON(">}+!#");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCreateON2() throws Exception {
+        Map<String, String> map = new HashMap<>();
+        ObjectNameUtil.createON(">}+!#", map);
+    }
 }