使用带有Websphere Liberty Profile 8.5.5.4的arquillian的示例设置

时间:2015-03-25 15:13:40

标签: jboss-arquillian websphere-liberty

我无法获得与WLP 8.5.5.4一起运行的Arquillian测试用例。有没有简单的示例项目向我展示这个?我找不到一个。

1 个答案:

答案 0 :(得分:2)

您可以在此红皮书Configuring and Deploying Open Source with WebSphere Application Server Liberty Profile中找到创建测试服务器的复杂设置。

这里有非常基本的设置:

  • 为WebSphere Liberty配置arquillian.xml文件:

    <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
    
    <engine>
        <property name="deploymentExportPath">target/</property>
    </engine>
    
    <container qualifier="wlp-managed-85" default="true">
        <configuration>
            <property name="wlpHome">C:/IBM/WebSphere/wlp</property>
            <property name="serverName">defaultServer</property>
            <property name="httpPort">9080</property>
            <property name="appDeployTimeout">20</property>
            <property name="appUndeployTimeout">20</property>
        </configuration>
    </container>
    

  • pom.xml

    中配置所需的依赖项
    <!-- Configure WASdev repository -->
    <repositories>
        <repository>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
            <id>ibm-maven-repo</id>
            <name>ibm-maven-repo</name>
            <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>ibm-maven-repo</id>
            <name>ibm-maven-repo</name>
            <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    
    <dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>1.1.8.Final</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
    

     .....

    <dependency>
        <groupId>com.ibm.tools.target</groupId>
        <artifactId>was-liberty</artifactId>
        <version>LATEST</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <!-- Arquillian WebSphere Liberty Profile support -->
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-wlp-managed-8.5</artifactId>
        <version>1.0.0.Alpha2</version>
        <scope>test</scope>
    </dependency>