SoaFuTestAll.HrmStmtest.Create:
Spring.Objects.Factory.UnsatisfiedDependencyException : Error creating object with name 'HrmStmtest' : Unsatisfied dependency expressed through object property 'DbProvider': There are 2 objects of Type [Spring.Data.Common.IDbProvider] for autowire by type, when there should have been just 1 to be able to autowire property 'DbProvider' of object 'HrmStmtest'.
SoaFuTestAll.HrmStmtest.Create:Spring.Objects.Factory.UnsatisfiedDependencyException : Error creating object with name 'HrmStmtest' : Unsatisfied dependency expressed through object property 'DbProvider': There are 2 objects of Type [Spring.Data.Common.IDbProvider] for autowire by type, when there should have been just 1 to be able to autowire property 'DbProvider' of object 'HrmStmtest'.
单元测试报错,高手看一看。
问题补充:
我是有两个Dbprovider,需要连两个数据库
不是单独测试都能通过,
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:tx="http://www.springframework.net/tx"
xmlns:aop="http://www.springframework.net/aop"
xmlns:db="http://www.springframework.net/database"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/schema/objects/spring-objects.xsd
http://www.springframework.net/schema/tx http://www.springframework.net/schema/tx/spring-tx-1.1.xsd
http://www.springframework.net/schema/db http://www.springframework.net/schema/db/spring-database.xsd"
>
<!-- Entity Interceptors -->
<!--<object id="entityInterceptor" type="PaperLess.MES.DAL.Interceptor.UtcDateTimeInterceptor, PaperLess.MES.DAL"/>
<object id="oagisEntityInterceptor" type="PaperLess.OAGIS.DAL.Interceptor.UtcDateTimeInterceptor, PaperLess.OAGIS.DAL"/>-->
<!-- END Entity Interceptors -->
<!-- Database Provider Configuration -->
<object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
<property name="ConfigSections" value="databaseSettings" />
</object>
<!-- END Database Provider Configuration -->
<!-- MES Data Provider Session -->
<db:provider id="DbProvider"
provider="SqlServer-2.0"
connectionString="Data Source=FU;Initial Catalog=Hrm;User ID=sa ;Password=123 ;Trusted_Connection=False;"/>
<object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate20">
<property name="DbProvider" ref="DbProvider" />
<property