Examples of JsonLoader


Examples of org.nutz.ioc.loader.json.JsonLoader

public class JsonAopConfigrationTest {

    @Test
    public void test_jsonAop(){
        Ioc ioc = new NutIoc(new JsonLoader("org/nutz/ioc/aop/config/impl/jsonfile-aop.js"));
        Assert.assertTrue(ioc.getNames().length > 0);
        for (String name : ioc.getNames()) {
            ioc.get(null, name);
        }
        MyMI mi = ioc.get(MyMI.class, "myMI");
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

        if (null == nut) {
            synchronized (Nutzs.class) {
                nut = nuts.get(key);
                try {
                    if (null == nut) {
                        nut = new NutIoc(new JsonLoader(key));
                        nuts.put(key, nut);
                    }
                }
                catch (Exception e) {
                    throw Lang.wrapThrow(e);
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

        assertEquals(0, f.getDeposeTime());
    }

    @Test
    public void test_event_from_parent() {
        Ioc ioc = new NutIoc(new JsonLoader("org/nutz/ioc/json/events.js"));
        Animal f = ioc.get(Animal.class, "fox");
        assertEquals(1, f.getCreateTime());
        assertEquals(1, f.getFetchTime());
        assertEquals(0, f.getDeposeTime());
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

public class AopJsonIocTest {

    @Test
    public void test_simple() {
      DefaultClassDefiner.reset();
        IocLoader il = new JsonLoader("org/nutz/ioc/json/aop.js");
        Ioc ioc = new NutIoc(il);
        StringBuilder sb = ioc.get(StringBuilder.class, "sb");
        Mammal fox = ioc.get(Mammal.class, "fox");

        assertEquals("Fox", fox.getName());
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

        pluginManager.get();
    }
   
    @Test
    public void test_get_plugin_from_ioc(){
        Ioc ioc = new NutIoc(new JsonLoader("org/nutz/plugin/plugin.js"));
        PluginManager<Log> manager = new IocPluginManager<Log>(ioc, "pluB","pluA","pluC");
        assertNotNull(manager.get());
        assertTrue(manager.get() instanceof SystemLogAdapter);
    }
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

        assertTrue(f == f.getAnother());
    }

    @Test
    public void test_null_json_file() {
        IocLoader loader = new JsonLoader("org/nutz/ioc/json/empty.js");
        Ioc ioc = new NutIoc(loader);
        assertEquals(0, ioc.getNames().length);
    }
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

        ioc.get(Animal.class, "f3");
    }

    @Test
    public void test_load_from_dir() throws ObjectLoadException {
        IocLoader loader = new JsonLoader("org/nutz/ioc/json/");
        assertTrue(loader.getName().length > 0);
    }
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

        assertTrue(loader.getName().length > 0);
    }

    @Test
    public void test_load_from_reader() throws ObjectLoadException {
        IocLoader loader = new JsonLoader(Streams.fileInr("org/nutz/ioc/json/main.js"));
        assertTrue(loader.getName().length > 0);
    }
View Full Code Here

Examples of org.nutz.ioc.loader.json.JsonLoader

import org.nutz.mvc.NutConfig;

public class JsonIocProvider implements IocProvider {

    public Ioc create(NutConfig config, String[] args) {
        return new NutIoc(new JsonLoader(args), new ScopeContext("app"), "app");
    }
View Full Code Here

Examples of org.pollux3d.client.JsonLoader

   * @throws JsonMappingException
   * @throws JsonGenerationException
   */
  public static void main(String[] args) throws JsonGenerationException, JsonMappingException, IOException
  {
    JsonLoader loader = new JsonLoader();
    loader.loadSystem();
  }
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.