Package org.constretto.model

Examples of org.constretto.model.CObject


  @SuppressWarnings("unchecked")
  @Test
  public void simpleMapConversion() {
    final Map<String, CValue> map = new HashMap<String, CValue>();
    map.put("hei", new CPrimitive("hallo"));
    final Map<String,String> convertedMap = (Map<String,String>) ValueConverterRegistry.convert(String.class, String.class, new CObject(map));

    Assert.assertNotNull(convertedMap);
    Assert.assertTrue(convertedMap.size() == 1);
  }
View Full Code Here


    @Test
  public void mapListConversion() {
    final List<CValue> list = new ArrayList<CValue>();
    final Map<String, CValue> data = new HashMap<String, CValue>();
    data.put("key", new CPrimitive("value"));
    list.add(new CObject(data));

    final List<Map<String, String>> convertedList = (List<Map<String, String>>) ValueConverterRegistry.convert(String.class,
        String.class, new CArray(list));

    Assert.assertNotNull(convertedList);
View Full Code Here

    @Test(expected = ConstrettoException.class)
    public void testConvertUnsopportedClassConversion() {
    final Map<String, CValue> map = new HashMap<String, CValue>();
    map.put("hei", new CPrimitive("hallo"));
    ValueConverterRegistry.convert(getClass(), getClass(), new CObject(map));
    }
View Full Code Here

TOP

Related Classes of org.constretto.model.CObject

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.