You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2012/01/30 03:26:49 UTC
svn commit: r803543 - in /websites/production/openejb: ./
content/examples-trunk/ content/examples-trunk/cdi-application-scope/
content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/
content/examples-trunk/cdi-app...
Author: dblevins
Date: Mon Jan 30 02:26:48 2012
New Revision: 803543
Log:
Publishing merge to openejb site by dblevins
Modified:
websites/production/openejb/ (props changed)
websites/production/openejb/content/examples-trunk/cdi-application-scope/README.html
websites/production/openejb/content/examples-trunk/cdi-application-scope/pom.xml
websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java
websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java
websites/production/openejb/content/examples-trunk/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java
websites/production/openejb/content/examples-trunk/cdi-request-scope/README.html
websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java
websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java
websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java
websites/production/openejb/content/examples-trunk/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java
websites/production/openejb/content/examples-trunk/index.html
websites/production/openejb/content/examples-trunk/pom.xml
Propchange: websites/production/openejb/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 30 02:26:48 2012
@@ -1 +1 @@
-/websites/staging/openejb/trunk:790824-803538
+/websites/staging/openejb/trunk:790824-803542
Modified: websites/production/openejb/content/examples-trunk/cdi-application-scope/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-application-scope/README.html (original)
+++ websites/production/openejb/content/examples-trunk/cdi-application-scope/README.html Mon Jan 30 02:26:48 2012
@@ -114,48 +114,48 @@ the application scope is used. </p>
and sets the name for the <code>soup</code> field. The <code>orderWhatTheOtherGuyHad()</code> method returns
the name of the <code>soup</code> field.</p>
-<p>@Stateless
-public class Waiter {</p>
+<pre><code>@Stateless
+public class Waiter {
-<pre><code>@Inject
-public Soup soup;
+ @Inject
+ public Soup soup;
-public String orderSoup(String name){
- soup.setName(name);
- return soup.getName();
-}
-
-public String orderWhatTheOtherGuyHad() {
- String name = soup.getName();
- return name;
+ public String orderSoup(String name){
+ soup.setName(name);
+ return soup.getName();
+ }
+
+ public String orderWhatTheOtherGuyHad() {
+ String name = soup.getName();
+ return name;
+ }
}
</code></pre>
-<p></div></p>
-
<h2>Soup</h2>
<p>The <code>Soup</code> class is an injectable POJO, defined as <code>@ApplicationScoped</code>. This means that an instance
will be created only once for the duration of the whole application. Try changing the <code>@ApplicationScoped</code>
annotation to <code>@RequestScoped</code> and see what happens.</p>
-<p>@ApplicationScoped
-public class Soup {</p>
+<pre><code>@ApplicationScoped
+public class Soup {
-<pre><code>private String name = "Soup of the day";
+ private String name = "Soup of the day";
-@PostConstruct
-public void afterCreate() {
- System.out.println("Soup created");
+ @PostConstruct
+ public void afterCreate() {
+ System.out.println("Soup created");
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name){
+ this.name = name;
+ }
}
-
-public String getName() {
- return name;
-}
-
-public void setName(String name){
- this.name = name;
-</div>}
</code></pre>
<h1>Test Case</h1>
@@ -164,33 +164,34 @@ public void setName(String name){
This initiates the <code>soup</code> field. Next, <code>orderWhatTheOtherGuyHad()</code> method returns the soup
from the application context.</p>
-<p>public class RestaurantTest {</p>
+<pre><code>public class RestaurantTest {
-<pre><code>private static String TOMATO_SOUP = "Tomato Soup";
-private EJBContainer container;
+ private static String TOMATO_SOUP = "Tomato Soup";
+ private EJBContainer container;
-@EJB
-private Waiter joe;
+ @EJB
+ private Waiter joe;
-@Before
-public void startContainer() throws Exception {
- container = EJBContainer.createEJBContainer();
- container.getContext().bind("inject", this);
+ @Before
+ public void startContainer() throws Exception {
+ container = EJBContainer.createEJBContainer();
+ container.getContext().bind("inject", this);
+ }
+
+ @Test
+ public void orderSoup(){
+ String someSoup = joe.orderSoup(TOMATO_SOUP);
+ assertEquals(TOMATO_SOUP, someSoup);
+
+ String sameSoup = joe.orderWhatTheOtherGuyHad();
+ assertEquals(TOMATO_SOUP, sameSoup);
+ }
+
+ @After
+ public void closeContainer() throws Exception {
+ container.close();
+ }
}
-
-@Test
-public void orderSoup(){
- String someSoup = joe.orderSoup(TOMATO_SOUP);
- assertEquals(TOMATO_SOUP, someSoup);
-
- String sameSoup = joe.orderWhatTheOtherGuyHad();
- assertEquals(TOMATO_SOUP, sameSoup);
-}
-
-@After
-public void closeContainer() throws Exception {
- container.close();
-</div>}
</code></pre>
<h1>Running</h1>
@@ -198,11 +199,10 @@ public void closeContainer() throws Exce
<p>In the output you can see that there is just one <code>Soup</code> instance created - one for
the whole application.</p>
-<hr />
-
-<h2> T E S T S</h2>
-
-<p>Running org.superbiz.cdi.applicationscope.RestaurantTest
+<pre><code>-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.superbiz.cdi.applicationscope.RestaurantTest
Apache OpenEJB 4.0.0-beta-2-SNAPSHOT build: 20111224-11:09
http://openejb.apache.org/
INFO - openejb.home = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
@@ -226,11 +226,12 @@ INFO - Started Ejb(deployment-id=Waiter,
INFO - Deployed Application(path=c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope)
Soup created
INFO - Undeploying app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.42 sec</p>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.42 sec
-<p>Results :</p>
+Results :
-<p>Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</p>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+</code></pre>
<div class="page-header"> </div>
Modified: websites/production/openejb/content/examples-trunk/cdi-application-scope/pom.xml
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-application-scope/pom.xml (original)
+++ websites/production/openejb/content/examples-trunk/cdi-application-scope/pom.xml Mon Jan 30 02:26:48 2012
@@ -9,45 +9,45 @@
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<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>org.superbiz</groupId>
- <artifactId>cdi-application-scope</artifactId>
- <version>1.0-SNAPSHOT</version>
+ 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>org.superbiz</groupId>
+ <artifactId>cdi-application-scope</artifactId>
+ <version>1.0-SNAPSHOT</version>
- <build>
- <defaultGoal>install</defaultGoal>
- <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>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <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>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>javaee-api</artifactId>
- <version>6.0-3</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-core</artifactId>
- <version>4.0.0-beta-3-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>6.0-3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-core</artifactId>
+ <version>4.0.0-beta-3-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
Modified: websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java Mon Jan 30 02:26:48 2012
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.superbiz.cdi.applicationscope;
import javax.annotation.PostConstruct;
@@ -6,18 +22,18 @@ import javax.enterprise.context.Applicat
@ApplicationScoped
public class Soup {
- private String name = "Soup of the day";
+ private String name = "Soup of the day";
- @PostConstruct
- public void afterCreate() {
- System.out.println("Soup created");
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name){
- this.name = name;
- }
+ @PostConstruct
+ public void afterCreate() {
+ System.out.println("Soup created");
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
}
Modified: websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java Mon Jan 30 02:26:48 2012
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.superbiz.cdi.applicationscope;
import javax.ejb.Stateless;
@@ -5,18 +21,18 @@ import javax.inject.Inject;
@Stateless
public class Waiter {
-
- @Inject
- public Soup soup;
-
- public String orderSoup(String name){
- soup.setName(name);
- return soup.getName();
- }
-
- public String orderWhatTheOtherGuyHad() {
- String name = soup.getName();
- return name;
- }
+
+ @Inject
+ public Soup soup;
+
+ public String orderSoup(String name) {
+ soup.setName(name);
+ return soup.getName();
+ }
+
+ public String orderWhatTheOtherGuyHad() {
+ String name = soup.getName();
+ return name;
+ }
}
Modified: websites/production/openejb/content/examples-trunk/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java Mon Jan 30 02:26:48 2012
@@ -1,39 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.superbiz.cdi.applicationscope;
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import static org.junit.Assert.*;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.superbiz.cdi.applicationscope.Waiter;
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+import static org.junit.Assert.*;
+
public class RestaurantTest {
-
- private static String TOMATO_SOUP = "Tomato Soup";
- private EJBContainer container;
-
- @EJB
- private Waiter joe;
-
- @Before
+
+ private static String TOMATO_SOUP = "Tomato Soup";
+ private EJBContainer container;
+
+ @EJB
+ private Waiter joe;
+
+ @Before
public void startContainer() throws Exception {
container = EJBContainer.createEJBContainer();
container.getContext().bind("inject", this);
}
-
- @Test
- public void orderSoup(){
- String someSoup = joe.orderSoup(TOMATO_SOUP);
- assertEquals(TOMATO_SOUP, someSoup);
-
- String sameSoup = joe.orderWhatTheOtherGuyHad();
- assertEquals(TOMATO_SOUP, sameSoup);
- }
-
- @After
- public void closeContainer() throws Exception {
- container.close();
- }
+
+ @Test
+ public void orderSoup() {
+ String someSoup = joe.orderSoup(TOMATO_SOUP);
+ assertEquals(TOMATO_SOUP, someSoup);
+
+ String sameSoup = joe.orderWhatTheOtherGuyHad();
+ assertEquals(TOMATO_SOUP, sameSoup);
+ }
+
+ @After
+ public void closeContainer() throws Exception {
+ container.close();
+ }
}
Modified: websites/production/openejb/content/examples-trunk/cdi-request-scope/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-request-scope/README.html (original)
+++ websites/production/openejb/content/examples-trunk/cdi-request-scope/README.html Mon Jan 30 02:26:48 2012
@@ -115,45 +115,45 @@ A <code>Soup</code> insance will be crea
the <code>Chef</code> bean. The method passes the request to the <code>Chef</code> bean. It then returns the name of
the soup to the test class. </p>
-<p>@Stateless
-public class Waiter {</p>
+<pre><code>@Stateless
+public class Waiter {
-<pre><code>@Inject
-private Soup soup;
+ @Inject
+ private Soup soup;
-@EJB
-private Chef chef;
+ @EJB
+ private Chef chef;
-public String orderSoup(String name){
- soup.setName(name);
- return chef.prepareSoup().getName();
+ public String orderSoup(String name){
+ soup.setName(name);
+ return chef.prepareSoup().getName();
+ }
}
</code></pre>
-<p></div></p>
-
<h2>Soup</h2>
<p>The <code>Soup</code> class is an injectable POJO, defined as <code>@RequestScoped</code>. This means that an instance
will be created only once for every request and will be shared by all the beans injecting it.</p>
-<p>@RequestScoped
-public class Soup {</p>
-
-<pre><code>private String name = "Soup of the day";
+<pre><code>@RequestScoped
+public class Soup {
-@PostConstruct
-public void afterCreate() {
- System.out.println("Soup created");
-}
+ private String name = "Soup of the day";
-public String getName() {
- return name;
+ @PostConstruct
+ public void afterCreate() {
+ System.out.println("Soup created");
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name){
+ this.name = name;
+ }
}
-
-public void setName(String name){
- this.name = name;
-</div>}
</code></pre>
<h2>Chef</h2>
@@ -162,47 +162,49 @@ public void setName(String name){
parameter would be passed as a <code>prepareSoup()</code> argument, but for the need of this example
it's passed by the request context. </p>
-<p>@Stateless
-public class Chef {</p>
+<pre><code>@Stateless
+public class Chef {
-<pre><code>@Inject
-private Soup soup;
+ @Inject
+ private Soup soup;
-public Soup prepareSoup() {
- return soup;
-</div>}
+ public Soup prepareSoup() {
+ return soup;
+ }
+}
</code></pre>
<h1>Test Case</h1>
<p>This is the entry class for this example.</p>
-<p>public class RestaurantTest {</p>
+<pre><code>public class RestaurantTest {
-<pre><code>private static String TOMATO_SOUP = "Tomato Soup";
-private EJBContainer container;
+ private static String TOMATO_SOUP = "Tomato Soup";
+ private EJBContainer container;
-@EJB
-private Waiter joe;
+ @EJB
+ private Waiter joe;
-@Before
-public void startContainer() throws Exception {
- container = EJBContainer.createEJBContainer();
- container.getContext().bind("inject", this);
+ @Before
+ public void startContainer() throws Exception {
+ container = EJBContainer.createEJBContainer();
+ container.getContext().bind("inject", this);
+ }
+
+ @Test
+ public void orderSoup(){
+ String soup = joe.orderSoup(TOMATO_SOUP);
+ assertEquals(TOMATO_SOUP, soup);
+ soup = joe.orderSoup(POTATO_SOUP);
+ assertEquals(POTATO_SOUP, soup);
+ }
+
+ @After
+ public void closeContainer() throws Exception {
+ container.close();
+ }
}
-
-@Test
-public void orderSoup(){
- String soup = joe.orderSoup(TOMATO_SOUP);
- assertEquals(TOMATO_SOUP, soup);
- soup = joe.orderSoup(POTATO_SOUP);
- assertEquals(POTATO_SOUP, soup);
-}
-
-@After
-public void closeContainer() throws Exception {
- container.close();
-</div>}
</code></pre>
<h1>Running</h1>
@@ -210,11 +212,10 @@ public void closeContainer() throws Exce
<p>In the output you can see that there were two <code>Soup</code> instances created - one for
each request.</p>
-<hr />
-
-<h2> T E S T S</h2>
-
-<p>Running org.superbiz.cdi.requestscope.RestaurantTest
+<pre><code>-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.superbiz.cdi.requestscope.RestaurantTest
Apache OpenEJB 4.0.0-beta-2-SNAPSHOT build: 20111224-11:09
http://openejb.apache.org/
INFO - openejb.home = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
@@ -243,11 +244,12 @@ INFO - Deployed Application(path=c:\User
Soup created
Soup created
INFO - Undeploying app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.412 sec</p>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.412 sec
-<p>Results :</p>
+Results :
-<p>Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</p>
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+</code></pre>
<div class="page-header"> </div>
Modified: websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java Mon Jan 30 02:26:48 2012
@@ -21,11 +21,11 @@ import javax.inject.Inject;
@Stateless
public class Chef {
-
- @Inject
- private Soup soup;
-
- public Soup prepareSoup() {
- return soup;
- }
+
+ @Inject
+ private Soup soup;
+
+ public Soup prepareSoup() {
+ return soup;
+ }
}
Modified: websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java Mon Jan 30 02:26:48 2012
@@ -22,18 +22,18 @@ import javax.enterprise.context.RequestS
@RequestScoped
public class Soup {
- private String name = "Soup of the day";
+ private String name = "Soup of the day";
- @PostConstruct
- public void afterCreate() {
- System.out.println("Soup created");
- }
+ @PostConstruct
+ public void afterCreate() {
+ System.out.println("Soup created");
+ }
- public String getName() {
- return name;
- }
-
- public void setName(String name){
- this.name = name;
- }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
}
Modified: websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java Mon Jan 30 02:26:48 2012
@@ -22,16 +22,16 @@ import javax.inject.Inject;
@Stateless
public class Waiter {
-
- @Inject
- private Soup soup;
-
- @EJB
- private Chef chef;
-
- public String orderSoup(String name){
- soup.setName(name);
- return chef.prepareSoup().getName();
- }
+
+ @Inject
+ private Soup soup;
+
+ @EJB
+ private Chef chef;
+
+ public String orderSoup(String name) {
+ soup.setName(name);
+ return chef.prepareSoup().getName();
+ }
}
Modified: websites/production/openejb/content/examples-trunk/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java (original)
+++ websites/production/openejb/content/examples-trunk/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java Mon Jan 30 02:26:48 2012
@@ -16,39 +16,40 @@
*/
package org.superbiz.cdi.requestscope;
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import static org.junit.Assert.assertEquals;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+import static org.junit.Assert.assertEquals;
+
public class RestaurantTest {
-
- private static final String TOMATO_SOUP = "Tomato Soup";
- private static final String POTATO_SOUP = "Potato Soup";
- private EJBContainer container;
-
- @EJB
- private Waiter joe;
-
- @Before
+
+ private static final String TOMATO_SOUP = "Tomato Soup";
+ private static final String POTATO_SOUP = "Potato Soup";
+ private EJBContainer container;
+
+ @EJB
+ private Waiter joe;
+
+ @Before
public void startContainer() throws Exception {
container = EJBContainer.createEJBContainer();
container.getContext().bind("inject", this);
}
-
- @Test
- public void orderSoup(){
- String soup = joe.orderSoup(TOMATO_SOUP);
- assertEquals(TOMATO_SOUP, soup);
- soup = joe.orderSoup(POTATO_SOUP);
- assertEquals(POTATO_SOUP, soup);
- }
-
- @After
- public void closeContainer() throws Exception {
- container.close();
- }
+
+ @Test
+ public void orderSoup() {
+ String soup = joe.orderSoup(TOMATO_SOUP);
+ assertEquals(TOMATO_SOUP, soup);
+ soup = joe.orderSoup(POTATO_SOUP);
+ assertEquals(POTATO_SOUP, soup);
+ }
+
+ @After
+ public void closeContainer() throws Exception {
+ container.close();
+ }
}
Modified: websites/production/openejb/content/examples-trunk/index.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/index.html (original)
+++ websites/production/openejb/content/examples-trunk/index.html Mon Jan 30 02:26:48 2012
@@ -112,6 +112,8 @@
<ul>
<li><a href="cdi-basic/README.html">cdi-basic</a></li>
+<li><a href="cdi-request-scoped/README.html">cdi-request-scoped</a></li>
+<li><a href="cdi-application-scoped/README.html">cdi-application-scoped</a></li>
<li><a href="cdi-interceptors/README.html">cdi-interceptors</a></li>
<li><a href="cdi-produces-disposes/README.html">cdi-produces-disposes</a></li>
<li><a href="decorators/README.html">decorators</a></li>
Modified: websites/production/openejb/content/examples-trunk/pom.xml
==============================================================================
--- websites/production/openejb/content/examples-trunk/pom.xml (original)
+++ websites/production/openejb/content/examples-trunk/pom.xml Mon Jan 30 02:26:48 2012
@@ -17,7 +17,7 @@
limitations under the License.
-->
<!--test 2-->
-<!-- $Rev: 1237516 $ $Date: 2012-01-30 00:48:17 +0000 (Mon, 30 Jan 2012) $ -->
+<!-- $Rev: 1237532 $ $Date: 2012-01-30 02:23:34 +0000 (Mon, 30 Jan 2012) $ -->
<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>
@@ -41,6 +41,8 @@
<module>cdi-basic</module>
<module>cdi-events</module>
<module>cdi-interceptors</module>
+ <module>cdi-request-scope</module>
+ <module>cdi-application-scope</module>
<module>cdi-produces-disposes</module>
<module>component-interfaces</module>
<module>custom-injection</module>
@@ -105,7 +107,7 @@
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2.2</version>
+ <version>2.2.2</version>
<inherited>false</inherited>
<configuration>
<descriptors>