Skip to content

weld/weld-glassfish-tck-runner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Before running  cdi 2.0 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-2.0.0.Final.jar to $GF_HOME/domains/domain1/lib/applibs
    This can be found in http://central.maven.org/maven2/org/jboss/cdi/tck/cdi-tck-ext-lib/2.0.0.Final/
- 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>
      <admin-object-resource res-adapter="jmsra" res-type="javax.jms.Topic" jndi-name="topic_test">
        <property name="Name" value="topic_test"></property>
      </admin-object-resource>
    - 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:
      <jvm-options>-DcdiTckExcludeDummy=true</jvm-options>

  4 Enable assertions.  Under each <java-config> element add:
      <jvm-options>-ea:org.jboss.cdi.tck...</jvm-options>

  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: "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 -Djava.security.manager
- 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 javax.security.auth.AuthPermission "modifyPrincipals";
       permission java.io.FilePermission       "<<ALL FILES>>", "delete";
     };
     grant  codeBase "file:${com.sun.aas.instanceRoot}/applications/-"{
      permission java.security.AllPermission;
    };

- 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

Notes
- 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 

About

Weld TCK Runner for GlassFish

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%