Exemplo n.º 1
0
        public BugHistoryProvider()
        {
            this.configuration = BugConfigurationView.Instance.Configuration;

            this.ibatisMapping = this.configuration.Keys["IBatisMapping"].Value;

            this.ibatisMapper = ISqlMapHelper.CreateSqlMapper(this.ibatisMapping, true);
        }
Exemplo n.º 2
0
        public BugHistoryService()
        {
            this.configuration = BugConfigurationView.Instance.Configuration;

            // 创建对象构建器(Spring.NET)
            string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(BugConfiguration.ApplicationName, springObjectFile);

            // 创建数据提供器
            this.provider = objectBuilder.GetObject <IBugHistoryProvider>(typeof(IBugHistoryProvider));
        }
        public void TestCreateMapper()
        {
            BugConfiguration configuration = BugConfigurationView.Instance.Configuration;

            ISqlMapper ibatisMapper = null;

            string ibatisMapping = configuration.Keys["IBatisMapping"].Value;

            ibatisMapper = ISqlMapHelper.CreateSqlMapper(ibatisMapping, true);

            Assert.IsNotNull(ibatisMapper);
        }
Exemplo n.º 4
0
        /// <summary>重新加载</summary>
        private void Reload()
        {
            if (this.restartCount > 0)
            {
                // 重新加载配置信息
                BugConfigurationView.Instance.Reload();
            }

            this.configuration = BugConfigurationView.Instance.Configuration;

            // 创建对象构建器(Spring.NET)
            string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(BugConfiguration.ApplicationName, springObjectFile);

            // 创建数据服务对象
            this.m_BugService         = objectBuilder.GetObject <IBugService>(typeof(IBugService));
            this.m_BugCategoryService = objectBuilder.GetObject <IBugCategoryService>(typeof(IBugCategoryService));
            this.m_BugCommentService  = objectBuilder.GetObject <IBugCommentService>(typeof(IBugCommentService));
            this.m_BugHistoryService  = objectBuilder.GetObject <IBugHistoryService>(typeof(IBugHistoryService));
        }
        public void TestInit()
        {
            BugConfiguration configuration = BugConfigurationView.Instance.Configuration;

            Assert.IsNotNull(configuration);
        }