Package speculoos.beans

Examples of speculoos.beans.MapEntry


  class EntryHandler implements TagHandler {

    public void startElement(String uri, String localName, String qName,
        Attributes attributes) throws SAXException {
      String k = attributes.getValue("key");
      MapEntry e = new MapEntry(k);
      e.setValue(attributes.getValue("val"));
      e.setType(attributes.getValue("type"));
      ((SyntheticMap) current).put(k, e);
    }
View Full Code Here


    assertTrue(im.contains("float getBar ()"));
  }
  */
  public void test03MapWithIfaceBeanAndMapParents() throws IOException {
    SyntheticMap map = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    map.put("toto", me);
    me = new MapEntry("tutuTiti");
    me.setType("int");
    me.setValue("0");
    map.put("tutuTiti", me);
    map.setName("GenTest");
    SyntheticMap par = new SyntheticMap();
    me = new MapEntry("foo");
    me.setType("java.util.List");
    par.put("foo", me);
    me = new MapEntry("bar");
    me.setType("float");
    me.setValue("0.0f");
    par.put("bar", me);
    par.setName("ParentMap");
    map.addInherits(par);
    BeanMap bean = new BeanMap(IPersonne.class);
    map.addInherits(bean);
View Full Code Here

    assertTrue(im.indexOf("public int getChildNumber ()") != -1);
  }
 
  public void test04MapWithConcreteBeanAndMapParents() throws IOException {
    SyntheticMap map = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    map.put("toto", me);
    me = new MapEntry("tutuTiti");
    me.setType("int");
    me.setValue("0");
    map.put("tutuTiti", me);
    map.setName("GenTest");
    SyntheticMap par = new SyntheticMap();
    me = new MapEntry("foo");
    me.setType("java.util.List");
    par.put("foo", me);
    me = new MapEntry("bar");
    me.setType("float");
    me.setValue("0.0f");
    par.put("bar", me);
    par.setName("ParentMap");
    map.addInherits(par);
    BeanMap bean = new BeanMap(Personne.class);
    map.addInherits(bean);
View Full Code Here

  }
 

  public void test05MapWithIfaceBeanHierarchy() throws IOException {
    SyntheticMap map = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    map.put("toto", me);
    me = new MapEntry("tutuTiti");
    me.setType("int");
    me.setValue("0");
    map.put("tutuTiti", me);
    map.setName("GenTest");
    BeanMap bean = new BeanMap(IPersonne.class);
    map.addInherits(bean);
    /* run */
 
View Full Code Here

*/
public class SyntheticMapTest extends TestCase {
 
  public void test01BasicInheritance() {
    SyntheticMap child = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    me.setValue("titi");
    me.setType("tata");
    child.put("toto",me);
    SyntheticMap parent = new SyntheticMap();
    me = new MapEntry("titi");
    me.setValue("null");
    me.setType("titi");
    parent.put("titi",me);
    child.addInherits(parent);
    assertEquals("toto", ((MapEntry)child.get("toto")).getName());
    assertEquals("titi", ((MapEntry)child.get("titi")).getType());
  }
View Full Code Here

    assertEquals("titi", ((MapEntry)child.get("titi")).getType());
  }

  public void test02MultipleInheritance() {
    SyntheticMap child = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    me.setValue("titi");
    me.setType("tata");
    child.put("toto",me);
    SyntheticMap parent = new SyntheticMap();
    me = new MapEntry("titi");
    me.setValue("null");
    me.setType("titi");
    parent.put("titi",me);
    child.addInherits(parent);
    parent = new SyntheticMap();
    me = new MapEntry("foo");
    me.setValue("bar");
    me.setType("baz");
    parent.put("foo",me);
    child.addInherits(parent);
    assertEquals("toto", ((MapEntry)child.get("toto")).getName());
    assertEquals("bar", ((MapEntry)child.get("foo")).getValue());
  }
View Full Code Here

    assertEquals("bar", ((MapEntry)child.get("foo")).getValue());
  }

  public void test03Hierarchy() {
    SyntheticMap child = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    me.setValue("titi");
    me.setType("tata");
    child.put("toto",me);
    SyntheticMap parent = new SyntheticMap();
    me = new MapEntry("titi");
    me.setValue("null");
    me.setType("titi");
    parent.put("titi",me);
    child.addInherits(parent);
    SyntheticMap parent2 = new SyntheticMap();
    me = new MapEntry("foo");
    me.setValue("bar");
    me.setType("baz");
    parent2.put("foo",me);
    parent.addInherits(parent2);
    assertEquals("toto", ((MapEntry)child.get("toto")).getName());
    assertEquals("bar", ((MapEntry)child.get("foo")).getValue());
  }
View Full Code Here

  }

  public void test01SimpleFlatMap() throws IOException {
    this.gen.setName(getName());
    SyntheticMap map = new SyntheticMap();
    MapEntry me = new MapEntry("toto");
    map.put("toto", me);
    me = new MapEntry("tutuTiti");
    me.setType("int");
    me.setValue("0");
    map.put("tutuTiti", me);
    map.setName("GenTest");
    /* run */
    gen.generate(map);
    String ifas = iface.getBuffer().toString();
View Full Code Here

TOP

Related Classes of speculoos.beans.MapEntry

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.