Re: [Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
Should I put in a JIRA for this issue? On Wed, Oct 20, 2010 at 10:15 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Hi Nathan, Just had a quick look to your test. Refactored to : http://pastebin.com/02nY8aWF The two test methods that use a string url for the binding work fine. The one using the beanclass doesn't work... As a workaround for now, you can use stringified urls in your tests. I'll try to understand what's going on as soon as I have a moment. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Sure thing Remi. The following example fails because the id is null. Nathan ACTION package com.foo.stripes; import net.sourceforge.stripes.action.ActionBean; import net.sourceforge.stripes.action.ActionBeanContext; import net.sourceforge.stripes.action.DefaultHandler; import net.sourceforge.stripes.action.Resolution; import net.sourceforge.stripes.action.UrlBinding; @UrlBinding(/foo/{$event}/{id}) public class TestAction implements ActionBean { ActionBeanContext context; Integer id; @DefaultHandler public Resolution bar() { return null; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Override public void setContext(ActionBeanContext context) { this.context = context; } @Override public ActionBeanContext getContext() { return this.context; } } TEST package com.foo.stripes; import java.util.HashMap; import java.util.Map; import net.sourceforge.stripes.controller.DispatcherServlet; import net.sourceforge.stripes.controller.StripesFilter; import net.sourceforge.stripes.mock.MockRoundtrip; import net.sourceforge.stripes.mock.MockServletContext; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class ParameterTestAction { MockServletContext context; @Before public void setup() { context = new MockServletContext(test); // Add the Stripes Filter MapString,String filterParams = new HashMapString,String(); filterParams.put(ActionResolver.Packages, com.foo.stripes); context.addFilter(StripesFilter.class, StripesFilter, filterParams); // Add the Stripes Dispatcher context.setServlet(DispatcherServlet.class, StripesDispatcher, null); } @Test public void testParameter() throws Exception { final Integer id = 2; MockRoundtrip trip = new MockRoundtrip(context, TestAction.class); trip.setParameter(id, id.toString()); trip.execute(); TestAction action = trip.getActionBean(TestAction.class); assertEquals(id, action.getId()); } } On Wed, Oct 20, 2010 at 2:56 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Haven't looked yet, but the log might be normal. Could you post a test case that reproduces your bug ? This way I'll have a closer look if you want. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Just tested this with logging on 1.5.3. It looks like there is an issue with the {$event} binding but I am not sure that is really an issue or not. Let me know if there is anything else I can do on my end to help out. Here is the log for 1.5.3 INFO 2010-10-19 21:46:10,991 net.sourceforge.stripes.util.Log.info(): Stripes Initialization Complete. Version: 1.5.3, Build: 1.5.3 DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker selected locale: en_US DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker did not pick a character encoding, using default: UTF-8 DEBUG 2010-10-19 21:46:11,848 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} INFO 2010-10-19 21:46:11,858 net.sourceforge.stripes.util.Log.info(): Expression validation will be performed using: net.sourceforge.stripes.validation.expression.Jsp20ExpressionExecutor DEBUG 2010-10-19 21:46:11,859 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage RequestInit DEBUG 2010-10-19 21:46:11,862 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage ActionBeanResolution DEBUG 2010-10-19 21:46:11,863 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,866 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,871 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage
Re: [Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
Yes, please do. Thanks Remi 2010/10/26 Nathan Maves nathan.ma...@gmail.com Should I put in a JIRA for this issue? On Wed, Oct 20, 2010 at 10:15 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Hi Nathan, Just had a quick look to your test. Refactored to : http://pastebin.com/02nY8aWF The two test methods that use a string url for the binding work fine. The one using the beanclass doesn't work... As a workaround for now, you can use stringified urls in your tests. I'll try to understand what's going on as soon as I have a moment. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Sure thing Remi. The following example fails because the id is null. Nathan ACTION package com.foo.stripes; import net.sourceforge.stripes.action.ActionBean; import net.sourceforge.stripes.action.ActionBeanContext; import net.sourceforge.stripes.action.DefaultHandler; import net.sourceforge.stripes.action.Resolution; import net.sourceforge.stripes.action.UrlBinding; @UrlBinding(/foo/{$event}/{id}) public class TestAction implements ActionBean { ActionBeanContext context; Integer id; @DefaultHandler public Resolution bar() { return null; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Override public void setContext(ActionBeanContext context) { this.context = context; } @Override public ActionBeanContext getContext() { return this.context; } } TEST package com.foo.stripes; import java.util.HashMap; import java.util.Map; import net.sourceforge.stripes.controller.DispatcherServlet; import net.sourceforge.stripes.controller.StripesFilter; import net.sourceforge.stripes.mock.MockRoundtrip; import net.sourceforge.stripes.mock.MockServletContext; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class ParameterTestAction { MockServletContext context; @Before public void setup() { context = new MockServletContext(test); // Add the Stripes Filter MapString,String filterParams = new HashMapString,String(); filterParams.put(ActionResolver.Packages, com.foo.stripes); context.addFilter(StripesFilter.class, StripesFilter, filterParams); // Add the Stripes Dispatcher context.setServlet(DispatcherServlet.class, StripesDispatcher, null); } @Test public void testParameter() throws Exception { final Integer id = 2; MockRoundtrip trip = new MockRoundtrip(context, TestAction.class); trip.setParameter(id, id.toString()); trip.execute(); TestAction action = trip.getActionBean(TestAction.class); assertEquals(id, action.getId()); } } On Wed, Oct 20, 2010 at 2:56 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Haven't looked yet, but the log might be normal. Could you post a test case that reproduces your bug ? This way I'll have a closer look if you want. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Just tested this with logging on 1.5.3. It looks like there is an issue with the {$event} binding but I am not sure that is really an issue or not. Let me know if there is anything else I can do on my end to help out. Here is the log for 1.5.3 INFO 2010-10-19 21:46:10,991 net.sourceforge.stripes.util.Log.info (): Stripes Initialization Complete. Version: 1.5.3, Build: 1.5.3 DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker selected locale: en_US DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker did not pick a character encoding, using default: UTF-8 DEBUG 2010-10-19 21:46:11,848 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} INFO 2010-10-19 21:46:11,858 net.sourceforge.stripes.util.Log.info (): Expression validation will be performed using: net.sourceforge.stripes.validation.expression.Jsp20ExpressionExecutor DEBUG 2010-10-19 21:46:11,859 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage RequestInit DEBUG 2010-10-19 21:46:11,862 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage ActionBeanResolution DEBUG 2010-10-19 21:46:11,863 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,866 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,871
Re: [Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
Hi Nathan, Just had a quick look to your test. Refactored to : http://pastebin.com/02nY8aWF The two test methods that use a string url for the binding work fine. The one using the beanclass doesn't work... As a workaround for now, you can use stringified urls in your tests. I'll try to understand what's going on as soon as I have a moment. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Sure thing Remi. The following example fails because the id is null. Nathan ACTION package com.foo.stripes; import net.sourceforge.stripes.action.ActionBean; import net.sourceforge.stripes.action.ActionBeanContext; import net.sourceforge.stripes.action.DefaultHandler; import net.sourceforge.stripes.action.Resolution; import net.sourceforge.stripes.action.UrlBinding; @UrlBinding(/foo/{$event}/{id}) public class TestAction implements ActionBean { ActionBeanContext context; Integer id; @DefaultHandler public Resolution bar() { return null; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Override public void setContext(ActionBeanContext context) { this.context = context; } @Override public ActionBeanContext getContext() { return this.context; } } TEST package com.foo.stripes; import java.util.HashMap; import java.util.Map; import net.sourceforge.stripes.controller.DispatcherServlet; import net.sourceforge.stripes.controller.StripesFilter; import net.sourceforge.stripes.mock.MockRoundtrip; import net.sourceforge.stripes.mock.MockServletContext; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class ParameterTestAction { MockServletContext context; @Before public void setup() { context = new MockServletContext(test); // Add the Stripes Filter MapString,String filterParams = new HashMapString,String(); filterParams.put(ActionResolver.Packages, com.foo.stripes); context.addFilter(StripesFilter.class, StripesFilter, filterParams); // Add the Stripes Dispatcher context.setServlet(DispatcherServlet.class, StripesDispatcher, null); } @Test public void testParameter() throws Exception { final Integer id = 2; MockRoundtrip trip = new MockRoundtrip(context, TestAction.class); trip.setParameter(id, id.toString()); trip.execute(); TestAction action = trip.getActionBean(TestAction.class); assertEquals(id, action.getId()); } } On Wed, Oct 20, 2010 at 2:56 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Haven't looked yet, but the log might be normal. Could you post a test case that reproduces your bug ? This way I'll have a closer look if you want. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Just tested this with logging on 1.5.3. It looks like there is an issue with the {$event} binding but I am not sure that is really an issue or not. Let me know if there is anything else I can do on my end to help out. Here is the log for 1.5.3 INFO 2010-10-19 21:46:10,991 net.sourceforge.stripes.util.Log.info(): Stripes Initialization Complete. Version: 1.5.3, Build: 1.5.3 DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker selected locale: en_US DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker did not pick a character encoding, using default: UTF-8 DEBUG 2010-10-19 21:46:11,848 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} INFO 2010-10-19 21:46:11,858 net.sourceforge.stripes.util.Log.info(): Expression validation will be performed using: net.sourceforge.stripes.validation.expression.Jsp20ExpressionExecutor DEBUG 2010-10-19 21:46:11,859 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage RequestInit DEBUG 2010-10-19 21:46:11,862 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage ActionBeanResolution DEBUG 2010-10-19 21:46:11,863 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,866 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,871 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage HandlerResolution DEBUG 2010-10-19 21:46:11,874 net.sourceforge.stripes.util.Log.debug(): Resolved event: edit; will invoke:
Re: [Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
So I am not crazy! Good to hear and thanks for the help. N On Wed, Oct 20, 2010 at 10:15 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Hi Nathan, Just had a quick look to your test. Refactored to : http://pastebin.com/02nY8aWF The two test methods that use a string url for the binding work fine. The one using the beanclass doesn't work... As a workaround for now, you can use stringified urls in your tests. I'll try to understand what's going on as soon as I have a moment. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Sure thing Remi. The following example fails because the id is null. Nathan ACTION package com.foo.stripes; import net.sourceforge.stripes.action.ActionBean; import net.sourceforge.stripes.action.ActionBeanContext; import net.sourceforge.stripes.action.DefaultHandler; import net.sourceforge.stripes.action.Resolution; import net.sourceforge.stripes.action.UrlBinding; @UrlBinding(/foo/{$event}/{id}) public class TestAction implements ActionBean { ActionBeanContext context; Integer id; �...@defaulthandler public Resolution bar() { return null; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } �...@override public void setContext(ActionBeanContext context) { this.context = context; } �...@override public ActionBeanContext getContext() { return this.context; } } TEST package com.foo.stripes; import java.util.HashMap; import java.util.Map; import net.sourceforge.stripes.controller.DispatcherServlet; import net.sourceforge.stripes.controller.StripesFilter; import net.sourceforge.stripes.mock.MockRoundtrip; import net.sourceforge.stripes.mock.MockServletContext; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class ParameterTestAction { MockServletContext context; �...@before public void setup() { context = new MockServletContext(test); // Add the Stripes Filter MapString,String filterParams = new HashMapString,String(); filterParams.put(ActionResolver.Packages, com.foo.stripes); context.addFilter(StripesFilter.class, StripesFilter, filterParams); // Add the Stripes Dispatcher context.setServlet(DispatcherServlet.class, StripesDispatcher, null); } �...@test public void testParameter() throws Exception { final Integer id = 2; MockRoundtrip trip = new MockRoundtrip(context, TestAction.class); trip.setParameter(id, id.toString()); trip.execute(); TestAction action = trip.getActionBean(TestAction.class); assertEquals(id, action.getId()); } } On Wed, Oct 20, 2010 at 2:56 AM, VANKEISBELCK Remi r...@rvkb.com wrote: Haven't looked yet, but the log might be normal. Could you post a test case that reproduces your bug ? This way I'll have a closer look if you want. Cheers Remi 2010/10/20 Nathan Maves nathan.ma...@gmail.com Just tested this with logging on 1.5.3. It looks like there is an issue with the {$event} binding but I am not sure that is really an issue or not. Let me know if there is anything else I can do on my end to help out. Here is the log for 1.5.3 INFO 2010-10-19 21:46:10,991 net.sourceforge.stripes.util.Log.info(): Stripes Initialization Complete. Version: 1.5.3, Build: 1.5.3 DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker selected locale: en_US DEBUG 2010-10-19 21:46:11,844 net.sourceforge.stripes.util.Log.debug(): LocalePicker did not pick a character encoding, using default: UTF-8 DEBUG 2010-10-19 21:46:11,848 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} INFO 2010-10-19 21:46:11,858 net.sourceforge.stripes.util.Log.info(): Expression validation will be performed using: net.sourceforge.stripes.validation.expression.Jsp20ExpressionExecutor DEBUG 2010-10-19 21:46:11,859 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage RequestInit DEBUG 2010-10-19 21:46:11,862 net.sourceforge.stripes.util.Log.debug(): Transitioning to lifecycle stage ActionBeanResolution DEBUG 2010-10-19 21:46:11,863 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,866 net.sourceforge.stripes.util.Log.debug(): Matched /admin/product/{$event}/{product.id} to /admin/product/{$event}/{product.id} DEBUG 2010-10-19 21:46:11,871 net.sourceforge.stripes.util.Log.debug():
Re: [Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
Is there anyone else out here using UrlBinding with MockRoundTrip? This is killing me that we can upgrade to the latest Stripes codebase. Nathan On Wed, Oct 13, 2010 at 11:32 AM, Nathan Maves nathan.ma...@gmail.com wrote: We have multiple test cases where we are using UrlBinding with 1.5 and everything works perfect. Here is an example of one of our bindings @UrlBinding(/admin/product/{$event}/{product.id}) All versions (1.5.1, 1.5.2, 1.5.3) work fine outside of the test fixture. It is only within a test using the MockRoundTrip where we get the error. The error is a validation error where it claims to have a conversion issue where the replacement parts are [Product Id, {product.id}]. We get this when passing in a parameter or not. I did find the following change from 1.5 to 1.5.1 that might have something to do with it. http://www.stripesframework.org/jira/browse/STS-592 Nathan -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
Nathan, We have limited test cases for our Action Beans at this time. So far no issues. Could you be more specific about the error that is being produced. --Nikolaos Nathan Maves wrote: Is there anyone else out here using UrlBinding with MockRoundTrip? This is killing me that we can upgrade to the latest Stripes codebase. Nathan On Wed, Oct 13, 2010 at 11:32 AM, Nathan Maves nathan.ma...@gmail.com wrote: We have multiple test cases where we are using UrlBinding with 1.5 and everything works perfect. Here is an example of one of our bindings @UrlBinding(/admin/product/{$event}/{product.id}) All versions (1.5.1, 1.5.2, 1.5.3) work fine outside of the test fixture. It is only within a test using the MockRoundTrip where we get the error. The error is a validation error where it claims to have a conversion issue where the replacement parts are [Product Id, {product.id}]. We get this when passing in a parameter or not. I did find the following change from 1.5 to 1.5.1 that might have something to do with it. http://www.stripesframework.org/jira/browse/STS-592 Nathan -- Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
[Stripes-users] CleanUrl bug from 1.5.1+ when using MockRoundtrip
We have multiple test cases where we are using UrlBinding with 1.5 and everything works perfect. Here is an example of one of our bindings @UrlBinding(/admin/product/{$event}/{product.id}) All versions (1.5.1, 1.5.2, 1.5.3) work fine outside of the test fixture. It is only within a test using the MockRoundTrip where we get the error. The error is a validation error where it claims to have a conversion issue where the replacement parts are [Product Id, {product.id}]. We get this when passing in a parameter or not. I did find the following change from 1.5 to 1.5.1 that might have something to do with it. http://www.stripesframework.org/jira/browse/STS-592 Nathan -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users