在 Eclipse 中运行 JUnit 集成测试时,我在类路径上有两个 persistence.xml 文件——一个包含测试用例的配置,另一个包含生产。我需要找到一种方法从测试类路径中排除用于生产的 persistence.xml。
约束:我不允许使用 Maven 或 Ant,只能使用 Eclipse Helios SR1(带有 JUnit)。JPA 2 持久性提供程序是 EclipseLink 2.2.0。由于我必须将 ClearCase 7.0 用作 VCS,因此无法链接资源,例如此处所述。
这是粗略的项目结构:
project-datamodel (containing the Entity beans)
\- src/resources/META-INF/persistence.xml (for production; want to exclude it)
\- test/resources/META-INF/persistence.xml (for test)
project-service (containing the Session beans)
\- ejbModule
project-service-it (containing the JUnit integration tests for the Session beans)
\- test