Package org.soybeanMilk.core.bean

Examples of org.soybeanMilk.core.bean.GenericConvertException


    src.put("name", name);
    src.put("age", age);
    src.put("birth", birth);
    src.put("illegalProperty", "1");
   
    GenericConvertException re=null;
   
    try
    {
      converter.convert(src, JavaBean.class);
    }
    catch(GenericConvertException e)
    {
      re=e;
    }
   
    Assert.assertTrue( re.getMessage().startsWith("can not find property \"illegalProperty\"") );
  }
View Full Code Here


  }
 
  @Test
  public void convert_requestToTarget_noConverter() throws Exception
  {
    GenericConvertException re=null;
   
    try
    {
      converter.convert(new MockHttpServletRequest(), JavaBean.class);
    }
    catch(GenericConvertException e)
    {
      re=e;
    }
   
    Assert.assertTrue( (re.getMessage().startsWith("can not find Converter for converting")) );
  }
View Full Code Here

  }
 
  @Test
  public void convert_sessionToTarget_noConverter() throws Exception
  {
    GenericConvertException re=null;
   
    try
    {
      converter.convert(new MockHttpServletRequest().getSession(), JavaBean.class);
    }
    catch(GenericConvertException e)
    {
      re=e;
    }
   
    Assert.assertTrue( (re.getMessage().startsWith("can not find Converter for converting")) );
  }
View Full Code Here

  }
 
  @Test
  public void convert_servletContextToTarget_noConverter() throws Exception
  {
    GenericConvertException re=null;
   
    try
    {
      converter.convert(new MockServletContext(), JavaBean.class);
    }
    catch(GenericConvertException e)
    {
      re=e;
    }
   
    Assert.assertTrue( (re.getMessage().startsWith("can not find Converter for converting")) );
  }
View Full Code Here

  }
 
  @Test
  public void convert_responseToTarget_noConverter() throws Exception
  {
    GenericConvertException re=null;
   
    try
    {
      converter.convert(new MockHttpServletResponse(), JavaBean.class);
    }
    catch(GenericConvertException e)
    {
      re=e;
    }
   
    Assert.assertTrue( (re.getMessage().startsWith("can not find Converter for converting")) );
  }
View Full Code Here

  }
 
  @Test
  public void convert_objectSourceToTarget_noConverter() throws Exception
  {
    GenericConvertException re=null;
   
    try
    {
      converter.convert(new DefaultWebObjectSource(), JavaBean.class);
    }
    catch(GenericConvertException e)
    {
      re=e;
    }
   
    Assert.assertTrue( (re.getMessage().startsWith("can not find Converter for converting")) );
  }
View Full Code Here

    else if(typeObj instanceof Type)
    {
      result=(Type)typeObj;
    }
    else
      throw new GenericConvertException("illegal custom target type "+SbmUtils.toString(typeObj)+" with key "+SbmUtils.toString(KEY_CUSTOM_ELEMENT_CLASSES)+" in Map "+SbmUtils.toString(map));
   
    return (result == null ? defaultType : result);
  }
View Full Code Here

TOP

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

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.