-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testcase for https://issues.jboss.org/browse/AS7-1297
- Loading branch information
unknown
authored and
unknown
committed
Jul 16, 2011
1 parent
b6e400d
commit 6965a73
Showing
6 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nb-configuration.xml | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<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> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>jboss-principal-injection</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
|
||
<name>jboss-principal-injection Web App</name> | ||
|
||
<properties> | ||
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-web-api</artifactId> | ||
<version>6.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
<compilerArguments> | ||
<endorseddirs>${endorsed.dir}</endorseddirs> | ||
</compilerArguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.1</version> | ||
<configuration> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.1</version> | ||
<executions> | ||
<execution> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${endorsed.dir}</outputDirectory> | ||
<silent>true</silent> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-endorsed-api</artifactId> | ||
<version>6.0</version> | ||
<type>jar</type> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
<finalName>jboss-principal-injection</finalName> | ||
</build> | ||
<repositories> | ||
<repository> | ||
<url>http://download.java.net/maven/2/</url> | ||
<id>jsf20</id> | ||
<layout>default</layout> | ||
<name>Repository for library Library[jsf20]</name> | ||
</repository> | ||
</repositories> | ||
</project> |
18 changes: 18 additions & 0 deletions
18
...jboss-principal-injection/src/main/java/com/example/jbossprincipalinjection/TestBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.jbossprincipalinjection; | ||
|
||
import java.security.Principal; | ||
import javax.enterprise.context.RequestScoped; | ||
import javax.inject.Inject; | ||
import javax.inject.Named; | ||
|
||
@Named | ||
@RequestScoped | ||
public class TestBean { | ||
|
||
@Inject | ||
private Principal principal; | ||
|
||
public String getPrincipal() { | ||
return principal.toString(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
testcases/javaee/jboss-principal-injection/src/main/webapp/WEB-INF/beans.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> | ||
</beans> |
24 changes: 24 additions & 0 deletions
24
testcases/javaee/jboss-principal-injection/src/main/webapp/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | ||
<context-param> | ||
<param-name>javax.faces.PROJECT_STAGE</param-name> | ||
<param-value>Development</param-value> | ||
</context-param> | ||
<servlet> | ||
<servlet-name>Faces Servlet</servlet-name> | ||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
<servlet-mapping> | ||
<servlet-name>Faces Servlet</servlet-name> | ||
<url-pattern>/faces/*</url-pattern> | ||
</servlet-mapping> | ||
<session-config> | ||
<session-timeout> | ||
30 | ||
</session-timeout> | ||
</session-config> | ||
<welcome-file-list> | ||
<welcome-file>faces/index.xhtml</welcome-file> | ||
</welcome-file-list> | ||
</web-app> |
12 changes: 12 additions & 0 deletions
12
testcases/javaee/jboss-principal-injection/src/main/webapp/index.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version='1.0' encoding='UTF-8' ?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:h="http://java.sun.com/jsf/html"> | ||
<h:head> | ||
<title>Facelet Title</title> | ||
</h:head> | ||
<h:body> | ||
Current security principal is: #{testBean.principal} | ||
</h:body> | ||
</html> | ||
|