Skip to content

Commit 60ca1e0

Browse files
committed
Added test for permissions.xml based on GF QuickLook test
1 parent 390fd75 commit 60ca1e0

File tree

14 files changed

+1137
-5
lines changed

14 files changed

+1137
-5
lines changed

jacc/permissions-xml/pom.xml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>org.javaee7</groupId>
6+
<artifactId>jacc</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
</parent>
9+
10+
<artifactId>jacc-permissions-xml</artifactId>
11+
<packaging>war</packaging>
12+
<name>Java EE 7 Sample: jacc - permissions.xml</name>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.glassfish.grizzly</groupId>
17+
<artifactId>grizzly-framework</artifactId>
18+
<version>2.4.3.payara-p5</version>
19+
<scope>provided</scope>
20+
</dependency>
21+
22+
<dependency>
23+
<groupId>org.glassfish.grizzly</groupId>
24+
<artifactId>grizzly-http</artifactId>
25+
<version>2.4.3.payara-p5</version>
26+
<scope>provided</scope>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.glassfish.grizzly</groupId>
30+
<artifactId>grizzly-http-server</artifactId>
31+
<version>2.4.3.payara-p5</version>
32+
<scope>provided</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.glassfish.grizzly</groupId>
36+
<artifactId>grizzly-http-servlet</artifactId>
37+
<version>2.4.3.payara-p5</version>
38+
<scope>provided</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.glassfish.grizzly</groupId>
42+
<artifactId>grizzly-portunif</artifactId>
43+
<version>2.4.3.payara-p5</version>
44+
<scope>provided</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.glassfish.grizzly</groupId>
48+
<artifactId>grizzly-http-ajp</artifactId>
49+
<version>2.4.3.payara-p5</version>
50+
<scope>provided</scope>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.glassfish.grizzly</groupId>
54+
<artifactId>grizzly-websockets</artifactId>
55+
<version>2.4.3.payara-p5</version>
56+
<scope>provided</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.glassfish.grizzly</groupId>
60+
<artifactId>grizzly-http2</artifactId>
61+
<version>2.4.3.payara-p5</version>
62+
<scope>provided</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.glassfish.grizzly</groupId>
66+
<artifactId>grizzly-comet</artifactId>
67+
<version>2.4.3.payara-p5</version>
68+
<scope>provided</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.glassfish.grizzly</groupId>
72+
<artifactId>grizzly-http-server-multipart</artifactId>
73+
<version>2.4.3.payara-p5</version>
74+
<scope>provided</scope>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.glassfish.grizzly</groupId>
78+
<artifactId>grizzly-http-server-jaxws</artifactId>
79+
<version>2.4.3.payara-p5</version>
80+
<scope>provided</scope>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.glassfish.grizzly</groupId>
84+
<artifactId>grizzly-http-servlet-extras</artifactId>
85+
<version>2.4.3.payara-p5</version>
86+
<scope>provided</scope>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.glassfish.grizzly</groupId>
90+
<artifactId>tls-sni</artifactId>
91+
<version>2.4.3.payara-p5</version><scope>provided</scope>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.glassfish.grizzly.osgi</groupId>
95+
<artifactId>grizzly-httpservice</artifactId>
96+
<version>2.4.3.payara-p5</version>
97+
<scope>provided</scope>
98+
</dependency>
99+
<dependency>
100+
<groupId>org.glassfish.grizzly</groupId>
101+
<artifactId>grizzly-framework-monitoring</artifactId>
102+
<version>2.4.3.payara-p5</version>
103+
<scope>provided</scope>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.glassfish.grizzly</groupId>
107+
<artifactId>grizzly-http-monitoring</artifactId>
108+
<version>2.4.3.payara-p5</version>
109+
<scope>provided</scope>
110+
</dependency>
111+
<dependency>
112+
<groupId>org.glassfish.grizzly</groupId>
113+
<artifactId>grizzly-http-server-monitoring</artifactId>
114+
<version>2.4.3.payara-p5</version>
115+
<scope>provided</scope>
116+
</dependency>
117+
<dependency>
118+
<groupId>org.glassfish.grizzly</groupId>
119+
<artifactId>grizzly-core</artifactId>
120+
<scope>provided</scope>
121+
<version>2.4.3.payara-p5</version>
122+
</dependency>
123+
<dependency>
124+
<groupId>org.glassfish.grizzly</groupId>
125+
<artifactId>grizzly-http-server-core</artifactId>
126+
<version>2.4.3.payara-p5</version>
127+
<scope>provided</scope>
128+
</dependency>
129+
<dependency>
130+
<groupId>org.glassfish.grizzly</groupId>
131+
<artifactId>grizzly-http-all</artifactId>
132+
<version>2.4.3.payara-p5</version>
133+
<scope>provided</scope>
134+
</dependency>
135+
<dependency>
136+
<groupId>org.glassfish.grizzly</groupId>
137+
<artifactId>grizzly-http-servlet-server</artifactId>
138+
<version>2.4.3.payara-p5</version>
139+
<scope>provided</scope>
140+
</dependency>
141+
<dependency>
142+
<groupId>org.glassfish.grizzly</groupId>
143+
<artifactId>grizzly-websockets-server</artifactId>
144+
<version>2.4.3.payara-p5</version>
145+
<scope>provided</scope>
146+
</dependency>
147+
<dependency>
148+
<groupId>org.glassfish.grizzly</groupId>
149+
<artifactId>grizzly-comet-server</artifactId>
150+
<version>2.4.3.payara-p5</version>
151+
<scope>provided</scope>
152+
</dependency>
153+
<dependency>
154+
<groupId>org.glassfish.grizzly.osgi</groupId>
155+
<artifactId>grizzly-httpservice-bundle</artifactId>
156+
<version>2.4.3.payara-p5</version>
157+
<scope>provided</scope>
158+
</dependency>
159+
</dependencies>
160+
161+
</project>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
41+
package org.javaee7.jacc.contexts.bean;
42+
43+
import javax.annotation.PostConstruct;
44+
import javax.ejb.EJB;
45+
import javax.ejb.Singleton;
46+
47+
@Singleton
48+
public class BeanLeaf {
49+
50+
private static final String MESSAGE_POST = "PostBeanLeaf";
51+
private static final String MESSAGE_HELLO = "HelloBeanLeaf";
52+
53+
@EJB
54+
private BeanMessageInterface msg;
55+
56+
@PostConstruct
57+
public void afterConstruct() {
58+
if (msg != null && !msg.getMessage().contains(MESSAGE_POST)) {
59+
msg.appendMessage(MESSAGE_POST);
60+
}
61+
}
62+
63+
public String sayHello() {
64+
if (msg != null && !msg.getMessage().contains(MESSAGE_HELLO)) {
65+
msg.appendMessage(MESSAGE_HELLO);
66+
}
67+
68+
return "Hello from: " + this.getClass().getName() + "; " + System.identityHashCode(this);
69+
}
70+
71+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
41+
package org.javaee7.jacc.contexts.bean;
42+
43+
import javax.ejb.Singleton;
44+
45+
@Singleton
46+
public class BeanMessage implements BeanMessageInterface {
47+
48+
private String message = "";
49+
50+
@Override
51+
public String getMessage() {
52+
return message;
53+
}
54+
55+
@Override
56+
public void setMessage(String message) {
57+
this.message = message;
58+
System.out.println("BeanMessage: setMessage=" + this.message);
59+
}
60+
61+
@Override
62+
public void appendMessage(String message) {
63+
this.message += message;
64+
System.out.println("BeanMessage: appendMessage=" + this.message);
65+
}
66+
67+
@Override
68+
public String sayHello() {
69+
return "Hello from: " + this.getClass().getName() + "; " + System.identityHashCode(this);
70+
}
71+
72+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
41+
package org.javaee7.jacc.contexts.bean;
42+
43+
public interface BeanMessageInterface {
44+
45+
String getMessage();
46+
47+
void setMessage(String message);
48+
49+
void appendMessage(String message);
50+
51+
String sayHello();
52+
53+
}

0 commit comments

Comments
 (0)