Skip to content
Weld TCK Runner for GlassFish
Pull request Compare This branch is 21 commits ahead of mtau11:master.
Failed to load latest commit information.
pom.xml Merge branch 'master' of… Jul 22, 2014


Before running  cdi 1.2 tck you must do the following:
- Install Glassfish
- Modify src/test/glassfish-managed/arquillian.xml
  - Set glassFishHome accordingly
- Add shared library
  - Copy shared library cdi-tck-ext-lib-1.2.0.Final.jar to $GF_HOME/domains/domain1/lib/applibs
    This can be found in
- Make changes to domain.xml (see example domain.xml)
  1 Define JMS resources:
    - add the following to the "<resources>" element:
      <admin-object-resource res-adapter="jmsra" res-type="javax.jms.Queue" jndi-name="queue_test">
        <property name="Name" value="queue_test"></property>
      <admin-object-resource res-adapter="jmsra" res-type="javax.jms.Topic" jndi-name="topic_test">
        <property name="Name" value="topic_test"></property>
    - add the following elements under <servers> -> <server name="server" config-ref="server-config"> :
        <resource-ref ref="queue_test"></resource-ref>
        <resource-ref ref="topic_test"></resource-ref>

  2 enable implicit cdi.  Add the following element under <config name="server-config">
      <cdi-service enable-implicit-cdi="true"></cdi-service>

  3 Set environment variable cdiTckExcludeDummy.  Add the following jvm-options element under all instances of the <java-config ..." element:

  4 Enable assertions.  Under each <java-config> element add:

  5 Activate default principal to role mapping.  Find the <security-service> element under the '<config name="server-config">' element and modify it to be:
      <security-service activate-default-principal-to-role-mapping="true">

- Define Security principals and roles.
  There are 2 ways to do this.
  1) Go into GlassFish Console and 
     - Select server-config->Security->Realms->file
     - Click on "Manage Users"
     - Add a user with User Id: "alarm" and Group List: "student:alarm"
     - Add a user with User Id: "student" and Group List: "student"
     - Add a user with User Id: "printer" and Group List: "student:printer"
  2) Replace glassfish/domains/domain1/config/keyfile with the example file src/keyfile

- Run Tests (see "Run Tests" below)

To run with security manager:
- Follow all steps above
- Start GlassFish
  - $GF_HOME/bin/asadmin start-domain domain1
- Enable the security manager
  - $GF_HOME/bin/asadmin create-jvm-options
- Stop GlassFish
  - $GF_HOME/bin/asadmin stop-domain domain1
- Add the following permissions to $GF_HOME/domains/domain1/config/server.policy:
    grant {
       permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
       permission org.osgi.framework.AdminPermission "*", "*";
       permission java.lang.RuntimePermission "createClassLoader";
       permission "modifyPrincipals";

- Run Tests (see "Run Tests" below)

Run Tests
- Start database
  - $GF_HOME/bin/asadamin start-database
- Run TCK
  - mvn -U -P glassfish-managed clean test

- Do not start GlassFish.  The tck runner will start and stop GlassFish automatically.
- If you run out of memory lower the maxTestClassesBeforeRestart property in src/test/glassfish-managed/arquillian.xml
- The pom.xml file 
Something went wrong with that request. Please try again.