【问题标题】:How to deploy WildFly datasource with Arquillian?如何使用 Arquillian 部署 WildFly 数据源?
【发布时间】:2015-06-16 15:45:20
【问题描述】:

我尝试按如下方式部署我的数据源:

@Deployment(name = "test", order=2)
static WebArchive createDeployment() {
    ShrinkWrap.createFromZipFile(WebArchive, new File("target/test.war")).addAsWebInfResource(new File("src/test/resources/test-DS.xml"), "test-DS.xml")
}

但似乎我的数据源被忽略了,我在 jboss 控制台中看不到有关部署的信息。

还有其他可能用 arquillian 部署数据源吗?

@Deployment(name = "datasource", order=1)
static ? createDSDeployment() {
    ?
}

【问题讨论】:

    标签: java jboss integration-testing wildfly-8 jboss-arquillian


    【解决方案1】:

    您可以使用单独的独立*.xml 进行 arquillian 测试并在那里指定您的数据源。例如,在 arquillian.xml 中:

       <configuration>
           ...
           <property name="serverConfig">standalone-test.xml</property>
           ...
       </configuration>
    

    和数据源可以在该独立的&lt;datasources&gt; 部分中描述

    【讨论】:

    • 我试过了,我得到:警告 [org.jboss.arquillian.container.impl.MapObject] 配置包含支持对象 org.jboss.as.arquillian.container.embedded 不支持的属性.EmbeddedContainerConfiguration 未使用的属性条目:{serverConfig=standalone-test.xml} 支持的属性名称:[managementAddress, modulePath, password, bundlePath, managementPort, jbossHome, managementProtocol, cleanServerBaseDir, username]
    • 我有错误的依赖。嵌入而不是托管。 wildfly-arquillian-container-managed
    猜你喜欢
    • 1970-01-01
    • 2013-09-03
    • 1970-01-01
    • 1970-01-01
    • 2019-08-08
    • 2021-03-11
    • 1970-01-01
    • 2016-09-27
    • 2014-07-29
    相关资源
    最近更新 更多