使用 Arquillian 嵌入 glassfish 配置 - TmpDir
项目: 我正在使用 Arquillian 1.0.0.4-ALPHA 和嵌入式 Glassfish 3.1-b28。我的项目有一个 arquillian.xml、NO domain.xml、一个用于我的数据源的 sun-resources.xml 和一个 persistence.xml。我正在尝试对 EJB3 / JPA2 应用程序进行单元测试。
我已经做了什么: 我的第一个单元测试甚至成功了。但是,当我开始使用 @Deployment 注释和返回 webArchive 的静态方法开发多个类时,就会引发异常。原因是,第一类的 war 文件未正确取消部署,因此无法部署下一个测试文件。我了解到这是一个错误,并升级到较新版本的 glassfish 来解决该错误。
问题: 现在新版本的 glassfish 导致配置问题。我可以通过在 glassfish 中设置 tmpDir 来解决此问题,如下所示:
http://java.net/ jira/browse/EMBEDDED_GLASSFISH-122
现在的问题是,我如何/在哪里设置这些设置? arquillian.xml 似乎不正确。我不想在这种情况下使用domain.xml。最好的是 sun-resources.xml,但这似乎也不合适。 asadmin 没有意义,因为它是自动运行的单元测试。谁能告诉我如何配置?
The project:
I am using Arquillian 1.0.0.4-ALPHA with Embedded Glassfish 3.1-b28. My project has an arquillian.xml, NO domain.xml, a sun-resources.xml for my datasource and a persistence.xml. I am trying to unit test an EJB3 / JPA2 application.
What i already did:
My first unit tests even worked. But as soon as I started to develop more than one class using the @Deployment annotation and the static method that returns the webArchive, an exception was thrown. Reason was, that the war file from the first class wasn't correctly undeployed and so the next test file couldn't get deployed. I read about this being a bug and upgraded to a newer version of glassfish to solve the bug.
The problem:
Now the newer version of glassfish leads to a configuration problem. I could fix this by setting the tmpDir in glassfish like mentioned in here:
http://java.net/jira/browse/EMBEDDED_GLASSFISH-122
The question is now, HOW / WHERE can i set those settings? arquillian.xml doesn't seem to be right. And I don't want to use a domain.xml for that case. Best would be sun-resources.xml, but that doesn't seem to fit, too. asadmin doesn't make sense because its a unit test that runs automatically. Can anyone tell me how to configure that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
arquillian.xml 中的正确条目是:
The correct entry in arquillian.xml is: