@Test public void test() { A a = (A)context.getBeanObject("a"); System.out.println(); B b = (B)context.getBeanObject("b"); }
@Test public void test() { BaseApplicationContext context = DefaultApplicationContext.getApplicationContext("com/sany/mail/property-mail.xml"); SendMail sendMail = context.getTBeanObject("sendMail", SendMail.class); sendMail.sendTextMail(new String[] {"*****@*****.**"}, "你好", "很好,很强大!"); String content = " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"96\">" + "<tr>" + "<td width=\"24%\" height=\"94\"><a href='http://ippresource.sany.com.cn/qikan/html/2013-04/29/node_1.htm' target='_blank'><img width='80' height='90' border='0' src='uploadfiles/201207/20120731060411867.jpg'></a></td>" + "<td width=\"76%\" valign=\"top\"><div><strong>三一集团报</strong></div>" + "<div><span class=\"red\">三一集团报</span> <a href=\"javascript:void('0')\" onclick=\"showPdf('http://ippresource.sany.com.cn/qikan/html/2013-04/29/node_1.htm')\">浏览</a>|<a href='brands/magazine/default.htm' target='_blank'>更多 >></a></div>" + "<div>做一流企业,办一流企业报。《三一集团》报1999年创刊,它见证记载了三一发展的艰辛和辉煌。</div></td>" + "</tr>" + "</table>"; sendMail.sendHtmlMail(new String[] {"*****@*****.**"}, "你好html", content); sendMail.sendAttach( new String[] {"*****@*****.**"}, "你好html", content, new String[] { "D:\\workspace\\SanyPDP\\resources\\org\\frameworkset\\task\\quarts-task.xml" }); }
@Test public void testFullBBossSerializable() throws Exception { BaseApplicationContext context = DefaultApplicationContext.getApplicationContext("org/frameworkset/soa/xblink/test.xml"); Test1 test1 = context.getTBeanObject("test1", Test1.class); // byte[] cs = oldObjectToByteBuffer(test1) ; String ss = ObjectSerializable.toXML(test1); Test1 test1_ = (Test1) ObjectSerializable.toBean(ss, Test1.class); System.out.println(); }
@Test public void testFullBBossSerializable1() throws Exception { // 加载配置文件,构建一个组件容器对象 BaseApplicationContext context = DefaultApplicationContext.getApplicationContext( "org/frameworkset/soa/xblink/testcontainref.xml"); // 获取组件test1 Test1 test1 = context.getTBeanObject("test1", Test1.class); // 重新将组件序列化为xml串 String ss = ObjectSerializable.toXML(test1); // 将xml串ss转换为对象test_ Test1 test1_ = (Test1) ObjectSerializable.toBean(ss, Test1.class); System.out.println(); }
public static DBInfoEncrypt getDBInfoEncrypt() { try { Properties p = BaseApplicationContext.fillProperties(); if (p != null) { String DBInfoEncryptclass = p.getProperty("DBInfoEncryptclass"); if (DBInfoEncryptclass != null && !DBInfoEncryptclass.trim().equals("")) { DBInfoEncryptclass = DBInfoEncryptclass.trim(); return (DBInfoEncrypt) Class.forName(DBInfoEncryptclass).newInstance(); } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Throwable e) { // TODO Auto-generated catch block e.printStackTrace(); } return new DESDBPasswordEncrypt(); }
@Test public void test1() { context1.getBeanObject("test"); }
public static SapConnectFactory getSapConnectFactory(String factory) { return context.getTBeanObject(factory, SapConnectFactory.class); }