Author: manaRH
Date: 2012-06-09 14:48:05 -0400 (Sat, 09 Jun 2012)
New Revision: 14883
Removed:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/src/main/application/META-INF/jboss-deployment-structure.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/AppleJuice.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Juice.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBar.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBarModule.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Orange.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/OrangeJuice.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/resources/seam.properties
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/GuiceTest.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/JuiceTestBar.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/selenium/GuiceTest.java
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-ftest/testng.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/arquillian.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/web.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/components.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/faces-config.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/web.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/bar.xhtml
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/index.html
branches/enterprise/WFK-2_0/examples-ee6/guice/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/guice/readme.txt
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Guice.java
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInit.java
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInterceptor.java
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Injector.java
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/package-info.java
Modified:
branches/enterprise/WFK-2_0/examples-ee6/pom.xml
branches/enterprise/WFK-2_0/jboss-seam-ioc/pom.xml
Log:
bz #830142 removed guice example and guice from ioc module
Deleted: branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/pom.xml 2012-06-09 18:13:25
UTC (rev 14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/pom.xml 2012-06-09 18:48:05
UTC (rev 14883)
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>guice</artifactId>
- <groupId>org.jboss.seam.examples-ee6</groupId>
- <version>2.3.0.Beta2-redhat-1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ear</artifactId>
- <packaging>ear</packaging>
- <name>Guice EAR Module (EE6)</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-web</artifactId>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ejb</artifactId>
- <type>ejb</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-ioc</artifactId>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>seam-guice</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ear-plugin</artifactId>
- <configuration>
- <version>6</version>
- <defaultLibBundleDir>lib</defaultLibBundleDir>
- <!-- Exclude eclipse generated application.xml and manually
modified jboss-app.xml during mvn build -->
- <earSourceExcludes>**/application.xml,
**/jboss-app.xml</earSourceExcludes>
- <!-- use maven generated application.xml instead -->
- <generateApplicationXml>true</generateApplicationXml>
- <modules>
- <webModule>
-
<groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-web</artifactId>
- <contextRoot>/seam-guice</contextRoot>
- <bundleFileName>guice-web.war</bundleFileName>
- </webModule>
- <ejbModule>
-
<groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ejb</artifactId>
- <bundleFileName>guice-ejb.jar</bundleFileName>
- </ejbModule>
- <ejbModule>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <bundleFileName>jboss-seam.jar</bundleFileName>
- </ejbModule>
- </modules>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/src/main/application/META-INF/jboss-deployment-structure.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,13 +0,0 @@
-<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
- <deployment>
- <dependencies>
- <module name="org.javassist" export="true"/>
- <module name="org.apache.log4j" export="true"/>
- <module name="org.dom4j" export="true"/>
- <module name="org.apache.commons.logging"
export="true"/>
- <module name="org.apache.commons.collections"
export="true"/>
- <module name="javax.faces.api" export="true"/>
- <module name="com.sun.jsf-impl" export="true"/>
- </dependencies>
- </deployment>
-</jboss-deployment-structure>
Deleted: branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/pom.xml 2012-06-09 18:13:25
UTC (rev 14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/pom.xml 2012-06-09 18:48:05
UTC (rev 14883)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>guice</artifactId>
- <groupId>org.jboss.seam.examples-ee6</groupId>
- <version>2.3.0.Beta2-redhat-1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ejb</artifactId>
- <packaging>ejb</packaging>
- <name>Guice EJB Module (EE6)</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-ioc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.ejb</groupId>
- <artifactId>jboss-ejb-api_3.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- </dependencies>
-</project>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/AppleJuice.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/AppleJuice.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/AppleJuice.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,28 +0,0 @@
-package org.jboss.seam.example.guice;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-public class AppleJuice implements Juice
-{
- private static final String name = "Apple Juice";
- private static final int price = 10;
-
- public AppleJuice() {}
-
- public String getName()
- {
- return name;
- }
-
- public int getPrice()
- {
- return price;
- }
-
- @Override
- public String toString()
- {
- return name;
- }
-}
\ No newline at end of file
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Juice.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Juice.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Juice.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,11 +0,0 @@
-package org.jboss.seam.example.guice;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-public interface Juice
-{
- public String getName();
-
- public int getPrice();
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBar.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBar.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBar.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,26 +0,0 @@
-package org.jboss.seam.example.guice;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.ioc.guice.Guice;
-import com.google.inject.Inject;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-@Name("juiceBar")
-@Guice // Activates @Inject on a Seam component
-public class JuiceBar
-{
- @Inject protected Juice juiceOfTheDay; // Guice looks at the variable type, not name
- @Inject @Orange protected Juice anotherJuice;
-
- public Juice getJuiceOfTheDay()
- {
- return juiceOfTheDay;
- }
-
- public Juice getAnotherJuice()
- {
- return anotherJuice;
- }
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBarModule.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBarModule.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/JuiceBarModule.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,18 +0,0 @@
-package org.jboss.seam.example.guice;
-
-import com.google.inject.Module;
-import com.google.inject.Binder;
-import com.google.inject.Scopes;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-public class JuiceBarModule implements Module
-{
- public void configure(Binder binder)
- {
- binder.bind(Juice.class).to(AppleJuice.class); // Create a new instance every
time.
-
-
binder.bind(Juice.class).annotatedWith(Orange.class).to(OrangeJuice.class).in(Scopes.SINGLETON);
- }
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Orange.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Orange.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/Orange.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,20 +0,0 @@
-package org.jboss.seam.example.guice;
-
-import com.google.inject.BindingAnnotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * Indicates we want the orange version of a binding.
- *
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-(a)Retention(RetentionPolicy.RUNTIME)
-(a)Target({ElementType.FIELD, ElementType.PARAMETER})
-@BindingAnnotation
-public @interface Orange
-{
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/OrangeJuice.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/OrangeJuice.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/java/org/jboss/seam/example/guice/OrangeJuice.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,28 +0,0 @@
-package org.jboss.seam.example.guice;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-public class OrangeJuice implements Juice
-{
- private static final String name = "Orange Juice";
- private static final int price = 12;
-
- public OrangeJuice() {}
-
- public String getName()
- {
- return name;
- }
-
- public int getPrice()
- {
- return price;
- }
-
- @Override
- public String toString()
- {
- return name + " (" + price + " cents)";
- }
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-ejb/src/main/resources/seam.properties
===================================================================
Deleted: branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/pom.xml 2012-06-09 18:13:25
UTC (rev 14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/pom.xml 2012-06-09 18:48:05
UTC (rev 14883)
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>guice</artifactId>
- <groupId>org.jboss.seam.examples-ee6</groupId>
- <version>2.3.0.Beta2-redhat-1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-tests</artifactId>
- <name>Guice Integration Tests Module (EE6)</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ejb</artifactId>
- <type>ejb</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>functional-tests</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.junit</groupId>
- <artifactId>arquillian-junit-container</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.arquillian.protocol</groupId>
- <artifactId>arquillian-protocol-servlet</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.spec.javax.el</groupId>
- <artifactId>jboss-el-api_2.2_spec</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- <testResource>
- <directory>src/test/resources-integration</directory>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>integration-tests</id>
- <activation>
- <property>
- <name>arquillian</name>
- </property>
- </activation>
- </profile>
-
- <profile>
- <id>arq-jbossas-7-managed</id>
- <activation>
- <property>
- <name>arquillian</name>
- <value>jbossas-managed-7</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>arq-jbossas-7-remote</id>
- <activation>
- <property>
- <name>arquillian</name>
- <value>jbossas-remote-7</value>
- </property>
- </activation>
- </profile>
-
- <profile>
- <id>ftest-jbossas</id>
- <properties>
- <example.context.path>seam-guice</example.context.path>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>failsafe-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/GuiceTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/GuiceTest.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/GuiceTest.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,116 +0,0 @@
-package org.jboss.seam.example.guice.test;
-
-import java.io.File;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.container.test.api.OverProtocol;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.example.guice.JuiceBar;
-import org.jboss.seam.example.guice.Juice;
-import org.jboss.seam.example.guice.AppleJuice;
-import org.jboss.seam.example.guice.Orange;
-import org.jboss.seam.example.guice.OrangeJuice;
-import org.jboss.seam.mock.JUnitSeamTest;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.importer.ZipImporter;
-import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.google.inject.Injector;
-import com.google.inject.Key;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-(a)RunWith(Arquillian.class)
-public class GuiceTest extends JUnitSeamTest
-{
- @Deployment(name="GuiceTest")
- @OverProtocol("Servlet 3.0")
- public static Archive<?> createDeployment()
- {
- EnterpriseArchive ear = ShrinkWrap.create(ZipImporter.class,
"seam-guice.ear").importFrom(new
File("../guice-ear/target/seam-guice.ear"))
- .as(EnterpriseArchive.class);
-
- // Install org.jboss.seam.mock.MockSeamListener
- WebArchive web = ear.getAsType(WebArchive.class, "guice-web.war");
- web.delete("/WEB-INF/web.xml");
- web.addAsWebInfResource("web.xml");
-
- web.addClasses(GuiceTest.class);
-
- JavaArchive ejb = ear.getAsType(JavaArchive.class, "guice-ejb.jar");
- ejb.addClasses(JuiceTestBar.class);
-
- return ear;
- }
-
- @Test
- public void testGuiceInjector() throws Exception
- {
- new ComponentTest()
- {
- @Override
- protected void testComponents() throws Exception
- {
- Injector injector = (Injector)
getInstance("guiceExampleInjector");
-
- Object juiceInstance = injector.getInstance(Juice.class);
- assert juiceInstance instanceof AppleJuice : juiceInstance;
-
- Object orangeInstance = injector.getInstance(Key.get(Juice.class,
Orange.class));
- assert orangeInstance instanceof OrangeJuice : orangeInstance;
- }
- }.run();
- }
-
- @Test
- public void testGuiceIntegration() throws Exception
- {
- new ComponentTest()
- {
- @Override
- protected void testComponents() throws Exception
- {
- JuiceBar juiceBar = (JuiceBar) getInstance("juiceBar");
-
- Juice juiceOfTheDay = juiceBar.getJuiceOfTheDay();
- assert "Apple Juice".equals(juiceOfTheDay.getName()) :
juiceOfTheDay.getName();
- Juice anotherJuice = juiceBar.getAnotherJuice();
- assert "Orange Juice".equals(anotherJuice.getName()) :
anotherJuice.getName();
-
- Juice juiceOfTheDay2 = juiceBar.getJuiceOfTheDay();
- assert juiceOfTheDay != juiceOfTheDay2 : "A new instance should be
created by Guice.";
- Juice anotherJuice2 = juiceBar.getAnotherJuice();
- assert anotherJuice == anotherJuice2 : "Different instances returned for
the singleton object.";
- }
- }.run();
- }
-
- @Test
- public void testGuiceDisinjection() throws Exception
- {
- new ComponentTest()
- {
- @Override
- protected void testComponents() throws Exception
- {
- JuiceTestBar juiceBar = (JuiceTestBar)
getInstance("juiceTestBar");
- juiceBar.getJuiceOfTheDay(); // Call a method to trigger Guice injection
-
- assert juiceBar.getJuiceOfTheDay() != null;
- assert juiceBar.getAnotherJuice() != null;
-
- // Reflection to obtain the field value would not work here due to the proxy
- assert juiceBar.getJuiceOfTheDayBypassInterceptors() == null
- : "Value injected by Guice was not cleared after the
call";
- assert juiceBar.getAnotherJuiceBypassInterceptors() == null
- : "Value injected by Guice was not cleared after the
call";
- }
- }.run();
- }
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/JuiceTestBar.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/JuiceTestBar.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/JuiceTestBar.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,29 +0,0 @@
-package org.jboss.seam.example.guice.test;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.example.guice.JuiceBar;
-import org.jboss.seam.example.guice.Juice;
-import org.jboss.seam.ioc.guice.Guice;
-
-/**
- * A component used by the disinjection test to obtain the values of the fields after the
proxied call.
- *
- * @author Pawel Wrzeszcz (pawel . wrzeszcz [at] gmail . com)
- */
-@Name("juiceTestBar")
-@Guice
-public class JuiceTestBar extends JuiceBar
-{
- @BypassInterceptors
- public Juice getJuiceOfTheDayBypassInterceptors()
- {
- return juiceOfTheDay;
- }
-
- @BypassInterceptors
- public Juice getAnotherJuiceBypassInterceptors()
- {
- return anotherJuice;
- }
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/selenium/GuiceTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/selenium/GuiceTest.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/selenium/GuiceTest.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.seam.example.guice.test.selenium;
-
-import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import static org.testng.AssertJUnit.assertTrue;
-
- /*
- * @author Martin Gencur
- *
- */
-public class GuiceTest extends SeamSeleniumTest
-{
- protected static final String BAR_URL = "/bar.seam";
- protected static final String JUICE_OF_THE_DAY = "Apple Juice* - 10 cents";
- protected static final String ANOTHER_JUICE = "Orange Juice - 12 cents";
- protected static final String GUICE_TITLE = "Juice Bar";
-
- @Override
- @BeforeMethod
- public void setUp()
- {
- super.setUp();
- browser.open(CONTEXT_PATH + BAR_URL);
- }
-
- @Test
- public void simplePageContentTest()
- {
- assertTrue("Home page of Guice Example expected",
browser.getLocation().contains(BAR_URL));
- assertTrue("Different page title
expected",browser.getTitle().contains(GUICE_TITLE));
- assertTrue("Juice of the day should contain its name and price",
browser.isTextPresent(JUICE_OF_THE_DAY));
- assertTrue("Another juice should contain its name and price",
browser.isTextPresent(ANOTHER_JUICE));
- }
-
-}
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-ftest/testng.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-ftest/testng.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-ftest/testng.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,27 +0,0 @@
-
- <!--
- JBoss, Home of Professional Open Source Copyright 2008, Red Hat
- Middleware LLC, and individual contributors by the @authors tag. See
- the copyright.txt in the distribution for a full listing of individual
- contributors. This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version. This software is
- distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- License for more details. You should have received a copy of the GNU
- Lesser General Public License along with this software; if not, write
- to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- -->
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="Guice example" verbose="2"
parallel="false">
- <test name="guice_jboss5">
- <parameter name="PROPERTY_FILE" value="" />
- <classes>
- <class
- name="org.jboss.seam.example.guice.test.selenium.GuiceTest" />
- </classes>
- </test>
-</suite>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/arquillian.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/arquillian.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/arquillian.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<arquillian
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xmlns="http://jboss.org/schema/arquillian"
-
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
-
- <engine>
- <property name="deploymentExportPath">target/</property>
- </engine>
-
- <container qualifier="jboss" default="true">
- <configuration>
- <property name="javaVmArguments">-Xmx1024m
-XX:MaxPermSize=512m</property>
- <property
name="jbossHome">target/jboss-as-${version.jbossas7}</property>
- </configuration>
- </container>
-
-</arquillian>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/web.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/web.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-tests/src/test/resources-integration/web.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,12 +0,0 @@
-<?xml version="1.0" ?>
-
-<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">
-
- <listener>
-
<listener-class>org.jboss.seam.mock.MockSeamListener</listener-class>
- </listener>
-
-</web-app>
Deleted: branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/pom.xml 2012-06-09 18:13:25
UTC (rev 14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/pom.xml 2012-06-09 18:48:05
UTC (rev 14883)
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>guice</artifactId>
- <groupId>org.jboss.seam.examples-ee6</groupId>
- <version>2.3.0.Beta2-redhat-1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-web</artifactId>
- <packaging>war</packaging>
- <name>Guice Web Module (EE6)</name>
-
- <properties>
- <!-- filtering property for components.xml -->
- <jndiPattern>java:app/guice-ejb/#{ejbName}</jndiPattern>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ejb</artifactId>
- <type>ejb</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-debug</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-ui</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-jul</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp</directory>
- <filtering>true</filtering>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/components.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/components.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/components.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<components
xmlns="http://jboss.org/schema/seam/components"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xmlns:core="http://jboss.org/schema/seam/core"
-
xmlns:guice="http://jboss.org/schema/seam/guice"
- xsi:schemaLocation="
-
http://jboss.org/schema/seam/core http://jboss.org/schema/seam/core-2.3.xsd
-
http://jboss.org/schema/seam/guice http://jboss.org/schema/seam/guice-2.3.xsd
-
http://jboss.org/schema/seam/components
http://jboss.org/schema/seam/components-2.3.xsd">
-
- <core:init debug="true"/>
-
- <guice:injector name="guiceExampleInjector">
- <guice:modules>
- <value>org.jboss.seam.example.guice.JuiceBarModule</value>
- </guice:modules>
- </guice:injector>
-
- <guice:init injector="#{guiceExampleInjector}"/>
-
-</components>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/faces-config.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/faces-config.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,6 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<faces-config version="2.1"
-
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-facesconfig_2_1.xsd">
-</faces-config>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/web.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/web.xml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/WEB-INF/web.xml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,48 +0,0 @@
-<?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">
-
- <display-name>Seam Guice Example</display-name>
-
- <listener>
- <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
- </listener>
-
- <filter>
- <filter-name>Seam Filter</filter-name>
- <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>Seam Filter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
-
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>true</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>*.seam</url-pattern>
- </servlet-mapping>
-
- <session-config>
- <session-timeout>10</session-timeout>
- </session-config>
-
-</web-app>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/bar.xhtml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/bar.xhtml 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/bar.xhtml 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,23 +0,0 @@
-<!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"
-
xmlns:f="http://java.sun.com/jsf/core">
- <head>
- <title>Juice Bar</title>
- </head>
- <body>
- <h1>Juice Bar</h1>
- <h:form id="main">
- <div>
- Which juice do you prefer?
- <ul>
- <li>#{juiceBar.juiceOfTheDay.name}* -
#{juiceBar.juiceOfTheDay.price} cents</li>
- <li>#{juiceBar.anotherJuice.name} -
#{juiceBar.anotherJuice.price} cents</li>
- </ul>
- <p><em>* Juice of the day</em></p>
- </div>
- <p><small>This page is intentionally static (no form
action).</small></p>
- </h:form>
- </body>
-</html>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/index.html
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/index.html 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/examples-ee6/guice/guice-web/src/main/webapp/index.html 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,5 +0,0 @@
-<html>
-<head>
- <meta http-equiv="Refresh" content="0; URL=bar.seam">
-</head>
-</html>
\ No newline at end of file
Deleted: branches/enterprise/WFK-2_0/examples-ee6/guice/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/guice/pom.xml 2012-06-09 18:13:25 UTC (rev
14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/guice/pom.xml 2012-06-09 18:48:05 UTC (rev
14883)
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
- <parent>
- <artifactId>examples-ee6</artifactId>
- <groupId>org.jboss.seam</groupId>
- <version>2.3.0.Beta2-redhat-1</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.seam.examples-ee6</groupId>
- <artifactId>guice</artifactId>
- <packaging>pom</packaging>
- <name>Guice Example (EE6)</name>
-
- <modules>
- <module>guice-ejb</module>
- <module>guice-web</module>
- <module>guice-ear</module>
- <module>guice-tests</module>
- </modules>
-
- <properties>
- <example.name>guice</example.name>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ejb</artifactId>
- <version>${project.version}</version>
- <type>ejb</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-web</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples-ee6.guice</groupId>
- <artifactId>guice-ear</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-</project>
Deleted: branches/enterprise/WFK-2_0/examples-ee6/guice/readme.txt
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/guice/readme.txt 2012-06-09 18:13:25 UTC (rev
14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/guice/readme.txt 2012-06-09 18:48:05 UTC (rev
14883)
@@ -1,25 +0,0 @@
-Seam Guice Example
-======================
-This is a simple example demonstrating the use of Google Guice with Seam.
-
-example.name=guice
-
-To deploy the example to JBossAS, follow these steps:
-
-* In the example root directory run:
-
- mvn clean package
-
-* Set JBOSS_HOME environment property.
-
-* In the guice-ear directory run:
-
- mvn jboss:hard-deploy
-
-To deploy the example to Tomcat with Embedded JBoss, follow these steps:
-
-* In the example root directory run:
-
- mvn clean package -Ptomcat
-
-* Deploy the resulting WAR from guice-web/target directory to Tomcat manually.
Modified: branches/enterprise/WFK-2_0/examples-ee6/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/pom.xml 2012-06-09 18:13:25 UTC (rev 14882)
+++ branches/enterprise/WFK-2_0/examples-ee6/pom.xml 2012-06-09 18:48:05 UTC (rev 14883)
@@ -55,7 +55,6 @@
<!-- <module>dvdstore</module> -->
<module>excel</module>
<module>groovybooking</module>
- <module>guice</module>
<module>hibernate</module>
<module>itext</module>
<module>jpa</module>
Modified: branches/enterprise/WFK-2_0/jboss-seam-ioc/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/jboss-seam-ioc/pom.xml 2012-06-09 18:13:25 UTC (rev
14882)
+++ branches/enterprise/WFK-2_0/jboss-seam-ioc/pom.xml 2012-06-09 18:48:05 UTC (rev
14883)
@@ -66,12 +66,6 @@
</dependency>
<dependency>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<optional>true</optional>
Deleted:
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Guice.java
===================================================================
---
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Guice.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Guice.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,25 +0,0 @@
-package org.jboss.seam.ioc.guice;
-
-import org.jboss.seam.annotations.intercept.Interceptors;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Google Guice support. Allows use of Guice injection inside Seam component.
- *
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-@Target(TYPE)
-@Retention(RUNTIME)
-(a)Interceptors(GuiceInterceptor.class)
-public @interface Guice
-{
- /**
- * Name of the Guice injector component.
- * By default the injector specified in the components.xml file is used.
- */
- String value() default "";
-}
Deleted:
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInit.java
===================================================================
---
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInit.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInit.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,48 +0,0 @@
-package org.jboss.seam.ioc.guice;
-
-import static org.jboss.seam.annotations.Install.FRAMEWORK;
-
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-
-import com.google.inject.Injector;
-
-/**
- * Guice support configuration component. Holds reference to the default
- * injector.
- *
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-(a)Name("org.jboss.seam.ioc.guice.init")
-(a)Scope(ScopeType.APPLICATION)
-@Startup
-@Install(precedence = FRAMEWORK, classDependencies =
"com.google.inject.Injector")
-@BypassInterceptors
-public class GuiceInit implements Serializable
-{
- private static final long serialVersionUID = -1517814449129434488L;
-
- private Injector injector;
-
- public Injector getInjector()
- {
- return injector;
- }
-
- public void setInjector(Injector injector)
- {
- this.injector = injector;
- }
-
- @Override
- public String toString()
- {
- return "org.jboss.seam.ioc.guice.init(" + injector + ")";
- }
-}
Deleted:
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInterceptor.java
===================================================================
---
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInterceptor.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/GuiceInterceptor.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,166 +0,0 @@
-package org.jboss.seam.ioc.guice;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.util.Reflections;
-import org.jboss.seam.util.Strings;
-import org.jboss.seam.annotations.intercept.AroundInvoke;
-import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.core.Expressions;
-import org.jboss.seam.intercept.InvocationContext;
-import org.jboss.seam.intercept.AbstractInterceptor;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.log.Logging;
-
-import com.google.inject.Injector;
-import com.google.inject.Inject;
-
-import java.lang.reflect.Field;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Triggers Guice injection on a Seam component.
- *
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- * @author Tomasz Szymanski (tszymanski [at]
jboss.org)
- */
-@Interceptor
-public class GuiceInterceptor extends AbstractInterceptor
-{
- private static final Log log = Logging.getLog(GuiceInterceptor.class);
-
- private static final long serialVersionUID = -6716553117162905303L;
-
- private static final String GUICE_COMPONENT_FIELDS_MAP =
"org.jboss.seam.GuiceComponentFieldsMap";
-
- private transient Injector defaultInjector = null;
-
- @AroundInvoke
- public Object aroundInvoke(InvocationContext invocationContext) throws Exception
- {
- inject(invocationContext.getTarget());
-
- Object result = invocationContext.proceed();
-
- disinject(invocationContext.getTarget());
-
- return result;
- }
-
- private void inject(Object target)
- {
- if (log.isTraceEnabled())
- {
- log.trace("Injecting members of component '#0'",
getComponent().getName());
- }
-
- getGuiceInjector().injectMembers(target);
- }
-
- private void disinject(Object target) throws Exception
- {
- for (Field guiceField : getGuiceAnnotatedFields())
- {
- if (!guiceField.isAccessible())
- {
- guiceField.setAccessible(true);
- }
- Reflections.set(guiceField, target, null);
- }
- }
-
- /**
- * @return a Guice injector for the current component
- */
- private Injector getGuiceInjector()
- {
- final String expr;
- Guice guice = getComponent().getBeanClass().getAnnotation(Guice.class);
- if (guice != null) {
- expr = guice.value();
- }
- else {
- expr = null;
- }
-
- // Optimize lookups for default injector
- return Strings.isEmpty(expr)
- ? getCachedDefaultInjector() : getInjectorByName(expr);
- }
-
- private Injector getCachedDefaultInjector()
- {
- if (defaultInjector == null)
- {
- GuiceInit init = (GuiceInit) Component.getInstance(GuiceInit.class);
-
- if (init != null)
- {
- defaultInjector = init.getInjector();
- }
-
- if (defaultInjector == null)
- {
- throw new IllegalStateException("Default Guice injector not
specified.");
- }
- }
-
- return defaultInjector;
- }
-
- private static Injector getInjectorByName(final String expr)
- {
- Object result;
-
- if (expr.startsWith("#"))
- {
- result = Expressions.instance().createValueExpression(expr).getValue();
- }
- else
- {
- result = Component.getInstance(expr);
- }
-
- if (!(result instanceof Injector))
- {
- throw new IllegalArgumentException("Expression '" + expr +
"' does not evaluate to a Guice injector.");
- }
-
- return (Injector) result;
- }
-
- /**
- * @return a collection of all component fields injected by Guice (annotated with the
@Inject annotation)
- */
- private Collection<Field> getGuiceAnnotatedFields()
- {
- final Map<Class,Collection<Field>> fieldsMap =
getGuiceComponentFieldsMap();
- Collection<Field> annotatedFields =
fieldsMap.get(getComponent().getBeanClass());
- if (annotatedFields == null)
- {
- annotatedFields = Reflections.getFields(getComponent().getBeanClass(),
Inject.class);
- fieldsMap.put(getComponent().getBeanClass(), annotatedFields);
- }
- return annotatedFields;
- }
-
- /**
- * @return a cache that stores fields annotated with the @Inject annotation for the
Guice component classes
- */
- @SuppressWarnings("unchecked")
- private Map<Class,Collection<Field>> getGuiceComponentFieldsMap()
- {
- if (Contexts.getApplicationContext().get(GUICE_COMPONENT_FIELDS_MAP) == null)
- {
- Contexts.getApplicationContext().set(GUICE_COMPONENT_FIELDS_MAP, new
HashMap<Class, Collection<Field>>());
- }
- return (Map<Class, Collection<Field>>)
Contexts.getApplicationContext().get(GUICE_COMPONENT_FIELDS_MAP);
- }
-
- public boolean isInterceptorEnabled()
- {
- return true;
- }
-}
Deleted:
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Injector.java
===================================================================
---
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Injector.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/Injector.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,93 +0,0 @@
-package org.jboss.seam.ioc.guice;
-
-import com.google.inject.Guice;
-import com.google.inject.Module;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.*;
-import static org.jboss.seam.annotations.Install.FRAMEWORK;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Creates Guice injector from a list of modules.
- *
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-(a)Name("org.jboss.seam.ioc.guice.injector")
-(a)Scope(ScopeType.APPLICATION)
-@Startup
-@Install(value=false, precedence = FRAMEWORK)
-public class Injector implements Serializable
-{
- private static final long serialVersionUID = 8935525407647910950L;
-
- private static final LogProvider log = Logging.getLogProvider(Injector.class);
-
- private String[] modules;
-
- private com.google.inject.Injector injector = null;
-
- @Unwrap
- public com.google.inject.Injector getInjector()
- {
- return injector;
- }
-
- @Create
- public void createInjector() throws IllegalAccessException, InstantiationException,
ClassNotFoundException
- {
- if ((modules == null) || (modules.length == 0))
- {
- throw new IllegalArgumentException("No Guice module specified.");
- }
-
- log.debug("Creating injector '" +
- "'from modules: " + Arrays.toString(modules));
-
- final List<Module> moduleList = getModuleList(modules);
-
- injector = Guice.createInjector(moduleList);
- }
-
- private static List<Module> getModuleList(String[] modules) throws
IllegalAccessException, InstantiationException, ClassNotFoundException
- {
- List<Module> moduleList = new ArrayList<Module>();
-
- for (String m : modules)
- {
- Module module = getModule(m);
- moduleList.add(module);
- }
-
- return moduleList;
- }
-
- private static Module getModule(String className)
- {
- try
- {
- final Class<?> clazz = Class.forName(className, true,
Thread.currentThread().getContextClassLoader());
-
- return (Module) clazz.newInstance();
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Unable to create guice module: " +
className, e);
- }
- }
-
- public String[] getModules()
- {
- return modules;
- }
-
- public void setModules(String[] modules)
- {
- this.modules = modules;
- }
-}
Deleted:
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/package-info.java
===================================================================
---
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/package-info.java 2012-06-09
18:13:25 UTC (rev 14882)
+++
branches/enterprise/WFK-2_0/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/guice/package-info.java 2012-06-09
18:48:05 UTC (rev 14883)
@@ -1,6 +0,0 @@
-@Namespace(value="http://jboss.org/schema/seam/guice", prefix =
"org.jboss.seam.ioc.guice")
-@AutoCreate
-package org.jboss.seam.ioc.guice;
-
-import org.jboss.seam.annotations.Namespace;
-import org.jboss.seam.annotations.AutoCreate;