You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/11/06 08:38:19 UTC
isis git commit: ISIS-1229: javadoc changes only,
and deprecating IntegrationTestAbstract#nextRequest()
Repository: isis
Updated Branches:
refs/heads/master a18450ea0 -> ff1d380c7
ISIS-1229: javadoc changes only, and deprecating IntegrationTestAbstract#nextRequest()
... because nextRequest() doesn't mean next request, it just means next transaction within the same session. This is confusing for anyone expecting that request-scoped services to be reset after calling it
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/ff1d380c
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/ff1d380c
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/ff1d380c
Branch: refs/heads/master
Commit: ff1d380c712ff694277aa3554c5a2e9fd7a9256d
Parents: a18450e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Nov 6 07:37:35 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Nov 6 07:37:35 2015 +0000
----------------------------------------------------------------------
.../integtestsupport/IntegrationTestAbstract.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/ff1d380c/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract.java
index 7abaaee..6248ca4 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IntegrationTestAbstract.java
@@ -19,6 +19,9 @@
package org.apache.isis.core.integtestsupport;
import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+
import com.google.common.base.Throwables;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
@@ -30,6 +33,7 @@ import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.RecoverableException;
import org.apache.isis.applib.fixtures.FixtureClock;
import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
@@ -61,8 +65,7 @@ public abstract class IntegrationTestAbstract {
/**
- * Intended to be called whenever there is a logically distinct interaction
- * with the system.
+ * Intended to be called whenever there is a logically distinct interaction with the system.
*
* <p>
* Each transaction has its own instances of request-scoped services, most notably
@@ -71,9 +74,9 @@ public abstract class IntegrationTestAbstract {
*
* <p>
* (Unlike {@link #nextSession()}), it <i>is</i> valid to hold references to objects across transactions.
+ * Also, note that {@link RequestScoped} services (such as {@link QueryResultsCache} will <i>not</i> be reset.
* </p>
*
- * @see #nextRequest()
* @see #nextSession()
*/
protected void nextTransaction() {
@@ -86,20 +89,23 @@ public abstract class IntegrationTestAbstract {
*
* @see #nextTransaction()
* @see #nextSession()
+ *
+ * @deprecated - confusing because does NOT clear out and reset any {@link javax.enterprise.context.RequestScoped} services. For this, use {@link #nextSession()}.
*/
+ @Deprecated
protected void nextRequest() {
nextTransaction();
}
/**
- * Completes the transaction and session, then opens another session and transaction.
+ * Completes the transaction and session, then opens another session and transaction. Any
+ * {@link RequestScoped} services (eg {@link QueryResultsCache} will be reset.
*
* <p>
* Note that any references to objects must be discarded and reacquired.
* </p>
*
* @see #nextTransaction()
- * @see #nextRequest()
*/
protected void nextSession() {
scenarioExecution().endTran(true);