martinc 2003/10/17 22:30:19 Modified: chain/src/java/org/apache/commons/chain/generic CopyCommand.java LookupCommand.java RemoveCommand.java chain/src/java/org/apache/commons/chain/impl CatalogBase.java chain/src/java/org/apache/commons/chain/web AbstractGetLocaleCommand.java AbstractSetLocaleCommand.java chain/src/java/org/apache/commons/chain/web/faces FacesGetLocaleCommand.java FacesSetLocaleCommand.java FacesWebContext.java chain/src/java/org/apache/commons/chain/web/portlet PortletGetLocaleCommand.java PortletSessionScopeMap.java PortletSetLocaleCommand.java PortletWebContext.java chain/src/java/org/apache/commons/chain/web/servlet ServletGetLocaleCommand.java ServletSetLocaleCommand.java ServletWebContext.java chain/src/test/org/apache/commons/chain/config ConfigParserTestCase.java TestChain.java TestCommand.java chain/src/test/org/apache/commons/chain/impl AddingCommand.java DelegatingCommand.java DelegatingFilter.java ExceptionCommand.java ExceptionFilter.java NonDelegatingCommand.java NonDelegatingFilter.java chain/src/test/org/apache/commons/chain/web/servlet MockHttpServletRequest.java MockHttpServletResponse.java ServletGetLocaleCommandTestCase.java ServletSetLocaleCommandTestCase.java Log: Replace tabs with spaces. Revision Changes Path 1.5 +15 -15 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/generic/CopyCommand.java Index: CopyCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/generic/CopyCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- CopyCommand.java 12 Oct 2003 09:10:54 -0000 1.4 +++ CopyCommand.java 18 Oct 2003 05:30:18 -0000 1.5 @@ -89,7 +89,7 @@ */ public String getFromKey() { - return (this.fromKey); + return (this.fromKey); } @@ -101,7 +101,7 @@ */ public void setFromKey(String fromKey) { - this.fromKey = fromKey; + this.fromKey = fromKey; } @@ -114,7 +114,7 @@ */ public String getToKey() { - return (this.toKey); + return (this.toKey); } @@ -126,7 +126,7 @@ */ public void setToKey(String toKey) { - this.toKey = toKey; + this.toKey = toKey; } @@ -169,16 +169,16 @@ */ public boolean execute(Context context) throws Exception { - Object value = this.value; + Object value = this.value; if (value == null) { context.get(getFromKey()); } - if (value != null) { - context.put(getToKey(), value); - } else { - context.remove(getToKey()); - } - return (false); + if (value != null) { + context.put(getToKey(), value); + } else { + context.remove(getToKey()); + } + return (false); } 1.5 +31 -31 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/generic/LookupCommand.java Index: LookupCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/generic/LookupCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- LookupCommand.java 12 Oct 2003 09:10:54 -0000 1.4 +++ LookupCommand.java 18 Oct 2003 05:30:18 -0000 1.5 @@ -103,7 +103,7 @@ */ public String getCatalogKey() { - return (this.catalogKey); + return (this.catalogKey); } @@ -116,7 +116,7 @@ */ public void setCatalogKey(String catalogKey) { - this.catalogKey = catalogKey; + this.catalogKey = catalogKey; } @@ -130,7 +130,7 @@ */ public String getName() { - return (this.name); + return (this.name); } @@ -143,7 +143,7 @@ */ public void setName(String name) { - this.name = name; + this.name = name; } @@ -157,7 +157,7 @@ */ public String getNameKey() { - return (this.nameKey); + return (this.nameKey); } @@ -170,7 +170,7 @@ */ public void setNameKey(String nameKey) { - this.nameKey = nameKey; + this.nameKey = nameKey; } @@ -216,7 +216,7 @@ */ public boolean execute(Context context) throws Exception { - Command command = getCommand(context); + Command command = getCommand(context); if (command != null) { return (command.execute(context)); } else { @@ -228,7 +228,7 @@ public boolean postprocess(Context context, Exception exception) { - Command command = getCommand(context); + Command command = getCommand(context); if (command != null) { if (command instanceof Filter) { return (((Filter) command).postprocess(context, exception)); @@ -253,25 +253,25 @@ */ private Command getCommand(Context context) { - Catalog catalog = (Catalog) - context.get(getCatalogKey()); - if (catalog == null) { - throw new IllegalArgumentException(getCatalogKey()); - } - Command command = null; - String name = getName(); - if (name == null) { - name = (String) context.get(getNameKey()); - } - if (name != null) { - command = catalog.getCommand(name); - if ((command == null) && !isOptional()) { - throw new IllegalArgumentException(name); - } - return (command); - } else { - throw new IllegalArgumentException("No command name"); - } + Catalog catalog = (Catalog) + context.get(getCatalogKey()); + if (catalog == null) { + throw new IllegalArgumentException(getCatalogKey()); + } + Command command = null; + String name = getName(); + if (name == null) { + name = (String) context.get(getNameKey()); + } + if (name != null) { + command = catalog.getCommand(name); + if ((command == null) && !isOptional()) { + throw new IllegalArgumentException(name); + } + return (command); + } else { + throw new IllegalArgumentException("No command name"); + } } 1.5 +8 -8 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/generic/RemoveCommand.java Index: RemoveCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/generic/RemoveCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RemoveCommand.java 12 Oct 2003 09:10:54 -0000 1.4 +++ RemoveCommand.java 18 Oct 2003 05:30:18 -0000 1.5 @@ -87,7 +87,7 @@ */ public String getFromKey() { - return (this.fromKey); + return (this.fromKey); } @@ -99,7 +99,7 @@ */ public void setFromKey(String fromKey) { - this.fromKey = fromKey; + this.fromKey = fromKey; } @@ -117,8 +117,8 @@ */ public boolean execute(Context context) throws Exception { - context.remove(getFromKey()); - return (false); + context.remove(getFromKey()); + return (false); } 1.7 +23 -23 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/impl/CatalogBase.java Index: CatalogBase.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/impl/CatalogBase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- CatalogBase.java 12 Oct 2003 09:10:55 -0000 1.6 +++ CatalogBase.java 18 Oct 2003 05:30:19 -0000 1.7 @@ -116,25 +116,25 @@ } - /** - * Converts this Catalog to a String. Useful for debugging purposes. - * @return a representation of this catalog as a String - */ - public String toString() { + /** + * Converts this Catalog to a String. Useful for debugging purposes. + * @return a representation of this catalog as a String + */ + public String toString() { - Iterator names = getNames(); - StringBuffer str = - new StringBuffer("[" + this.getClass().getName() + ": "); + Iterator names = getNames(); + StringBuffer str = + new StringBuffer("[" + this.getClass().getName() + ": "); - while (names.hasNext()) { - str.append(names.next()); - if (names.hasNext()) { - str.append(", "); - } - } - str.append("]"); + while (names.hasNext()) { + str.append(names.next()); + if (names.hasNext()) { + str.append(", "); + } + } + str.append("]"); - return str.toString(); + return str.toString(); - } + } } 1.4 +8 -8 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/AbstractGetLocaleCommand.java Index: AbstractGetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/AbstractGetLocaleCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractGetLocaleCommand.java 12 Oct 2003 09:10:40 -0000 1.3 +++ AbstractGetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -95,7 +95,7 @@ */ public String getLocaleKey() { - return (this.localeKey); + return (this.localeKey); } @@ -108,7 +108,7 @@ */ public void setLocaleKey(String localeKey) { - this.localeKey = localeKey; + this.localeKey = localeKey; } @@ -126,8 +126,8 @@ */ public boolean execute(Context context) throws Exception { - context.put(getLocaleKey(), getLocale(context)); - return (false); + context.put(getLocaleKey(), getLocale(context)); + return (false); } 1.4 +9 -9 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/AbstractSetLocaleCommand.java Index: AbstractSetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/AbstractSetLocaleCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractSetLocaleCommand.java 12 Oct 2003 09:10:40 -0000 1.3 +++ AbstractSetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -96,7 +96,7 @@ */ public String getLocaleKey() { - return (this.localeKey); + return (this.localeKey); } @@ -109,7 +109,7 @@ */ public void setLocaleKey(String localeKey) { - this.localeKey = localeKey; + this.localeKey = localeKey; } @@ -127,9 +127,9 @@ */ public boolean execute(Context context) throws Exception { - setLocale(context, - (Locale) context.get(getLocaleKey())); - return (false); + setLocale(context, + (Locale) context.get(getLocaleKey())); + return (false); } 1.5 +6 -6 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/faces/FacesGetLocaleCommand.java Index: FacesGetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/faces/FacesGetLocaleCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FacesGetLocaleCommand.java 12 Oct 2003 09:10:40 -0000 1.4 +++ FacesGetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -85,9 +85,9 @@ */ protected Locale getLocale(Context context) { - FacesContext fcontext = (FacesContext) - context.get("context"); - return (fcontext.getLocale()); + FacesContext fcontext = (FacesContext) + context.get("context"); + return (fcontext.getLocale()); } 1.5 +6 -6 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/faces/FacesSetLocaleCommand.java Index: FacesSetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/faces/FacesSetLocaleCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FacesSetLocaleCommand.java 12 Oct 2003 09:10:40 -0000 1.4 +++ FacesSetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -82,9 +82,9 @@ protected void setLocale(Context context, Locale locale) { - FacesContext fcontext = (FacesContext) - context.get("context"); - fcontext.setLocale(locale); + FacesContext fcontext = (FacesContext) + context.get("context"); + fcontext.setLocale(locale); } 1.4 +13 -13 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/faces/FacesWebContext.java Index: FacesWebContext.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/faces/FacesWebContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FacesWebContext.java 12 Oct 2003 09:10:40 -0000 1.3 +++ FacesWebContext.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -126,7 +126,7 @@ */ public FacesContext getContext() { - return (this.context); + return (this.context); } @@ -163,56 +163,56 @@ public Map getApplicationScope() { - return (context.getExternalContext().getApplicationMap()); + return (context.getExternalContext().getApplicationMap()); } public Map getHeader() { - return (context.getExternalContext().getRequestHeaderMap()); + return (context.getExternalContext().getRequestHeaderMap()); } public Map getHeaderValues() { - return (context.getExternalContext().getRequestHeaderValuesMap()); + return (context.getExternalContext().getRequestHeaderValuesMap()); } public Map getInitParam() { - return (context.getExternalContext().getInitParameterMap()); + return (context.getExternalContext().getInitParameterMap()); } public Map getParam() { - return (context.getExternalContext().getRequestParameterMap()); + return (context.getExternalContext().getRequestParameterMap()); } public Map getParamValues() { - return (context.getExternalContext().getRequestParameterValuesMap()); + return (context.getExternalContext().getRequestParameterValuesMap()); } public Map getRequestScope() { - return (context.getExternalContext().getRequestMap()); + return (context.getExternalContext().getRequestMap()); } public Map getSessionScope() { - return (context.getExternalContext().getSessionMap()); + return (context.getExternalContext().getSessionMap()); } 1.5 +6 -6 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletGetLocaleCommand.java Index: PortletGetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletGetLocaleCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PortletGetLocaleCommand.java 12 Oct 2003 09:10:21 -0000 1.4 +++ PortletGetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -85,9 +85,9 @@ */ protected Locale getLocale(Context context) { - PortletRequest request = (PortletRequest) - context.get("request"); - return (request.getLocale()); + PortletRequest request = (PortletRequest) + context.get("request"); + return (request.getLocale()); } 1.3 +9 -9 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletSessionScopeMap.java Index: PortletSessionScopeMap.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletSessionScopeMap.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PortletSessionScopeMap.java 12 Oct 2003 09:10:21 -0000 1.2 +++ PortletSessionScopeMap.java 18 Oct 2003 05:30:19 -0000 1.3 @@ -111,7 +111,7 @@ return (false); } Enumeration keys = - session.getAttributeNames(PortletSession.PORTLET_SCOPE); + session.getAttributeNames(PortletSession.PORTLET_SCOPE); while (keys.hasMoreElements()) { Object next = session.getAttribute((String) keys.nextElement()); if (next == value) { @@ -125,7 +125,7 @@ public Set entrySet() { Set set = new HashSet(); Enumeration keys = - session.getAttributeNames(PortletSession.PORTLET_SCOPE); + session.getAttributeNames(PortletSession.PORTLET_SCOPE); while (keys.hasMoreElements()) { set.add(session.getAttribute((String) keys.nextElement())); } @@ -156,7 +156,7 @@ public Set keySet() { Set set = new HashSet(); Enumeration keys = - session.getAttributeNames(PortletSession.PORTLET_SCOPE); + session.getAttributeNames(PortletSession.PORTLET_SCOPE); while (keys.hasMoreElements()) { set.add(keys.nextElement()); } @@ -195,7 +195,7 @@ public int size() { int n = 0; Enumeration keys = - session.getAttributeNames(PortletSession.PORTLET_SCOPE); + session.getAttributeNames(PortletSession.PORTLET_SCOPE); while (keys.hasMoreElements()) { keys.nextElement(); n++; @@ -207,7 +207,7 @@ public Collection values() { List list = new ArrayList(); Enumeration keys = - session.getAttributeNames(PortletSession.PORTLET_SCOPE); + session.getAttributeNames(PortletSession.PORTLET_SCOPE); while (keys.hasMoreElements()) { list.add(session.getAttribute((String) keys.nextElement())); } 1.5 +7 -7 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletSetLocaleCommand.java Index: PortletSetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletSetLocaleCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PortletSetLocaleCommand.java 12 Oct 2003 09:10:21 -0000 1.4 +++ PortletSetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -82,10 +82,10 @@ protected void setLocale(Context context, Locale locale) { - PortletResponse response = (PortletResponse) - context.get("response"); - // response.setLocale(locale); - // Not supported by the Portlet API + PortletResponse response = (PortletResponse) + context.get("response"); + // response.setLocale(locale); + // Not supported by the Portlet API } 1.4 +12 -12 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletWebContext.java Index: PortletWebContext.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/portlet/PortletWebContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PortletWebContext.java 12 Oct 2003 09:10:21 -0000 1.3 +++ PortletWebContext.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -200,7 +200,7 @@ */ public PortletContext getContext() { - return (this.context); + return (this.context); } @@ -210,7 +210,7 @@ */ public PortletRequest getRequest() { - return (this.request); + return (this.request); } @@ -220,7 +220,7 @@ */ public PortletResponse getResponse() { - return (this.response); + return (this.response); } @@ -290,8 +290,8 @@ public Map getHeader() { if ((header == null) && (request != null)) { - // header = new PortletHeaderMap(request); - header = Collections.EMPTY_MAP; + // header = new PortletHeaderMap(request); + header = Collections.EMPTY_MAP; } return (header); @@ -301,8 +301,8 @@ public Map getHeaderValues() { if ((headerValues == null) && (request != null)) { - // headerValues = new PortletHeaderValuesMap(request); - headerValues = Collections.EMPTY_MAP; + // headerValues = new PortletHeaderValuesMap(request); + headerValues = Collections.EMPTY_MAP; } return (headerValues); @@ -353,7 +353,7 @@ if ((sessionScope == null) && (request != null)) { sessionScope = - new PortletSessionScopeMap(request.getPortletSession()); + new PortletSessionScopeMap(request.getPortletSession()); } return (sessionScope); 1.5 +6 -6 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/servlet/ServletGetLocaleCommand.java Index: ServletGetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/servlet/ServletGetLocaleCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ServletGetLocaleCommand.java 12 Oct 2003 09:10:41 -0000 1.4 +++ ServletGetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -85,9 +85,9 @@ */ protected Locale getLocale(Context context) { - HttpServletRequest request = (HttpServletRequest) - context.get("request"); - return (request.getLocale()); + HttpServletRequest request = (HttpServletRequest) + context.get("request"); + return (request.getLocale()); } 1.5 +6 -6 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/servlet/ServletSetLocaleCommand.java Index: ServletSetLocaleCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/servlet/ServletSetLocaleCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ServletSetLocaleCommand.java 12 Oct 2003 09:10:41 -0000 1.4 +++ ServletSetLocaleCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -82,9 +82,9 @@ protected void setLocale(Context context, Locale locale) { - HttpServletResponse response = (HttpServletResponse) - context.get("response"); - response.setLocale(locale); + HttpServletResponse response = (HttpServletResponse) + context.get("response"); + response.setLocale(locale); } 1.4 +7 -7 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/servlet/ServletWebContext.java Index: ServletWebContext.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/web/servlet/ServletWebContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ServletWebContext.java 12 Oct 2003 09:10:41 -0000 1.3 +++ ServletWebContext.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -198,7 +198,7 @@ */ public ServletContext getContext() { - return (this.context); + return (this.context); } @@ -208,7 +208,7 @@ */ public HttpServletRequest getRequest() { - return (this.request); + return (this.request); } @@ -218,7 +218,7 @@ */ public HttpServletResponse getResponse() { - return (this.response); + return (this.response); } 1.5 +98 -98 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/config/ConfigParserTestCase.java Index: ConfigParserTestCase.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/config/ConfigParserTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ConfigParserTestCase.java 12 Oct 2003 09:11:52 -0000 1.4 +++ ConfigParserTestCase.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -82,7 +82,7 @@ private static final String DEFAULT_XML = - "/org/apache/commons/chain/config/test-config.xml"; + "/org/apache/commons/chain/config/test-config.xml"; // ------------------------------------------------------------ Constructors @@ -126,9 +126,9 @@ * Set up instance variables required by this test case. */ public void setUp() { - catalog = new CatalogBase(); - context = new ContextBase(); - parser = new ConfigParser(); + catalog = new CatalogBase(); + context = new ContextBase(); + parser = new ConfigParser(); } @@ -144,9 +144,9 @@ * Tear down instance variables required by this test case. */ public void tearDown() { - parser = null; - context = null; - catalog = null; + parser = null; + context = null; + catalog = null; } @@ -156,11 +156,11 @@ // Load the default test-config.xml file and examine the results public void testDefaut() throws Exception { - // Check overall command count - load(DEFAULT_XML); - checkCommandCount(17); + // Check overall command count + load(DEFAULT_XML); + checkCommandCount(17); - // Check individual single command instances + // Check individual single command instances Command command = null; command = catalog.getCommand("AddingCommand"); @@ -194,13 +194,13 @@ command = catalog.getCommand("ChainBase"); assertNotNull(command); assertTrue(command instanceof ChainBase); - assertTrue(command instanceof TestChain); + assertTrue(command instanceof TestChain); - // Check configurable properties instance - TestCommand tcommand = (TestCommand) catalog.getCommand("Configurable"); - assertNotNull(tcommand); - assertEquals("Foo Value", tcommand.getFoo()); - assertEquals("Bar Value", tcommand.getBar()); + // Check configurable properties instance + TestCommand tcommand = (TestCommand) catalog.getCommand("Configurable"); + assertNotNull(tcommand); + assertEquals("Foo Value", tcommand.getFoo()); + assertEquals("Bar Value", tcommand.getBar()); } @@ -208,10 +208,10 @@ // Test execution of chain "Execute2a" public void testExecute2a() throws Exception { - load(DEFAULT_XML); - assertTrue("Chain returned true", - catalog.getCommand("Execute2a").execute(context)); - checkExecuteLog("1/2/3"); + load(DEFAULT_XML); + assertTrue("Chain returned true", + catalog.getCommand("Execute2a").execute(context)); + checkExecuteLog("1/2/3"); } @@ -219,10 +219,10 @@ // Test execution of chain "Execute2b" public void testExecute2b() throws Exception { - load(DEFAULT_XML); - assertTrue("Chain returned false", - !catalog.getCommand("Execute2b").execute(context)); - checkExecuteLog("1/2/3"); + load(DEFAULT_XML); + assertTrue("Chain returned false", + !catalog.getCommand("Execute2b").execute(context)); + checkExecuteLog("1/2/3"); } @@ -230,14 +230,14 @@ // Test execution of chain "Execute2c" public void testExecute2c() throws Exception { - load(DEFAULT_XML); - try { - catalog.getCommand("Execute2c").execute(context); - } catch (ArithmeticException e) { - assertEquals("Correct exception id", - "3", e.getMessage()); - } - checkExecuteLog("1/2/3"); + load(DEFAULT_XML); + try { + catalog.getCommand("Execute2c").execute(context); + } catch (ArithmeticException e) { + assertEquals("Correct exception id", + "3", e.getMessage()); + } + checkExecuteLog("1/2/3"); } @@ -245,14 +245,14 @@ // Test execution of chain "Execute2d" public void testExecute2d() throws Exception { - load(DEFAULT_XML); - try { - catalog.getCommand("Execute2d").execute(context); - } catch (ArithmeticException e) { - assertEquals("Correct exception id", - "2", e.getMessage()); - } - checkExecuteLog("1/2"); + load(DEFAULT_XML); + try { + catalog.getCommand("Execute2d").execute(context); + } catch (ArithmeticException e) { + assertEquals("Correct exception id", + "2", e.getMessage()); + } + checkExecuteLog("1/2"); } @@ -260,10 +260,10 @@ // Test execution of chain "Execute4a" public void testExecute4a() throws Exception { - load(DEFAULT_XML); - assertTrue("Chain returned true", - catalog.getCommand("Execute4a").execute(context)); - checkExecuteLog("1/2/3/c/a"); + load(DEFAULT_XML); + assertTrue("Chain returned true", + catalog.getCommand("Execute4a").execute(context)); + checkExecuteLog("1/2/3/c/a"); } @@ -271,10 +271,10 @@ // Test execution of chain "Execute2b" public void testExecute4b() throws Exception { - load(DEFAULT_XML); - assertTrue("Chain returned false", - !catalog.getCommand("Execute4b").execute(context)); - checkExecuteLog("1/2/3/b"); + load(DEFAULT_XML); + assertTrue("Chain returned false", + !catalog.getCommand("Execute4b").execute(context)); + checkExecuteLog("1/2/3/b"); } @@ -282,14 +282,14 @@ // Test execution of chain "Execute4c" public void testExecute4c() throws Exception { - load(DEFAULT_XML); - try { - catalog.getCommand("Execute4c").execute(context); - } catch (ArithmeticException e) { - assertEquals("Correct exception id", - "3", e.getMessage()); - } - checkExecuteLog("1/2/3/c/b/a"); + load(DEFAULT_XML); + try { + catalog.getCommand("Execute4c").execute(context); + } catch (ArithmeticException e) { + assertEquals("Correct exception id", + "3", e.getMessage()); + } + checkExecuteLog("1/2/3/c/b/a"); } @@ -297,14 +297,14 @@ // Test execution of chain "Execute4d" public void testExecute4d() throws Exception { - load(DEFAULT_XML); - try { - catalog.getCommand("Execute4d").execute(context); - } catch (ArithmeticException e) { - assertEquals("Correct exception id", - "2", e.getMessage()); - } - checkExecuteLog("1/2/b/a"); + load(DEFAULT_XML); + try { + catalog.getCommand("Execute4d").execute(context); + } catch (ArithmeticException e) { + assertEquals("Correct exception id", + "2", e.getMessage()); + } + checkExecuteLog("1/2/b/a"); } @@ -312,36 +312,36 @@ // Test a pristine ConfigParser instance public void testPristine() { - // Validate the "digester" property - Digester digester = parser.getDigester(); - assertNotNull("Returned a Digester instance", digester); - assertTrue("Default namespaceAware", - !digester.getNamespaceAware()); - assertTrue("Default useContextClassLoader", - digester.getUseContextClassLoader()); - assertTrue("Default validating", - !digester.getValidating()); - - // Validate the "ruleSet" property - ConfigRuleSet ruleSet = (ConfigRuleSet) parser.getRuleSet(); - assertNotNull("Returned a RuleSet instance", ruleSet); - assertEquals("Default chainElement", - "chain", ruleSet.getChainElement()); - assertEquals("Default classAttribute", - "className", ruleSet.getClassAttribute()); - assertEquals("Default commandElement", - "command", ruleSet.getCommandElement()); - assertEquals("Default nameAttribute", - "name", ruleSet.getNameAttribute()); - assertNull("Default namespaceURI", - ruleSet.getNamespaceURI()); - - // Validate the "useContextClassLoader" property - assertTrue("Defaults to use context class loader", - parser.getUseContextClassLoader()); + // Validate the "digester" property + Digester digester = parser.getDigester(); + assertNotNull("Returned a Digester instance", digester); + assertTrue("Default namespaceAware", + !digester.getNamespaceAware()); + assertTrue("Default useContextClassLoader", + digester.getUseContextClassLoader()); + assertTrue("Default validating", + !digester.getValidating()); + + // Validate the "ruleSet" property + ConfigRuleSet ruleSet = (ConfigRuleSet) parser.getRuleSet(); + assertNotNull("Returned a RuleSet instance", ruleSet); + assertEquals("Default chainElement", + "chain", ruleSet.getChainElement()); + assertEquals("Default classAttribute", + "className", ruleSet.getClassAttribute()); + assertEquals("Default commandElement", + "command", ruleSet.getCommandElement()); + assertEquals("Default nameAttribute", + "name", ruleSet.getNameAttribute()); + assertNull("Default namespaceURI", + ruleSet.getNamespaceURI()); + + // Validate the "useContextClassLoader" property + assertTrue("Defaults to use context class loader", + parser.getUseContextClassLoader()); - // Ensure that there are no preconfigured commands in the catalog - checkCommandCount(0); + // Ensure that there are no preconfigured commands in the catalog + checkCommandCount(0); } @@ -373,7 +373,7 @@ // Load the specified catalog from the specified resource path protected void load(String path) throws Exception { - parser.parse(catalog, this.getClass().getResource(path)); + parser.parse(catalog, this.getClass().getResource(path)); } 1.3 +4 -4 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/config/TestChain.java Index: TestChain.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/config/TestChain.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestChain.java 12 Oct 2003 09:11:52 -0000 1.2 +++ TestChain.java 18 Oct 2003 05:30:19 -0000 1.3 @@ -76,7 +76,7 @@ public Command[] getCommands() { - return (commands); + return (commands); } 1.3 +8 -8 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/config/TestCommand.java Index: TestCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/config/TestCommand.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestCommand.java 12 Oct 2003 09:11:52 -0000 1.2 +++ TestCommand.java 18 Oct 2003 05:30:19 -0000 1.3 @@ -76,24 +76,24 @@ private String bar = null; public String getBar() { - return (this.bar); + return (this.bar); } public void setBar(String bar) { - this.bar = bar; + this.bar = bar; } private String foo = null; public String getFoo() { - return (this.foo); + return (this.foo); } public void setFoo(String foo) { - this.foo = foo; + this.foo = foo; } public boolean execute(Context context) throws Exception { - return (false); + return (false); } 1.3 +5 -5 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/AddingCommand.java Index: AddingCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/AddingCommand.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AddingCommand.java 12 Oct 2003 09:11:53 -0000 1.2 +++ AddingCommand.java 18 Oct 2003 05:30:19 -0000 1.3 @@ -84,7 +84,7 @@ public AddingCommand() { - this("", null); + this("", null); } // Construct an instance that will log the specified identifier 1.4 +5 -5 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/DelegatingCommand.java Index: DelegatingCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/DelegatingCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DelegatingCommand.java 12 Oct 2003 09:11:53 -0000 1.3 +++ DelegatingCommand.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -81,7 +81,7 @@ public DelegatingCommand() { - this(""); + this(""); } 1.4 +5 -5 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/DelegatingFilter.java Index: DelegatingFilter.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/DelegatingFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DelegatingFilter.java 12 Oct 2003 09:11:53 -0000 1.3 +++ DelegatingFilter.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -81,7 +81,7 @@ public DelegatingFilter() { - this("", ""); + this("", ""); } 1.3 +5 -5 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/ExceptionCommand.java Index: ExceptionCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/ExceptionCommand.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ExceptionCommand.java 12 Oct 2003 09:11:53 -0000 1.2 +++ ExceptionCommand.java 18 Oct 2003 05:30:19 -0000 1.3 @@ -81,7 +81,7 @@ public ExceptionCommand() { - this(""); + this(""); } 1.5 +7 -7 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/ExceptionFilter.java Index: ExceptionFilter.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/ExceptionFilter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ExceptionFilter.java 12 Oct 2003 09:11:53 -0000 1.4 +++ ExceptionFilter.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -80,7 +80,7 @@ public ExceptionFilter() { - this("", ""); + this("", ""); } @@ -95,10 +95,10 @@ protected String id2 = null; public String getId2() { - return (this.id2); + return (this.id2); } public void setId2(String id2) { - this.id2 = id2; + this.id2 = id2; } 1.5 +6 -6 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/NonDelegatingCommand.java Index: NonDelegatingCommand.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/NonDelegatingCommand.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- NonDelegatingCommand.java 12 Oct 2003 09:11:53 -0000 1.4 +++ NonDelegatingCommand.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -81,7 +81,7 @@ public NonDelegatingCommand() { - this(""); + this(""); } @@ -102,7 +102,7 @@ } public void setId(String id) { - this.id = id; + this.id = id; } 1.5 +7 -7 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/NonDelegatingFilter.java Index: NonDelegatingFilter.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/impl/NonDelegatingFilter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- NonDelegatingFilter.java 12 Oct 2003 09:11:53 -0000 1.4 +++ NonDelegatingFilter.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -82,7 +82,7 @@ public NonDelegatingFilter() { - this("", ""); + this("", ""); } @@ -98,10 +98,10 @@ protected String id2 = null; public String getId2() { - return (this.id2); + return (this.id2); } public void setId2(String id2) { - this.id2 = id2; + this.id2 = id2; } 1.4 +6 -6 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java Index: MockHttpServletRequest.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MockHttpServletRequest.java 12 Oct 2003 09:11:16 -0000 1.3 +++ MockHttpServletRequest.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -392,12 +392,12 @@ public String getLocalName() { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } public int getLocalPort() { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } @@ -452,7 +452,7 @@ public int getRemotePort() { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } 1.4 +6 -6 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java Index: MockHttpServletResponse.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MockHttpServletResponse.java 12 Oct 2003 09:11:16 -0000 1.3 +++ MockHttpServletResponse.java 18 Oct 2003 05:30:19 -0000 1.4 @@ -192,7 +192,7 @@ public String getContentType() { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } @@ -232,7 +232,7 @@ public void setCharacterEncoding(String encoding) { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } @@ -247,7 +247,7 @@ public void setLocale(Locale locale) { - this.locale = locale; + this.locale = locale; } 1.5 +25 -25 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/ServletGetLocaleCommandTestCase.java Index: ServletGetLocaleCommandTestCase.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/ServletGetLocaleCommandTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ServletGetLocaleCommandTestCase.java 12 Oct 2003 09:11:16 -0000 1.4 +++ ServletGetLocaleCommandTestCase.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -115,20 +115,20 @@ */ public void setUp() { - locale = new Locale("en", "US"); + locale = new Locale("en", "US"); - // Set up Servlet API Objects + // Set up Servlet API Objects scontext = new MockServletContext(); session = new MockHttpSession(scontext); request = new MockHttpServletRequest("/context", "/servlet", "/path/info", "a=b&c=d", session); - ((MockHttpServletRequest) request).setLocale(locale); + ((MockHttpServletRequest) request).setLocale(locale); response = new MockHttpServletResponse(); - // Set up Chain API Objects + // Set up Chain API Objects context = new ServletWebContext(scontext, request, response); - command = new ServletGetLocaleCommand(); + command = new ServletGetLocaleCommand(); } @@ -154,7 +154,7 @@ response = null; context = null; - command = null; + command = null; } @@ -165,9 +165,9 @@ // Test configured behavior public void testConfigured() throws Exception { - command.setLocaleKey("special"); - assertEquals("special", command.getLocaleKey()); - check(context, command); + command.setLocaleKey("special"); + assertEquals("special", command.getLocaleKey()); + check(context, command); } @@ -175,8 +175,8 @@ // Test default behavior public void testDefaut() throws Exception { - assertEquals("locale", command.getLocaleKey()); - check(context, command); + assertEquals("locale", command.getLocaleKey()); + check(context, command); } @@ -185,18 +185,18 @@ protected void check(Context context, ServletGetLocaleCommand command) - throws Exception { + throws Exception { - String localeKey = command.getLocaleKey(); - assertNotNull(localeKey); - Object value = context.get(localeKey); - assertNull(value); - boolean result = command.execute(context); - assertFalse(result); - value = context.get(localeKey); - assertNotNull(value); - assertTrue(value instanceof Locale); - assertEquals(locale, (Locale) value); + String localeKey = command.getLocaleKey(); + assertNotNull(localeKey); + Object value = context.get(localeKey); + assertNull(value); + boolean result = command.execute(context); + assertFalse(result); + value = context.get(localeKey); + assertNotNull(value); + assertTrue(value instanceof Locale); + assertEquals(locale, (Locale) value); } 1.5 +25 -25 jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/ServletSetLocaleCommandTestCase.java Index: ServletSetLocaleCommandTestCase.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/test/org/apache/commons/chain/web/servlet/ServletSetLocaleCommandTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ServletSetLocaleCommandTestCase.java 12 Oct 2003 09:11:16 -0000 1.4 +++ ServletSetLocaleCommandTestCase.java 18 Oct 2003 05:30:19 -0000 1.5 @@ -115,9 +115,9 @@ */ public void setUp() { - locale = new Locale("en", "US"); + locale = new Locale("en", "US"); - // Set up Servlet API Objects + // Set up Servlet API Objects scontext = new MockServletContext(); session = new MockHttpSession(scontext); request = new MockHttpServletRequest("/context", "/servlet", @@ -125,9 +125,9 @@ session); response = new MockHttpServletResponse(); - // Set up Chain API Objects + // Set up Chain API Objects context = new ServletWebContext(scontext, request, response); - command = new ServletGetLocaleCommand(); + command = new ServletGetLocaleCommand(); } @@ -153,7 +153,7 @@ response = null; context = null; - command = null; + command = null; } @@ -164,9 +164,9 @@ // Test configured behavior public void testConfigured() throws Exception { - command.setLocaleKey("special"); - assertEquals("special", command.getLocaleKey()); - check(context, command); + command.setLocaleKey("special"); + assertEquals("special", command.getLocaleKey()); + check(context, command); } @@ -174,8 +174,8 @@ // Test default behavior public void testDefaut() throws Exception { - assertEquals("locale", command.getLocaleKey()); - check(context, command); + assertEquals("locale", command.getLocaleKey()); + check(context, command); } @@ -184,19 +184,19 @@ protected void check(Context context, ServletGetLocaleCommand command) - throws Exception { + throws Exception { - String localeKey = command.getLocaleKey(); - assertNotNull(localeKey); - Object value = context.get(localeKey); - assertNull(value); - context.put(localeKey, locale); - assertNotNull(context.get(localeKey)); - assertNull(response.getLocale()); - boolean result = command.execute(context); - assertFalse(result); - assertNotNull(response.getLocale()); - assertEquals(locale, response.getLocale()); + String localeKey = command.getLocaleKey(); + assertNotNull(localeKey); + Object value = context.get(localeKey); + assertNull(value); + context.put(localeKey, locale); + assertNotNull(context.get(localeKey)); + assertNull(response.getLocale()); + boolean result = command.execute(context); + assertFalse(result); + assertNotNull(response.getLocale()); + assertEquals(locale, response.getLocale()); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]