This commit is contained in:
Keith Donald
2007-10-31 01:59:19 +00:00
parent 26f9cf7ca2
commit 2613ed143a
11 changed files with 25 additions and 27 deletions

View File

@@ -276,7 +276,7 @@ public class ServletExternalContext implements ExternalContext {
public void executeFlowRequest(FlowExecutor flowExecutor) throws IOException {
ExternalContextHolder.setExternalContext(this);
try {
flowExecutor.execute(this);
flowExecutor.executeFlowRequest(this);
if (isPausedResult()) {
if (flowExecutionRedirector != null) {
flowExecutionRedirector.issueRedirect();

View File

@@ -16,13 +16,13 @@
package org.springframework.webflow.engine;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.binding.mapping.AttributeMapper;
import org.springframework.binding.mapping.MappingContext;
import org.springframework.core.CollectionFactory;
import org.springframework.core.style.StylerUtils;
import org.springframework.core.style.ToStringCreator;
import org.springframework.util.Assert;
@@ -38,8 +38,8 @@ import org.springframework.webflow.execution.RequestContext;
/**
* A single flow definition. A Flow definition is a reusable, self-contained controller module that provides the blue
* print for a user dialog or conversation. Flows typically orchestrate controlled navigations within web applications
* to guide users through fulfillment of a business process/goal that takes place over a series of steps, modeled as
* print for a user dialog or conversation. Flows typically drive controlled navigations within web applications to
* guide users through fulfillment of a business process/goal that takes place over a series of steps, modeled as
* states.
* <p>
* A simple Flow definition could do nothing more than execute an action and display a view all in one request. A more
@@ -115,7 +115,7 @@ public class Flow extends AnnotatedObject implements FlowDefinition {
/**
* The set of state definitions for this flow.
*/
private Set states = CollectionFactory.createLinkedSetIfPossible(9);
private Set states = new LinkedHashSet(9);
/**
* The default start state for this flow.
@@ -125,7 +125,7 @@ public class Flow extends AnnotatedObject implements FlowDefinition {
/**
* The set of flow variables created by this flow.
*/
private Set variables = CollectionFactory.createLinkedSetIfPossible(3);
private Set variables = new LinkedHashSet(3);
/**
* The mapper to map flow input attributes.

View File

@@ -16,9 +16,9 @@
package org.springframework.webflow.execution.factory;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import org.springframework.core.CollectionFactory;
import org.springframework.util.Assert;
import org.springframework.webflow.definition.FlowDefinition;
import org.springframework.webflow.execution.FlowExecutionListener;
@@ -42,7 +42,7 @@ class ConditionalFlowExecutionListenerHolder {
/**
* The listener criteria set.
*/
private Set criteriaSet = CollectionFactory.createLinkedSetIfPossible(3);
private Set criteriaSet = new LinkedHashSet(3);
/**
* Create a new conditional flow execution listener holder.

View File

@@ -33,5 +33,5 @@ public interface FlowExecutor {
* Execute the flow request initiated by the provided external context.
* @param context the external context, representing a client environment calling into Spring Web Flow
*/
public void execute(ExternalContext context);
public void executeFlowRequest(ExternalContext context);
}

View File

@@ -101,7 +101,7 @@ public class FlowExecutorImpl implements FlowExecutor {
this.executionRepository = executionRepository;
}
public void execute(ExternalContext context) {
public void executeFlowRequest(ExternalContext context) {
if (context.getFlowExecutionKey() != null) {
resumeExecution(context.getFlowExecutionKey(), context);
} else {

View File

@@ -24,7 +24,7 @@ public class EnableScopesBeanDefinitionParserTests extends TestCase {
public void testExecute() {
MockExternalContext context = new MockExternalContext();
context.setFlowId("flow");
executor.execute(context);
executor.executeFlowRequest(context);
}
public static class ConfigurationListener extends FlowExecutionListenerAdapter {

View File

@@ -21,7 +21,7 @@ public class FlowExecutorBeanDefinitionParserTests extends TestCase {
public void testExecute() {
MockExternalContext context = new MockExternalContext();
context.setFlowId("flow");
executor.execute(context);
executor.executeFlowRequest(context);
}
public static class ConfigurationListener extends FlowExecutionListenerAdapter {

View File

@@ -51,7 +51,7 @@ public class FlowExecutorFactoryBeanTests extends TestCase {
FlowExecutor executor = (FlowExecutor) factoryBean.getObject();
MockExternalContext context = new MockExternalContext();
context.setFlowId("flow");
executor.execute(context);
executor.executeFlowRequest(context);
}
public void testGetFlowExecutorOptionsSpecified() throws Exception {
@@ -79,10 +79,10 @@ public class FlowExecutorFactoryBeanTests extends TestCase {
FlowExecutor executor = (FlowExecutor) factoryBean.getObject();
MockExternalContext context = new MockExternalContext();
context.setFlowId("flow");
executor.execute(context);
executor.executeFlowRequest(context);
MockExternalContext context2 = new MockExternalContext();
context2.setFlowExecutionKey(context.getFlowExecutionKey());
executor.execute(context);
executor.executeFlowRequest(context);
}
}

View File

@@ -2,8 +2,6 @@ package org.springframework.webflow.context;
import junit.framework.TestCase;
import org.springframework.webflow.context.RequestPath;
public class RequestPathTests extends TestCase {
public void testNewPathParse() {
RequestPath path = new RequestPath("/users/1");
@@ -21,7 +19,7 @@ public class RequestPathTests extends TestCase {
public void testNewPathParseNoLeadingSlash() {
try {
RequestPath path = new RequestPath("users/1/");
new RequestPath("users/1/");
fail("should have failed");
} catch (IllegalArgumentException e) {

View File

@@ -114,7 +114,7 @@ public class ServletExternalContextTests extends TestCase {
public void testSendFlowExecutionRedirect() throws Exception {
request.setPathInfo("/users/1");
flowExecutor = new FlowExecutor() {
public void execute(ExternalContext context) {
public void executeFlowRequest(ExternalContext context) {
context.sendFlowExecutionRedirect(new FlowExecutionRequestInfo("users", "_c12345_k12345"));
}
};
@@ -126,7 +126,7 @@ public class ServletExternalContextTests extends TestCase {
public void testFlowExecutionRedirectAttemptOnEnd() throws Exception {
request.setPathInfo("/users/1");
flowExecutor = new FlowExecutor() {
public void execute(ExternalContext context) {
public void executeFlowRequest(ExternalContext context) {
context.sendFlowExecutionRedirect(new FlowExecutionRequestInfo("users", "_c12345_k12345"));
context.setEndedResult("_c12345_k12345");
}
@@ -143,7 +143,7 @@ public class ServletExternalContextTests extends TestCase {
public void testSendFlowDefinitionRedirect() throws Exception {
request.setPathInfo("/users/1");
flowExecutor = new FlowExecutor() {
public void execute(ExternalContext context) {
public void executeFlowRequest(ExternalContext context) {
MockParameterMap parameters = new MockParameterMap();
parameters.put("foo", "bar");
parameters.put("bar", "baz");
@@ -162,7 +162,7 @@ public class ServletExternalContextTests extends TestCase {
public void testSendExternalRedirect() throws Exception {
request.setPathInfo("/users/1");
flowExecutor = new FlowExecutor() {
public void execute(ExternalContext context) {
public void executeFlowRequest(ExternalContext context) {
context.sendExternalRedirect("/foo/bar/baz");
context.setEndedResult(null);
}
@@ -173,7 +173,7 @@ public class ServletExternalContextTests extends TestCase {
}
public class StubFlowExecutor implements FlowExecutor {
public void execute(ExternalContext context) {
public void executeFlowRequest(ExternalContext context) {
assertNotNull(ExternalContextHolder.getExternalContext());
}
}

View File

@@ -40,7 +40,7 @@ public class FlowExecutorImplTests extends TestCase {
context.setFlowId("flow");
ExternalContextHolder.setExternalContext(context);
executor.execute(context);
executor.executeFlowRequest(context);
ExternalContextHolder.setExternalContext(null);
assertNull(context.getFlowExecutionRedirectResult());
@@ -56,7 +56,7 @@ public class FlowExecutorImplTests extends TestCase {
context.setFlowId("flow");
ExternalContextHolder.setExternalContext(context);
executor.execute(context);
executor.executeFlowRequest(context);
ExternalContextHolder.setExternalContext(null);
assertNotNull(context.getPausedFlowExecutionKeyResult());
@@ -69,7 +69,7 @@ public class FlowExecutorImplTests extends TestCase {
context2.setFlowExecutionKey(context.getPausedFlowExecutionKeyResult());
ExternalContextHolder.setExternalContext(context);
executor.execute(context2);
executor.executeFlowRequest(context2);
ExternalContextHolder.setExternalContext(null);
}
@@ -86,7 +86,7 @@ public class FlowExecutorImplTests extends TestCase {
context.setFlowId("flow");
ExternalContextHolder.setExternalContext(context);
executor.execute(context);
executor.executeFlowRequest(context);
ExternalContextHolder.setExternalContext(null);
assertNull(context.getFlowExecutionRedirectResult());