forked from mtau11/weld-glassfish-tck-runner
-
Notifications
You must be signed in to change notification settings - Fork 6
/
readme
76 lines (66 loc) · 3.51 KB
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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