JBoss Community Archive (Read Only)

Arquillian Old

GlassFish 3.1 - Managed

A DeployableContainer implementation that can run against a remote(different JVM, same machine) running GlassFish 3.1 instance.
This implementation has lifecycle support, so it can be started or stopped.

Container Injection Support Matrix

@EJB

@EJB (no-interface)

@Inject (CDI)

@Inject (MC)

@PersistenceContext @PersistenceUnit

images/author/download/attachments/23822434/fact_good.png

images/author/download/attachments/23822434/fact_good.png

images/author/download/attachments/23822434/fact_good.png

 

images/author/download/attachments/23822434/fact_good.png

Configuration

Default Protocol: Servlet 3.0

Container Configuration Options

Name

Type

Default

Description

glassFishHome

String

$GLASSFISH_HOME

The directory containing the GlassFish installation. It must contain a sub-directory named glassfish.

domain

String

 

The name of the GlassFish domain to manage. If no name is provided, the default domain would be used.

adminPort

int

4848

The administrative port the client should connect to.

adminHost

String

localhost

Glassfish Admin Server (DAS) host address.

adminHttps

boolean

false

Use SSL for communicating with the admin server.

adminUser

String

 

The name of the admin user of your DAS. If omitted, no authentication will be used to access the DAS. This case you must have empty password for your admin user.

adminPassword

String

 

The password of the admin user of your DAS. Canot be omitted if you declare the admin user. If no authentication will be used to access the DAS you must have empty password for your admin user.

outputToConsole

boolean

false

A flag to enable showing the output of the GlassFish admin commands onto the console. Enable this flag to see the output of the asadmin commands.

debug

boolean

false

A flag to instruct GlassFish to start in the debug mode, using the standard GlassFish debug port. The debug options should be specified in the GlassFish domain configuration file - domain.xml.

allowConnectingToRunningServer

boolean

false

A flag to allow Arquillian to connect to an already running GlassFish instance. The default is false, to prevent Arquillian from unintentionally taking over control of an already running GlassFish instance.

libraries

String

 

A comma-separated list of library JAR files. Specify the library JAR  files by their relative or absolute paths. Specify relative paths relative to domain-dir/lib/applibs. The libraries are made available to the application in the order specified. For more detail, please refer to GlassFish Server 3.1 Administration Guide.

properties

String

 

Optional keyword-value pairs  that  specify  additional properties for the deployment. The available properties are determined by the implementation of the  component that is being deployed. For
more detail, please refer to GlassFish Server 3.1 Administration Guide.

type

String

 

The packaging archive type of the component that is being deployed. Only valid value is: osgi meaning that the component is packagedas an OSGi Alliance bundle. The type option is optional. If the component is packaged as a regular archive, omit this option. For more detail, please refer to "OSGi Application Development using GlassFish Server"

The contextroot that will be used to run the tests is retrieved automatically from the DAS server. If you do not have sun-web.xml or glassfish-web.xml file in your web application, the GlassFish will use the name of your deployment without the extension as contextroot. The same rule is applied for enterprise applications if you do not have application.xml file. The jar test-deployments are treated as a web application. In case of OSGi Alliance bundle, use the “Web-ContextPath” metadata in the META-INF/MANIFEST.MF to specify the context root.

You can use the above standard GlassFish xml files as normal to declare your contextroot to be applied. For more detail, please refer to GlassFish Server 3.1 Administration Guide. You should consider the above to avoid any conflict with your already deployed web or enterprise applications in your administrative domain.

Example of Maven profile setup

<profile>
    <id>glassfish-managed-3.1</id>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-glassfish-managed-3.1</artifactId>
            <version>1.0.0.Final-SNAPSHOT</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources-glassfish-managed</directory>
            </testResource>
        </testResources>
    </build>
</profile>

Sample arquillian.xml

<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://jboss.org/schema/arquillian"
    xsi:schemaLocation="http://jboss.org/schema/arquillian
    http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <!--  Uncomment to have test archives exported to the file system for inspection  -->
    <!--
    <engine>
        <property name="deploymentExportPath">target/</property>
    </engine>
    -->

    <container qualifier="glassfish" default="true">
        <configuration>
            <property name="glassFishHome">/opt/glassfish3</property>
            <property name="adminHost">localhost</property>
            <property name="adminPort">4848</property>
        </configuration>
    </container>

    <container qualifier="glassfish-auth">
        <configuration>
            <property name="glassFishHome">/opt/glassfish3</property>
            <property name="adminHost">localhost</property>
            <property name="adminPort">4848</property>
            <property name="adminUser">admin</property>
            <property name="adminPassword">admin</property>
        </configuration>
    </container>
</arquillian>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:19:12 UTC, last content change 2012-03-13 08:58:17 UTC.