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

📄 abstracttest.cs

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

namespace NetBpm.Test.Workflow.Example
{
	// TODO refacture AbstractEcample Testcase and this class

	public abstract class AbstractTest
	{
		protected internal ServiceLocator servicelocator = null;
		protected internal IDefinitionSessionLocal definitionComponent = null;
		protected internal IExecutionSessionLocal executionComponent = null;
		protected internal ISchedulerSessionLocal schedulerComponent = null;
		protected internal IOrganisationSessionLocal organisationComponent = null;
		protected internal TestUtil testUtil = null;
		private NetBpmContainer _container = null;

//		[TestFixtureSetUp]
		[SetUp]
		public void SetUp()
		{
			SetContainer();
		}

//		[TestFixtureTearDown]
		[TearDown]
		public void TearDown()
		{
			DisposeContainer();
		}

		public void SetContainer()
		{
			//configure the container
			_container = new NetBpmContainer(new XmlInterpreter(TestHelper.GetConfigDir()+"app_config.xml"));
			testUtil = new TestUtil();
			servicelocator = ServiceLocator.Instance;
			definitionComponent = servicelocator.GetService(typeof (IDefinitionSessionLocal)) as IDefinitionSessionLocal;
			executionComponent = servicelocator.GetService(typeof (IExecutionSessionLocal)) as IExecutionSessionLocal;
			schedulerComponent = servicelocator.GetService(typeof (ISchedulerSessionLocal)) as ISchedulerSessionLocal;
			organisationComponent = servicelocator.GetService(typeof (IOrganisationSessionLocal)) as IOrganisationSessionLocal;
			testUtil.LoginUser("ae");
		}

		public void DisposeContainer()
		{	
			servicelocator.Release(definitionComponent);
			definitionComponent=null;
			servicelocator.Release(executionComponent);
			executionComponent=null;
			servicelocator.Release(schedulerComponent);
			schedulerComponent=null;
			servicelocator.Release(organisationComponent);
			organisationComponent=null;

			_container.Dispose();
			_container = null;
		}
	}
}

⌨️ 快捷键说明

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