Hello all,
I'm kind of new to Spring Web Flow, been playing around with it casually for around 6 - 8 months or so, and this is my first post here... glad to be part of this community!
Now I've just updated one of my applications from SWF 1.0.5 to 2.0.7 and I've just started trying to implement some unit testing into my application(had no previous unit testing).
Now I'm using JUnit as well. I've read through the webflow-reference pdf but to no avail.
I'm running the following unit test: (note: I've created a stub for my EJB calls as shown below)
and here is simple flow I'm trying to testCode:protected FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) { return resourceFactory.createFileResource("web/WEB-INF/flow/resetPassword-flow.xml"); } protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) { builderContext.registerBean("ejbBean", new StubEjbBean()); } protected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory) { return new FlowDefinitionResource[] { resourceFactory.createFileResource("file:/src/test/applicationContext-flow-junit.xml"), resourceFactory.createFileResource("file:/src/test/applicationContext-junit.xml") }; } public void testResetPasswordFlow() { MutableAttributeMap input = new LocalAttributeMap(); MockExternalContext context = new MockExternalContext(); startFlow(input, context); System.out.println("End of JUnit Test [testResetPasswordFlow]"); }
and finally this is the exception I get.Code:<?xml version="1.0" encoding="UTF-8"?> <flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <action-state id="initialFlowAction"> <evaluate expression="initialFlowAction" /> <transition on="success" to="resetPasswordUserId"/> </action-state> <view-state id="resetPasswordUserId" view="resetPasswordUserId"> <on-entry> <evaluate expression="resetPasswordUserForm.setupForm"/> </on-entry> <transition on="continue" to="finalView"> <evaluate expression="resetPasswordUserForm.bindAndValidate"/> </transition> </view-state> <end-state id="finalView" view="finalView"/> </flow>
Any help would be greatly appreciated. Thanks guys.Code:org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@63fe63fe targetAction = [EvaluateAction@66006600 expression = initialFlowAction, resultExposer = [null]], attributes = map[[empty]]] in state 'initialFlowAction' of flow 'resetPassword-flow' -- action execution attributes were 'map[[empty]]' at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60) at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101) at org.springframework.webflow.engine.State.enter(State.java:194) at org.springframework.webflow.engine.Flow.start(Flow.java:535) at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:364) at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:222) at org.springframework.webflow.test.execution.AbstractFlowExecutionTests.startFlow(AbstractFlowExecutionTests.java:121) at my.package.tests.ResetPasswordFlowExecutionTests.testResetPasswordFlow(ResetPasswordFlowExecutionTests.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.binding.expression.PropertyNotFoundException: Property not found at org.springframework.binding.expression.ognl.OgnlExpression.getValue(OgnlExpression.java:87) at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:77) at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145) at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) ... 23 more Caused by: ognl.NoSuchPropertyException: org.springframework.webflow.engine.impl.RequestControlContextImpl.initialFlowAction at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123) at org.springframework.webflow.expression.WebFlowOgnlExpressionParser$RequestContextPropertyAccessor.getProperty(WebFlowOgnlExpressionParser.java:118) at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1616) at ognl.ASTProperty.getValueBody(ASTProperty.java:96) at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) at ognl.SimpleNode.getValue(SimpleNode.java:210) at ognl.Ognl.getValue(Ognl.java:333) at org.springframework.binding.expression.ognl.OgnlExpression.getValue(OgnlExpression.java:85) ... 27 more


Reply With Quote
