Examples of registerValue()


Examples of jfun.yan.Container.registerValue()

    }*/
    final Container base = new ManualContainer();
    base.registerValue("modulename", module_name);
    base.registerValue("timestamp", new Long(System.currentTimeMillis()));
    base.registerValue("classloader", loader);
    base.registerValue("container", yan);
    final NutsProcessor cinterpreter = new NutsProcessor();
    //cinterpreter.setParameterWiring(Modes.params_bytype);
    try{
      cinterpreter.processResource(appcontext_resource);
    }
View Full Code Here

Examples of jfun.yan.Container.registerValue()

    //final BeanPostProcessorQueue bppq = new BeanPostProcessorQueue();
    //nuts.registerValue(newBeanLifecycle(manager));
    //nuts.registerValue(ctxt);
    //nuts.registerValue(yan);
    //nuts.registerValue(bppq);
    nuts.registerValue(new SpringService(ctxt, manager));
    final String resource = nuts_resource;
    try{
      spring.processResource(resource);
    }
    catch(IOException e){
View Full Code Here

Examples of jfun.yan.Container.registerValue()

        fail("should have failed with UnresolvedComponentException");
      }
      catch(UnresolvedComponentException e){
        assertEquals(String.class, e.getComponentKey());
      }
      yan2.registerValue("target arrived!");
      assertEquals("target arrived!", yan.getInstance("target"));
    }
    public void testLifeycles()
    throws Throwable{
      final Container yan = new DefaultContainer();
View Full Code Here

Examples of jfun.yan.Container.registerValue()

      }
      catch(UnresolvedComponentException e){
        assertEquals("badkey", e.getComponentKey());
        yan.unregisterComponent("use_bad");
      }
      yan.registerValue(char.class, new Character('a'));
      yan.registerComponent("use_badtype",
          Components.useType(createYanContainer(), char.class));
      try{
        yan.verify();
        fail("should have failed with UnresolvedComponentException");
View Full Code Here

Examples of jfun.yan.Container.registerValue()

      run_testBadUseContainerForProperties(yan1, yan2);
    }
    public void testUseAll(){
      final Container yan = createYanContainer();
      yan.registerComponent("target", Components.useAll(String.class));
      yan.registerValue("abc");
      yan.registerValue("yet another", "cde");
      yan.verify();
      final java.util.List strs = (java.util.List)yan.getInstance("target");
      assertEquals(2, strs.size());
      assertEquals("abc", strs.get(0));
View Full Code Here

Examples of jfun.yan.Container.registerValue()

    }
    public void testUseAll(){
      final Container yan = createYanContainer();
      yan.registerComponent("target", Components.useAll(String.class));
      yan.registerValue("abc");
      yan.registerValue("yet another", "cde");
      yan.verify();
      final java.util.List strs = (java.util.List)yan.getInstance("target");
      assertEquals(2, strs.size());
      assertEquals("abc", strs.get(0));
      assertEquals("cde", strs.get(1));
View Full Code Here

Examples of jfun.yan.Container.registerValue()

    public void testUseAllInDifferentContainer(){
      final Container yan = createYanContainer();
      final Container yan2 = createYanContainer();
      yan.registerComponent("target", Components.useAll(yan2, String.class));
      yan.verify();
      yan2.registerValue("abc");
      yan.registerValue("yet another", "cde");
      yan.verify();
      final java.util.List strs = (java.util.List)yan.getInstance("target");
      assertEquals(1, strs.size());
      assertEquals("abc", strs.get(0));
View Full Code Here

Examples of jfun.yan.Container.registerValue()

        assertEntry(e, 1, "cast <useKey <xxx>> as java.lang.String");
        assertEntry(e, 2, "returnVerification <cast <useKey <xxx>> as java.lang.String>");
        assertEntry(e, 3, "getInstance <class java.lang.Class>");
        assertEquals("xxx", e.getComponentKey());
      }
      yan.registerValue("xxx",
          Components.useKey("bad").subsume(int.class).incomplete());
      yan.verify();
      assertEquals(String.class, yan.getInstance(Class.class));
    }
View Full Code Here

Examples of jfun.yan.Container.registerValue()

      }
    }
    public void testBeanByName()
    throws Exception{
      final Container yan = createYanContainer();
      yan.registerValue("dog", "Bach");
      //yan.registerValue("cat", "Chopin");
      yan.registerComponent("civilian", Beans.byName(
          Components.ctor(Civilian.class)         
          .withDefaultArgument(0, Components.value(new Integer(-1)))
          //.optionalParameter(0)
View Full Code Here

Examples of jfun.yan.Container.registerValue()

    }
    public void testBeanByQualifiedName()
    throws Exception{
      try{
        final Container yan = createYanContainer();
        yan.registerValue("tests.jfun.yan.tck.BaseContainerTestCase$Civilian.dog", "Bach");
        yan.registerValue("tests.jfun.yan.tck.BaseContainerTestCase$Civilian.cat", "Chopin");
        yan.registerComponent("civilian", Beans.byQualifiedName(
            Components.ctor(Civilian.class)         
            .withDefaultArgument(0, Components.value(new Integer(-1)))
            .optionalParameters()
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.