+ public void testConvertEmptyArrayToObjectSpliterator() throws Exception
+ {
+ try
+ {
+ SimpleMapper.getObjectSpliterator(get("/array/empty/1.json"));
+ fail("it must not be possible, to get an object-spliterator for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.getObjectSpliterator(get("/array/empty/2.json"));
+ fail("it must not be possible, to get an object-spliterator for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.getObjectSpliterator(get("/array/empty/3.json"));
+ fail("it must not be possible, to get an object-spliterator for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.getObjectSpliterator(get("/array/empty/4.json"));
+ fail("it must not be possible, to get an object-spliterator for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testConvertEmptyArrayToMap() throws Exception
+ {
+ try
+ {
+ SimpleMapper.convertObject(get("/array/empty/1.json"));
+ fail("it must not be possible, to get a map for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.convertObject(get("/array/empty/2.json"));
+ fail("it must not be possible, to get a map for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.convertObject(get("/array/empty/3.json"));
+ fail("it must not be possible, to get a map for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.convertObject(get("/array/empty/4.json"));
+ fail("it must not be possible, to get a map for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testConvertEmptyArray() throws Exception
+ {
+ Object object;
+
+ object = SimpleMapper.convert(get("/array/empty/1.json"));
+ assertNotNull(object);
+ assertTrue("the returned object should be a list", object instanceof List);
+ assertEquals(0, ((List)object).size());
+ object = SimpleMapper.convert(get("/array/empty/2.json"));
+ assertNotNull(object);
+ assertTrue("the returned object should be a list", object instanceof List);
+ assertEquals(0, ((List)object).size());
+ object = SimpleMapper.convert(get("/array/empty/3.json"));
+ assertNotNull(object);
+ assertTrue("the returned object should be a list", object instanceof List);
+ assertEquals(0, ((List)object).size());
+ object = SimpleMapper.convert(get("/array/empty/4.json"));
+ assertNotNull(object);
+ assertTrue("the returned object should be a list", object instanceof List);
+ assertEquals(0, ((List)object).size());
+ }
+
+
+ @Test
+ public void testConvertEmptyObjectToArraySpliterator() throws Exception
+ {
+ try
+ {
+ SimpleMapper.getArraySpliterator(get("/object/empty/1.json"));
+ fail("it must not be possible, to get an array-spliterator for an object");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.getArraySpliterator(get("/object/empty/2.json"));
+ fail("it must not be possible, to get an array-spliterator for an object");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.getArraySpliterator(get("/object/empty/3.json"));
+ fail("it must not be possible, to get an array-spliterator for an object");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.getArraySpliterator(get("/object/empty/4.json"));
+ fail("it must not be possible, to get an array-spliterator for an object");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testConvertEmptyObjectToList() throws Exception
+ {
+ try
+ {
+ SimpleMapper.convertArray(get("/object/empty/1.json"));
+ fail("it must not be possible, to get a list for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.convertArray(get("/object/empty/2.json"));
+ fail("it must not be possible, to get a list for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.convertArray(get("/object/empty/3.json"));
+ fail("it must not be possible, to get a list for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+
+ try
+ {
+ SimpleMapper.convertArray(get("/object/empty/4.json"));
+ fail("it must not be possible, to get a list for an array");
+ }
+ catch(IllegalArgumentException e)
+ {
+ LOG.info(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testConvertEmptyObjectToObjectSpliterator() throws Exception