こんにちは私はテストを行うためにこのクラスを持っています:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/service.xml"})
public class Test {
@Autowired private CommonService commonService;
デバッグ中に、SdkDynamicAopProxyである属性hを持つオブジェクトをCommonServiceに取得します。
属性commonService1つのCommonServiceImpオブジェクトを取得するにはどうすればよいですか?
commonService
public interface CommonService {...}
CommonServiceImp
@Service("commonService")
@Transactional("transactionManager")
public class CommonServiceImp implements CommonService {
@Autowired private CommonDaoJdbcImp commonDao; ...}
service.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<import resource="/bbb-dao.xml"/>
<context:component-scan base-package="aaa.bbb.service"/>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" /> -->
<tx:annotation-driven />
<task:annotation-driven />