[seam/forge] 1e107a: @ProjectScoped is now functional. mvn plugin now e...
by noreply@github.com
Branch: refs/heads/master
Home: https://github.com/seam/forge
Commit: 1e107a371096eef81c41766ab8c3487bd822896d
https://github.com/seam/forge/commit/1e107a371096eef81c41766ab8c3487bd822...
Author: Lincoln Baxter, III <lincolnbaxter(a)gmail.com>
Date: 2011-01-25 (Tue, 25 Jan 2011)
Changed paths:
M project-model/src/main/java/org/jboss/seam/forge/project/Project.java
M project-model/src/main/java/org/jboss/seam/forge/project/model/ProjectImpl.java
M shell-api/src/main/java/org/jboss/seam/forge/shell/project/ProjectScoped.java
M shell/src/main/java/org/jboss/seam/forge/shell/plugins/builtin/MvnShellPlugin.java
M shell/src/main/java/org/jboss/seam/forge/shell/project/CurrentProject.java
M shell/src/main/java/org/jboss/seam/forge/shell/project/ProjectScopedContext.java
M shell/src/main/java/org/jboss/seam/forge/shell/project/ProjectScopedExtension.java
Log Message:
-----------
@ProjectScoped is now functional. mvn plugin now enables setting/removing parent POM information
Commit: 479b323f3ebe08fa950b014d4161e6c23d1b3a27
https://github.com/seam/forge/commit/479b323f3ebe08fa950b014d4161e6c23d1b...
Author: Lincoln Baxter, III <lincolnbaxter(a)gmail.com>
Date: 2011-01-26 (Wed, 26 Jan 2011)
Changed paths:
M project-model-tests/src/test/java/org/jboss/seam/forge/test/project/services/ProjectFactoryTest.java
M test-harness/src/main/java/org/jboss/seam/forge/test/AbstractShellTest.java
Log Message:
-----------
test still failing, weld issue?
Commit: f63a41b1bf6f0de6086511275c0127fd2c4900fe
https://github.com/seam/forge/commit/f63a41b1bf6f0de6086511275c0127fd2c49...
Author: Lincoln Baxter, III <lincolnbaxter(a)gmail.com>
Date: 2011-01-26 (Wed, 26 Jan 2011)
Changed paths:
M event-bus/pom.xml
M pom.xml
M project-model-tests/src/test/java/org/jboss/seam/forge/test/project/services/ProjectFactoryTest.java
M project-model/pom.xml
M project-model/src/main/java/org/jboss/seam/forge/project/model/ProjectImpl.java
M shell-api/pom.xml
M shell/pom.xml
M shell/src/main/java/org/jboss/seam/forge/shell/ShellImpl.java
M shell/src/main/java/org/jboss/seam/forge/shell/project/resources/ResourceProducerExtension.java
R shell/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
M test-harness/pom.xml
M test-harness/src/main/java/org/jboss/seam/forge/test/impl/LoggerProducer.java
Log Message:
-----------
upgraded to weld 1.1.0.Final
Commit: 2d89b4d7e65d56fa745404b465bc46c24f6551eb
https://github.com/seam/forge/commit/2d89b4d7e65d56fa745404b465bc46c24f65...
Author: Lincoln Baxter, III <lincolnbaxter(a)gmail.com>
Date: 2011-01-26 (Wed, 26 Jan 2011)
Changed paths:
M j2ee-plugins/src/test/java/org/jboss/seam/forge/spec/jpa/PersistenceFacetTest.java
M project-model-tests/src/test/java/org/jboss/seam/forge/test/project/services/ProjectFactoryTest.java
M project-model/src/main/java/org/jboss/seam/forge/project/Project.java
M test-harness/src/main/java/org/jboss/seam/forge/test/AbstractShellTest.java
Log Message:
-----------
fixed test failures
13 years, 11 months
Seam SVN: r14028 - in branches/community/Seam_2_2/src/test/ftest: src/main/org/jboss/seam/example/common/test/booking/cluster/selenium and 1 other directories.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2011-01-26 11:30:43 -0500 (Wed, 26 Jan 2011)
New Revision: 14028
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/build.xml
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/FailoverTest.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
Log:
JBSEAM-4771, fix failover cluster test for booking for JBossAS 6
Modified: branches/community/Seam_2_2/src/test/ftest/examples/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/build.xml 2011-01-26 15:00:27 UTC (rev 14027)
+++ branches/community/Seam_2_2/src/test/ftest/examples/build.xml 2011-01-26 16:30:43 UTC (rev 14028)
@@ -161,6 +161,7 @@
<sysproperty key="openid.password" value="${openid.password}" />
<sysproperty key="seam.dir" value="${seam.dir}" />
<sysproperty key="jboss.home" value="${container.home}" />
+ <sysproperty key="container" value="${container}" />
</testng>
</target>
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/FailoverTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/FailoverTest.java 2011-01-26 15:00:27 UTC (rev 14027)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/cluster/selenium/FailoverTest.java 2011-01-26 16:30:43 UTC (rev 14028)
@@ -115,8 +115,17 @@
public void shutdownMasterJBossInstance()
{
- String command = JBOSS_HOME + "/bin/shutdown.sh -s localhost:1099 -S";
- //System.out.println("Command:" + command);
+ String command = "";
+
+ if (CONTAINER.contains("jboss6"))
+ {
+ command = JBOSS_HOME + "/bin/shutdown.sh -s service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi -S";
+ }
+ else
+ {
+ command = JBOSS_HOME + "/bin/shutdown.sh -s localhost:1099 -S";
+ }
+
try
{
Process process = Runtime.getRuntime().exec(command);
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2011-01-26 15:00:27 UTC (rev 14027)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2011-01-26 16:30:43 UTC (rev 14028)
@@ -55,6 +55,7 @@
protected static String APP_NAME;
protected static String OUTPUT_DIR;
protected static String JBOSS_HOME;
+ protected static String CONTAINER;
//protected SeamSelenium
@@ -63,9 +64,10 @@
@BeforeClass
@Parameters( { "selenium.host", "selenium.server.port", "selenium.browser",
"selenium.browser.url", "selenium.speed", "selenium.timeout",
- "PROPERTY_FILE", "example.context.path", "seam.dir", "jboss.home" })
+ "PROPERTY_FILE", "example.context.path", "seam.dir", "jboss.home", "container"})
public void setParameters(String host, String port, String browser,
- String browserUrl, String speed, String timeout, String propertyFile, @Optional("") String contextPath, String seamDir, String jbossHome) {
+ String browserUrl, String speed, String timeout, String propertyFile,
+ @Optional("") String contextPath, String seamDir, String jbossHome, String container) {
HOST = host;
PORT = Integer.parseInt(port);
BROWSER = browser;
@@ -77,6 +79,7 @@
SEAM_DIR = seamDir;
OUTPUT_DIR = SEAM_DIR + "/test-output/functional-framework";
JBOSS_HOME = jbossHome;
+ CONTAINER = container;
}
@BeforeMethod
13 years, 11 months
Seam SVN: r14027 - in branches/enterprise/JBPAPP_5_0: examples/tasks/resources/WEB-INF and 2 other directories.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2011-01-26 10:00:27 -0500 (Wed, 26 Jan 2011)
New Revision: 14027
Modified:
branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java
branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
branches/enterprise/JBPAPP_5_0/examples/tasks/resources/WEB-INF/components.xml
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/SeamTest.java
branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
Log:
JBPAPP-5823
Modified: branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2011-01-26 14:52:40 UTC (rev 14026)
+++ branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2011-01-26 15:00:27 UTC (rev 14027)
@@ -39,6 +39,8 @@
// Just verify we can do that, even if it doesn't make much sense
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1/category").run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, "/restv1/category")
{
@@ -54,6 +56,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, "/restv1/category/1")
{
@@ -84,6 +88,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, "/restv1/auction/19264723")
{
Modified: branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2011-01-26 14:52:40 UTC (rev 14026)
+++ branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2011-01-26 15:00:27 UTC (rev 14027)
@@ -161,6 +161,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoquery")
{
@@ -181,6 +183,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoheader")
{
@@ -199,6 +203,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echocookie")
{
@@ -217,6 +223,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/foo/bar/asdf")
{
@@ -230,6 +238,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echotwoparams/foo/bar")
{
@@ -282,6 +292,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams2")
{
@@ -301,6 +313,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams3")
{
@@ -321,6 +335,8 @@
}
}.run();
+
+ reset();
}
@@ -365,6 +381,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedStrings")
{
@@ -383,6 +401,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedIntegers")
{
Modified: branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2011-01-26 14:52:40 UTC (rev 14026)
+++ branches/enterprise/JBPAPP_5_0/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2011-01-26 15:00:27 UTC (rev 14027)
@@ -106,6 +106,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
@@ -144,7 +146,9 @@
}
}.run();
-
+
+ reset();
+
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
Modified: branches/enterprise/JBPAPP_5_0/examples/tasks/resources/WEB-INF/components.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/tasks/resources/WEB-INF/components.xml 2011-01-26 14:52:40 UTC (rev 14026)
+++ branches/enterprise/JBPAPP_5_0/examples/tasks/resources/WEB-INF/components.xml 2011-01-26 15:00:27 UTC (rev 14027)
@@ -43,7 +43,7 @@
entity-class="org.jboss.seam.example.tasks.entity.Category"
media-types="application/xml application/json application/fastinfoset"/>
- <resteasy:application resource-path-prefix="/v1">
+ <resteasy:application resource-path-prefix="/v1" destroy-session-after-request="false">
<resteasy:media-type-mappings>
<key>xml</key>
<value>application/xml</value>
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/SeamTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/SeamTest.java 2011-01-26 14:52:40 UTC (rev 14026)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/mock/SeamTest.java 2011-01-26 15:00:27 UTC (rev 14027)
@@ -19,6 +19,7 @@
* @author Gavin King
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author Mike Youngstrom
+ * @author <a href="http://community.jboss.org/people/jharting">Jozef Hartinger</a>
*/
public class SeamTest extends AbstractSeamTest
{
@@ -37,6 +38,16 @@
super.end();
}
+ /**
+ * Call this method within a test method to end the previous
+ * mock session and start another one.
+ */
+ public void reset()
+ {
+ end();
+ begin();
+ }
+
@Override
@BeforeClass
public void setupClass() throws Exception
Modified: branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2011-01-26 14:52:40 UTC (rev 14026)
+++ branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2011-01-26 15:00:27 UTC (rev 14027)
@@ -21,6 +21,8 @@
*/
package org.jboss.seam.resteasy;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -44,6 +46,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@@ -62,6 +65,7 @@
@Scope(ScopeType.APPLICATION)
@Name("org.jboss.seam.resteasy.resourceAdapter")
@BypassInterceptors
+@Install(precedence = BUILT_IN)
public class ResteasyResourceAdapter extends AbstractResource
{
@@ -118,34 +122,36 @@
@Override
public void process() throws ServletException, IOException
{
+ try
+ {
+ HttpHeaders headers = ServletUtil.extractHttpHeaders(request);
+ UriInfoImpl uriInfo = extractUriInfo(request, application.getResourcePathPrefix());
- HttpHeaders headers = ServletUtil.extractHttpHeaders(request);
- UriInfoImpl uriInfo = extractUriInfo(request, application.getResourcePathPrefix());
+ HttpResponse theResponse = new HttpServletResponseWrapper(
+ response,
+ dispatcher.getProviderFactory()
+ );
- HttpResponse theResponse = new HttpServletResponseWrapper(
- response,
- dispatcher.getProviderFactory()
- );
+ // TODO: This requires a SynchronousDispatcher
+ HttpRequest in = new HttpServletInputMessage(
+ request,
+ theResponse,
+ headers,
+ uriInfo,
+ request.getMethod().toUpperCase(),
+ (SynchronousDispatcher) dispatcher
+ );
- // TODO: This requires a SynchronousDispatcher
- HttpRequest in = new HttpServletInputMessage(
- request,
- theResponse,
- headers,
- uriInfo,
- request.getMethod().toUpperCase(),
- (SynchronousDispatcher) dispatcher
- );
-
- dispatcher.invoke(in, theResponse);
-
- // Prevent anemic sessions clog up the server
- if (request.getSession().isNew()
- && application.isDestroySessionAfterRequest()
- && !Session.instance().isInvalid())
+ dispatcher.invoke(in, theResponse);
+ }
+ finally
{
- log.debug("Destroying HttpSession after REST request");
- Session.instance().invalidate();
+ // Prevent anemic sessions clog up the server
+ if (application.isDestroySessionAfterRequest())
+ {
+ log.debug("Destroying HttpSession after REST request");
+ Session.instance().invalidate();
+ }
}
}
}.run();
13 years, 11 months
Seam SVN: r14026 - in branches/community/Seam_2_2: examples/tasks/resources/WEB-INF and 2 other directories.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2011-01-26 09:52:40 -0500 (Wed, 26 Jan 2011)
New Revision: 14026
Modified:
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml
branches/community/Seam_2_2/src/main/org/jboss/seam/mock/SeamTest.java
branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
Log:
JBSEAM-4770
Modified: branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
===================================================================
--- branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2011-01-25 15:30:54 UTC (rev 14025)
+++ branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2011-01-26 14:52:40 UTC (rev 14026)
@@ -39,6 +39,8 @@
// Just verify we can do that, even if it doesn't make much sense
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1/category").run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, "/restv1/category")
{
@@ -54,6 +56,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, "/restv1/category/1")
{
@@ -84,6 +88,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, "/restv1/auction/19264723")
{
Modified: branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java
===================================================================
--- branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2011-01-25 15:30:54 UTC (rev 14025)
+++ branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2011-01-26 14:52:40 UTC (rev 14026)
@@ -161,6 +161,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoquery")
{
@@ -181,6 +183,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoheader")
{
@@ -199,6 +203,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echocookie")
{
@@ -217,6 +223,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/foo/bar/asdf")
{
@@ -230,6 +238,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echotwoparams/foo/bar")
{
@@ -282,6 +292,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams2")
{
@@ -301,6 +313,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams3")
{
@@ -321,6 +335,8 @@
}
}.run();
+
+ reset();
}
@@ -365,6 +381,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedStrings")
{
@@ -383,6 +401,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedIntegers")
{
Modified: branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
===================================================================
--- branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2011-01-25 15:30:54 UTC (rev 14025)
+++ branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2011-01-26 14:52:40 UTC (rev 14026)
@@ -106,6 +106,8 @@
}
}.run();
+
+ reset();
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
@@ -144,7 +146,9 @@
}
}.run();
-
+
+ reset();
+
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
Modified: branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml 2011-01-25 15:30:54 UTC (rev 14025)
+++ branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml 2011-01-26 14:52:40 UTC (rev 14026)
@@ -43,7 +43,7 @@
entity-class="org.jboss.seam.example.tasks.entity.Category"
media-types="application/xml application/json application/fastinfoset"/>
- <resteasy:application resource-path-prefix="/v1">
+ <resteasy:application resource-path-prefix="/v1" destroy-session-after-request="false">
<resteasy:media-type-mappings>
<key>xml</key>
<value>application/xml</value>
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/mock/SeamTest.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/mock/SeamTest.java 2011-01-25 15:30:54 UTC (rev 14025)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/mock/SeamTest.java 2011-01-26 14:52:40 UTC (rev 14026)
@@ -19,6 +19,7 @@
* @author Gavin King
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author Mike Youngstrom
+ * @author <a href="http://community.jboss.org/people/jharting">Jozef Hartinger</a>
*/
public class SeamTest extends AbstractSeamTest
{
@@ -37,6 +38,16 @@
super.end();
}
+ /**
+ * Call this method within a test method to end the previous
+ * mock session and start another one.
+ */
+ public void reset()
+ {
+ end();
+ begin();
+ }
+
@Override
@BeforeClass
public void setupClass() throws Exception
Modified: branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
===================================================================
--- branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2011-01-25 15:30:54 UTC (rev 14025)
+++ branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2011-01-26 14:52:40 UTC (rev 14026)
@@ -21,6 +21,8 @@
*/
package org.jboss.seam.resteasy;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -44,6 +46,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@@ -62,6 +65,7 @@
@Scope(ScopeType.APPLICATION)
@Name("org.jboss.seam.resteasy.resourceAdapter")
@BypassInterceptors
+@Install(precedence = BUILT_IN)
public class ResteasyResourceAdapter extends AbstractResource
{
@@ -118,34 +122,36 @@
@Override
public void process() throws ServletException, IOException
{
+ try
+ {
+ HttpHeaders headers = ServletUtil.extractHttpHeaders(request);
+ UriInfoImpl uriInfo = extractUriInfo(request, application.getResourcePathPrefix());
- HttpHeaders headers = ServletUtil.extractHttpHeaders(request);
- UriInfoImpl uriInfo = extractUriInfo(request, application.getResourcePathPrefix());
+ HttpResponse theResponse = new HttpServletResponseWrapper(
+ response,
+ dispatcher.getProviderFactory()
+ );
- HttpResponse theResponse = new HttpServletResponseWrapper(
- response,
- dispatcher.getProviderFactory()
- );
+ // TODO: This requires a SynchronousDispatcher
+ HttpRequest in = new HttpServletInputMessage(
+ request,
+ theResponse,
+ headers,
+ uriInfo,
+ request.getMethod().toUpperCase(),
+ (SynchronousDispatcher) dispatcher
+ );
- // TODO: This requires a SynchronousDispatcher
- HttpRequest in = new HttpServletInputMessage(
- request,
- theResponse,
- headers,
- uriInfo,
- request.getMethod().toUpperCase(),
- (SynchronousDispatcher) dispatcher
- );
-
- dispatcher.invoke(in, theResponse);
-
- // Prevent anemic sessions clog up the server
- if (request.getSession().isNew()
- && application.isDestroySessionAfterRequest()
- && !Session.instance().isInvalid())
+ dispatcher.invoke(in, theResponse);
+ }
+ finally
{
- log.debug("Destroying HttpSession after REST request");
- Session.instance().invalidate();
+ // Prevent anemic sessions clog up the server
+ if (application.isDestroySessionAfterRequest())
+ {
+ log.debug("Destroying HttpSession after REST request");
+ Session.instance().invalidate();
+ }
}
}
}.run();
13 years, 11 months