Package org.soybeanMilk.core.bean

Examples of org.soybeanMilk.core.bean.MapConvertException


    src.put("id", id);
    src.put("name", name);
   
    src.put("simpleArray", simpleCollectionProperty);
   
    MapConvertException re=null;
    try
    {
      converter.convert(src, ComplexJavaBean.class);
    }
    catch(MapConvertException e)
    {
      re=e;
    }
   
    Assert.assertEquals("simpleArray", re.getKey());
    Assert.assertEquals("illegalValue", re.getSourceObject());
    Assert.assertEquals(Integer.class, re.getTargetType());
  }
View Full Code Here


    src.put("simpleSet", simpleCollectionProperty);
   
    src.put("javaBean2List.id", cmplexCollectionProperty_id);
    src.put("javaBean2List.name", cmplexCollectionProperty_name);
   
    MapConvertException re=null;
    try
    {
      converter.convert(src, ComplexJavaBean.class);
    }
    catch(MapConvertException e)
    {
      re=e;
    }
   
    Assert.assertEquals("javaBean2List.id", re.getKey());
    Assert.assertEquals("illegalValue", re.getSourceObject());
    Assert.assertEquals(int.class, re.getTargetType());
  }
View Full Code Here

    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.simpleArray.0", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.simpleArray.0", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(Integer.class, re.getTargetType());
    }
   
    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.simpleList.0", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.simpleList.0", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(Integer.class, re.getTargetType());
    }
   
    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.simpleSet.0", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.simpleSet.0", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(Integer.class, re.getTargetType());
    }

    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.simpleMap.key", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.simpleMap.key", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(Integer.class, re.getTargetType());
    }
   
    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.javaBean2Array.0.id", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.javaBean2Array.0.id", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(int.class, re.getTargetType());
    }
   
    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.javaBean2List.0.id", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.javaBean2List.0.id", re.getKey());
      Assert.assertEquals("illegalValue",re.getSourceObject());
      Assert.assertEquals(int.class, re.getTargetType());
    }
   
    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.javaBean2Set.0.id", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.javaBean2Set.0.id", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(int.class, re.getTargetType());
    }
   
    {
      Map<String,Object> src=new HashMap<String, Object>();
     
      src.put("0.javaBean2Map.0.id", "illegalValue");
     
      MapConvertException re=null;
      try
      {
        converter.convert(src, ComplexJavaBean[].class);
      }
      catch(MapConvertException e)
      {
        re=e;
      }
     
      Assert.assertEquals("0.javaBean2Map.0.id", re.getKey());
      Assert.assertEquals("illegalValue", re.getSourceObject());
      Assert.assertEquals(int.class, re.getTargetType());
    }
  }
View Full Code Here

    src.put("id", id);
    src.put("name", name);
   
    src.put("simpleArray", simpleCollectionProperty);
   
    MapConvertException re=null;
    try
    {
      converter.convert(src, ComplexJavaBean.class);
    }
    catch(MapConvertException e)
    {
      re=e;
    }
   
    Assert.assertEquals("simpleArray", re.getKey());
    Assert.assertEquals("illegalValue", re.getSourceObject());
    Assert.assertEquals(Integer.class, re.getTargetType());
  }
View Full Code Here

TOP

Related Classes of org.soybeanMilk.core.bean.MapConvertException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.