Examples of withArgument()


Examples of jfun.yan.Component.withArgument()

  public void testHashmapComponent(){
    final Container yan = createYanContainer();
    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    yan.registerComponent("target", Components.hashmap(
        new String[]{"first", "second", "third"},
        new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
            newAvenue.withArgument(0, Components.value("Lincoln")),
            newAvenue.withArgument(0, Components.value("Fullerton"))}
        )
    );
    assertEquals(java.util.LinkedHashMap.class, yan.verifyType(HashMap.class));
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    final Container yan = createYanContainer();
    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    yan.registerComponent("target", Components.hashmap(
        new String[]{"first", "second", "third"},
        new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
            newAvenue.withArgument(0, Components.value("Lincoln")),
            newAvenue.withArgument(0, Components.value("Fullerton"))}
        )
    );
    assertEquals(java.util.LinkedHashMap.class, yan.verifyType(HashMap.class));
    final HashMap hmap = (HashMap)yan.getInstanceOfType(java.util.Map.class);
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    yan.registerComponent("target", Components.hashmap(
        new String[]{"first", "second", "third"},
        new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
            newAvenue.withArgument(0, Components.value("Lincoln")),
            newAvenue.withArgument(0, Components.value("Fullerton"))}
        )
    );
    assertEquals(java.util.LinkedHashMap.class, yan.verifyType(HashMap.class));
    final HashMap hmap = (HashMap)yan.getInstanceOfType(java.util.Map.class);
    verifyLinkedHashMap((LinkedHashMap)hmap);
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    final Container yan = createYanContainer();
    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    try{
      yan.registerComponent("target", Components.hashmap(
          new String[]{"first", "second"},
          new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
              newAvenue.withArgument(0, Components.value("Lincoln")),
              newAvenue.withArgument(0, Components.value("Fullerton"))}
          )
      );
      fail("should have failed");
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    try{
      yan.registerComponent("target", Components.hashmap(
          new String[]{"first", "second"},
          new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
              newAvenue.withArgument(0, Components.value("Lincoln")),
              newAvenue.withArgument(0, Components.value("Fullerton"))}
          )
      );
      fail("should have failed");
    }
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    try{
      yan.registerComponent("target", Components.hashmap(
          new String[]{"first", "second"},
          new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
              newAvenue.withArgument(0, Components.value("Lincoln")),
              newAvenue.withArgument(0, Components.value("Fullerton"))}
          )
      );
      fail("should have failed");
    }
    catch(IllegalArgumentException e){
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    final Container yan = createYanContainer();
    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    //try{
      yan.registerComponent("target", Components.hashmap(
          new String[]{"first", "second", "second"},
          new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
              newAvenue.withArgument(0, Components.value("Lincoln")),
              newAvenue.withArgument(0, Components.value("Fullerton"))}
          )
      );
      //fail("should have failed");
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    final Component newAvenue = Components.static_method(Avenue.class, "instance");
    //try{
      yan.registerComponent("target", Components.hashmap(
          new String[]{"first", "second", "second"},
          new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
              newAvenue.withArgument(0, Components.value("Lincoln")),
              newAvenue.withArgument(0, Components.value("Fullerton"))}
          )
      );
      //fail("should have failed");
    //}
View Full Code Here

Examples of jfun.yan.Component.withArgument()

    //try{
      yan.registerComponent("target", Components.hashmap(
          new String[]{"first", "second", "second"},
          new Creator[]{newAvenue.withArgument(0, Components.value("Randolph")),
              newAvenue.withArgument(0, Components.value("Lincoln")),
              newAvenue.withArgument(0, Components.value("Fullerton"))}
          )
      );
      //fail("should have failed");
    //}
    //catch(IllegalArgumentException e){
View Full Code Here

Examples of jfun.yan.Component.withArgument()

      yan.getInstance("target");
      //fail("should have failed with IrresolveableArgumentException");
    //}
    //catch(IrresolveableArgumentException e){}
    //assertEquals(10, result.size());
    yan.registerComponent("list", c1.withArgument(0,
        Components.useArgument(Functions.ctor(
            ArrayList.class, new Class[]{int.class}), 0, int.class)));
    yan.registerComponent("target", Components.useKey("list").seal()
        .withArgument(0, Components.value(12)));
    //try{
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.