Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-995

Define a weblogic managed profile for arquillian tests

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.5.1
    • Tests
    • None

    Description

      I just finished testing DeltaSpike on Weblogic 12.2.1 using a managed mode where Arquillian can start/stop weblogic. Not all of the tests pass (I will be entering other jiras for those failures) but the following changes will define a wls-managed mode for running the Arquillian tests.
      1) Add the following profile to deltaspike-1.5.0/deltaspike/parent/code/pom.xml

      <profile>
      <id>wls-managed-12c</id>

      <properties>
      <cdicontainer.version>wls-${wls.version}</cdicontainer.version>
      </properties>

      <dependencies>
      <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <version>1.0-SP4</version>
      <scope>provided</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-wls-managed-12.1</artifactId>
      <version>1.0.0.Alpha3</version>
      <scope>test</scope>
      </dependency>
      </dependencies>
      <build>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>${maven.surefire.plugin.version}</version>
      <configuration>
      <systemProperties>
      <arquillian.launch>wls-managed-12c</arquillian.launch>
      <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
      <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
      </systemProperties>
      <systemPropertyVariables>
      <!--
      Define the following environment variables.
      MW_HOME should point to the directory where weblogic is installed.
      That directory should contain directories like oracle_common and wlserver.
      DS_DOMAIN_DIR is the directory of the wls domain with which deltaspike will run.
      That directory should contain directories like autodeploy and servers.
      DS_DOMAIN_TARGET is the directory under DS_DOMAIN_DIR/servers of the target server.
      DS_ADMIN_URL is the url of the admin server
      DS_ADMIN_USER is the admin username
      DS_ADMIN_PSWD is the admin password

      Note for some strange reason you cannot use an environment variable of ADMIN_URL
      as it causes jmx connection issues.

      examples
      export MW_HOME=/weblogic/Oracle_Home
      export DS_DOMAIN_DIR=/deltaspike/deltaspike-1.5.0/mytest
      export DS_DOMAIN_TARGET=myserver
      export DS_ADMIN_URL=t3://localhost:7001
      export DS_ADMIN_USER=weblogic
      export DS_ADMIN_PSWD=weblogic1
      -->
      <MW_HOME>${env.MW_HOME}</MW_HOME>
      <DS_DOMAIN_DIR>${env.DS_DOMAIN_DIR}</DS_DOMAIN_DIR>
      <DS_DOMAIN_TARGET>${env.DS_DOMAIN_TARGET}</DS_DOMAIN_TARGET>
      <DS_ADMIN_URL>${env.DS_ADMIN_URL}</DS_ADMIN_URL>
      <DS_ADMIN_USER>${env.DS_ADMIN_USER}</DS_ADMIN_USER>
      <DS_ADMIN_PSWD>${env.DS_ADMIN_PSWD}</DS_ADMIN_PSWD>
      </systemPropertyVariables>
      <!-- we just use groups to mark that a test should be executed only
      with specific environments. even though a java-ee6 application server has to be able to run
      all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
      there are currently issues with arquillian. if a test isn't restricted to an environment,
      no category is used for the test-class. -->
      <excludedGroups>
      org.apache.deltaspike.test.category.FullProfileCategory,
      org.apache.deltaspike.test.category.WebEE7ProfileCategory,
      org.apache.deltaspike.test.category.SeCategory
      </excludedGroups>
      </configuration>
      </plugin>
      </plugins>
      </build>
      </profile>

      2) Add the following container to deltaspike-1.5.0/deltaspike/test-utils/src/main/resources/arquillian.xml
      <container qualifier="wls-managed-12c">
      <configuration>
      <property name="middlewareHome">${MW_HOME}</property>
      <property name="wlHome">${MW_HOME}/wlserver</property>
      <property name="domainDirectory">${DS_DOMAIN_DIR}</property>
      <property name="target">${DS_DOMAIN_TARGET}</property>
      <property name="adminUrl">${DS_ADMIN_URL}</property>
      <property name="adminUserName">${DS_ADMIN_USER}</property>
      <property name="adminPassword">${DS_ADMIN_PSWD}</property>

      <!-- uncomment the following line if you want to start wls with debug -->
      <!-<property name="jvmOptions">-XX:MaxPermSize=256m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</property>->
      <property name="timeout">600</property>
      </configuration>
      </container>

      Attachments

        Activity

          People

            gpetracek Gerhard Petracek
            jjsnyder JJ Snyder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: