Java Code Examples for org.nutz.ioc.impl.NutIoc#get()
The following examples show how to use
org.nutz.ioc.impl.NutIoc#get() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WxsTest.java From nutzwx with Apache License 2.0 | 6 votes |
@Test public void test_ioc_load() throws ClassNotFoundException { // 仿真一个配置文件 PropertiesProxy conf = new PropertiesProxy(); conf.put("weixin.atstore", "jedis"); // 测试jedisAgent存储AccessToken conf.put("weixin.token", "1234567890"); conf.put("weixin.appid", "wx10927e35a365fe1c"); conf.put("weixin.appsecret", "c29accd1784e636d6478eac9b6b3aYYY"); // YYY是假的 conf.put("weixin.openid", "XXX"); // 沙箱测试 // http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index NutIoc ioc = new NutIoc(new ComboIocLoader("*weixin", "*jedis")); ioc.getIocContext().save("app", "conf", new ObjectProxy(conf)); WxApi2 wxApi2 = ioc.get(WxApi2.class); for (int i = 0; i < 6; i++) { wxApi2.get_industry(); } ioc.depose(); }
Example 2
Source File: TestNutz.java From snakerflow with Apache License 2.0 | 4 votes |
@Before public void before() throws ClassNotFoundException { IocLoader loader = new ComboIocLoader("*js", "ioc.js", "*"+SnakerIocLoader.class.getName()); ioc = new NutIoc(loader); engine = ioc.get(SnakerEngine.class); }