Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
	public Sample1() {
		addExtensionContextConfigLocation("com/bstek/dorado/core/context.xml");
		addExtensionContextConfigLocation("com/bstek/dorado/config/context.xml");
		addExtensionContextConfigLocation("com/bstek/dorado/common/context.xml");
		addExtensionContextConfigLocation("com/bstek/dorado/data/context.xml");
		addExtensionContextConfigLocation("com/bstek/dorado/view/context.xml");
		addExtensionContextConfigLocation("com/bstek/dorado/web/context.xml");
		
		PackageConfigurer configure = new CoreContextLocationConfigurer();
		addAddonConfigs(configure);
		configure = new OrmContextLocationConfigurer();
		addAddonConfigs(configure);
		/* 如果包含uflo,则需要加载如下的资源
		loadConfigureProperties("bdf2-uflo.properties");
		loadConfigureProperties("uflo-client.properties");
		loadConfigureProperties("uflo-console.properties");

		addExtensionContextConfigLocation("uflo-context-configs.xml");		
		addExtensionContextConfigLocation("uflo-console-configs.xml");		
		addExtensionContextConfigLocation("uflo-client-configs.xml");
		*/
		addExtensionContextConfigLocation("com/bstek/dorado/sample/test-context.xml");//要根据实际test-context.xml文件的路径设置
	}

另外bdf默认自动加载classes下的datasources.xml,单元测试时需要把datasources.xml文件复制到classes或直接放在src目录下

具体看附件

Sample1.java

另外如果系统引入了uflo,则还需要做一个EnvironmentProvider的实现类,参考类:

...