⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netbpmcontainertest.cs

📁 工作流的基本资料(文档资料
💻 CS
字号:
using System.Collections;
using Castle.Windsor.Configuration.Interpreters;
using NetBpm.Util.Client;
using NetBpm.Workflow.Definition.EComp;
using NUnit.Framework;

namespace NetBpm.Test.Workflow
{
	[TestFixture]
	public class NetBpmContainerTest
	{
		[Test]
		public void ContainerStressTest()
		{
			for (int i=1;i<5;i++)
			{
				//configure the container
				NetBpmContainer container = new NetBpm.NetBpmContainer(new XmlInterpreter(TestHelper.GetConfigDir()+"app_config.xml"));
				IDefinitionSessionLocal definitionComponent = null;

				definitionComponent = container["DefinitionSession"] as IDefinitionSessionLocal;
				IList definitions = definitionComponent.GetProcessDefinitions(null);

				Assert.IsNotNull(definitions);

				ServiceLocator.Instance.Release(definitionComponent);
				container.Dispose();
				container=null;
			}
		}

		[Test]
		public void ServiceLocatorStressTest()
		{
			for (int i=1;i<5;i++)
			{
				//configure the container
				NetBpmContainer container = new NetBpm.NetBpmContainer(new XmlInterpreter(TestHelper.GetConfigDir()+"app_config.xml"));
				IDefinitionSessionLocal definitionComponent = null;

				definitionComponent = ServiceLocator.Instance.GetService(typeof (IDefinitionSessionLocal)) as IDefinitionSessionLocal;
				IList definitions = definitionComponent.GetProcessDefinitions(null);

				Assert.IsNotNull(definitions);

				ServiceLocator.Instance.Release(definitionComponent);
				container.Dispose();
				container=null;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -