[EMAIL PROTECTED] writes: This is cool, but IMHO it is still a little early to start doing a big architectural upheaval. Things like getting a container properly intergrated or shooting at the service broker should preference over this. And, IMHO, this isn't really necessary. You can easily add the tests and examples to Fulcrum and test with the Turbine-2.3.jar
No need to deprecate services yet. IMHO, it is still a little early. Regards Henning >epugh 2003/09/09 08:04:51 > Modified: . project.xml > src/java/org/apache/turbine/services/localization > TurbineLocalizationService.java > LocalizationTool.java LocalizationService.java > LocaleTokenizer.java > src/java/org/apache/turbine/services > InstantiationException.java > Added: conf/test TestLocalization.properties > componentLocalizationConfiguration.xml > roleLocalizationConfiguration.xml > src/test/org/apache/turbine/services/localization > BarBundle_en_US.java LocalizationToolTest.java > src/test/org/apache/turbine/test > EnhancedMockHttpServletRequest.java > Log: > Deprecated Turbine localization in favor of using the Fulcrum Localization service. > the way in is via the LocalizationTool, so if that is all you use, it should be > pretty > much backwards code compatible. I added a unit test that verifies that the fulcrum > localization service loads up. The unit test leverages mock http objects. All > jars are on the turbine repo: jakarta.apache.org/turbine/repo. > > Revision Changes Path > 1.139 +19 -0 jakarta-turbine-2/project.xml > > Index: project.xml > =================================================================== > RCS file: /home/cvs/jakarta-turbine-2/project.xml,v > retrieving revision 1.138 > retrieving revision 1.139 > diff -u -r1.138 -r1.139 > --- project.xml 3 Sep 2003 09:35:47 -0000 1.138 > +++ project.xml 9 Sep 2003 15:04:51 -0000 1.139 > @@ -398,6 +398,14 @@ > <url>http://jakarta.apache.org/avalon/</url> > </dependency> > <dependency> > + <id>fulcrum-localization</id> > + <version>1.0-alpha-3</version> > + <url>http://jakarta.apache.org/turbine/fulcrum/</url> > + <properties> > + <war.bundle.jar>true</war.bundle.jar> > + </properties> > + </dependency> > + <dependency> > <id>jaf:activation</id> > <version>1.0.2</version> > <url>http://java.sun.com/products/javabeans/glasgow/jaf.html</url> > @@ -489,6 +497,17 @@ > <version>1.2-b1</version> > <url>http://xml.apache.org/xmlrpc/</url> > </dependency> > + > + <dependency> > + <groupId>mockobjects</groupId> > + <artifactId>mockobjects-jdk1.4-j2ee1.3</artifactId> > + <version>0.09</version> > + </dependency> > + <dependency> > + <groupId>mockobjects</groupId> > + <artifactId>mockobjects-core</artifactId> > + <version>0.09</version> > + </dependency> > </dependencies> > > <build> > > > > 1.1 jakarta-turbine-2/conf/test/TestLocalization.properties > > Index: TestLocalization.properties > =================================================================== > # ------------------------------------------------------------------- > # $Id: TestLocalization.properties,v 1.1 2003/09/09 15:04:51 epugh Exp $ > # > # This is the configuration file for Turbine. > # > # Note that strings containing "," (comma) characters must backslash > # escape the comma (i.e. '\,') > # > # ------------------------------------------------------------------- > > # ------------------------------------------------------------------- > # > # L O G 4 J - L O G G I N G > # > # ------------------------------------------------------------------- > > log4j.file = /conf/test/Log4j.properties > > > > # If module.cache=true, then how large should we make the hashtables > # by default. > > action.cache.size=20 > layout.cache.size=10 > navigation.cache.size=10 > page.cache.size=5 > screen.cache.size=50 > scheduledjob.cache.size=10 > > # ------------------------------------------------------------------- > # > # M O D U L E P A C K A G E S > # > # ------------------------------------------------------------------- > # This is the "classpath" for Turbine. In order to locate your own > # modules, you should add them to this path. For example, if you have > # com.company.actions, com.company.screens, com.company.navigations, > # then this setting would be "com.company,org.apache.turbine.modules". > # This path is searched in order. For example, Turbine comes with a > # screen module named "Login". If you wanted to have your own screen > # module named "Login", then you would specify the path to your > # modules before the others. > # > # Note: org.apache.turbine.modules will always be added to the search > # path. If it is not explictly added here, it will be added to the > # end. > # > # Default: org.apache.turbine.modules > # ------------------------------------------------------------------- > > [EMAIL PROTECTED]@ > > > > > services.AvalonComponentService.classname=org.apache.turbine.services.avaloncomponent.TurbineAvalonComponentService > > services.CryptoService.classname=org.apache.turbine.services.crypto.TurbineCryptoService > > services.ComponentService.classname=org.apache.turbine.services.component.TurbineComponentService > > services.FactoryService.classname=org.apache.turbine.services.factory.TurbineFactoryService > services.PoolService.classname=org.apache.turbine.services.pool.TurbinePoolService > > services.RunDataService.classname=org.apache.turbine.services.rundata.TurbineRunDataService > > services.ServletService.classname=org.apache.turbine.services.servlet.TurbineServletService > > services.AssemblerBrokerService.classname=org.apache.turbine.services.assemblerbroker.TurbineAssemblerBrokerService > > services.LocalizationService.classname=org.apache.turbine.services.localization.TurbineLocalizationService > > services.MimeTypeService.classname=org.apache.turbine.services.mimetype.TurbineMimeTypeService > services.PullService.classname=org.apache.turbine.services.pull.TurbinePullService > > services.TemplateService.classname=org.apache.turbine.services.template.TurbineTemplateService > > > > > > services.RunDataService.default.run.data=org.apache.turbine.services.rundata.DefaultTurbineRunData > > services.RunDataService.default.parameter.parser=org.apache.turbine.util.parser.DefaultParameterParser > > services.RunDataService.default.cookie.parser=org.apache.turbine.util.parser.DefaultCookieParser > > # ------------------------------------------------------------------- > # > # A S S E M B L E R B R O K E R S E R V I C E > # > # ------------------------------------------------------------------- > # A list of AssemblerFactory classes that will be registered > # with TurbineAssemblerBrokerService > # ------------------------------------------------------------------- > > > services.AssemblerBrokerService.screen=org.apache.turbine.services.assemblerbroker.util.java.JavaScreenFactory > > #services.AssemblerBrokerService.screen=org.apache.turbine.services.assemblerbroker.util.python.PythonScreenFactory > > services.AssemblerBrokerService.action=org.apache.turbine.services.assemblerbroker.util.java.JavaActionFactory > > services.AssemblerBrokerService.layout=org.apache.turbine.services.assemblerbroker.util.java.JavaLayoutFactory > > services.AssemblerBrokerService.page=org.apache.turbine.services.assemblerbroker.util.java.JavaPageFactory > > services.AssemblerBrokerService.navigation=org.apache.turbine.services.assemblerbroker.util.java.JavaNavigationFactory > > services.AssemblerBrokerService.scheduledjob=org.apache.turbine.services.assemblerbroker.util.java.JavaScheduledJobFactory > > # ------------------------------------------------------------------- > # > # T E M P L A T E S E R V I C E > # > # ------------------------------------------------------------------- > > # Roughly, the number of templates in each category. > # > # Defaults: layout=2, navigation=10, screen=50 > > services.TemplateService.layout.cache.size=2 > services.TemplateService.navigation.cache.size=10 > services.TemplateService.screen.cache.size=50 > > services.PullService.earlyInit= true > > services.PullService.tools.per.request.refresh=true > > tool.request.l10n=org.apache.turbine.services.localization.LocalizationTool > > > # ------------------------------------------------------------------- > # > # L O C A L I Z A T I O N S E R V I C E > # > # ------------------------------------------------------------------- > > # Default ResourceBundle and language/country codes used by the > # TurbineLocalizationService. > # > locale.default.bundle=MyBundle > locale.default.language=en > locale.default.country=US > > # > # This will set the charset= portion of the ContentType: header. > # Leave commented out unless you want to return stuff as a different > # charset. > # > # locale.default.charset= > > # ------------------------------------------------------------------- > # > # P O O L S E R V I C E > # > # ------------------------------------------------------------------- > > # Default capacity of pools of the Object pooling service. > # > # Default: 128 > services.PoolService.pool.capacity = 128 > > # Class specific capacities used instead of the default if specified. > # > > #services.PoolService.pool.capacity.org.apache.turbine.services.rundata.DefaultTurbineRunData=512 > > # ------------------------------------------------------------------- > # > # F A C T O R Y S E R V I C E > # > # ------------------------------------------------------------------- > > # A comma separated list of classloaders (very optional) > # > # Example: org.foo.bar.MyClassLoader, org.ack.joe.YourClassLoader > # > #services.FactoryService.class.loaders= > > # Customized factories to be used instead of the default factory. > # E.g. to instantiate XML parsers, SSL sockets, etc., which require > # specific instantiation not supported by the default factory. > # The property name is prefixed with "factory" followed by the > # name of the production class. The value is the class name of > # the factory implementing the Factory interface. The factory > # will be instantiated by using the service itself. > # > # Examples: > # > # > services.FactoryService.factory.javax.xml.parsers.DocumentBuilder=org.foo.xml.DomBuilderFactory > # > services.FactoryService.factory.javax.xml.parsers.SAXParser=org.foo.xml.SaxParserFactory > # > services.FactoryService.factory.java.net.ServerSocket=org.foo.net.SslServerSocketFactory > > services.AvalonComponentService.componentConfiguration = > conf/test/componentLocalizationConfiguration.xml > services.AvalonComponentService.componentRoles = > conf/test/roleLocalizationConfiguration.xml > > > > 1.1 > jakarta-turbine-2/conf/test/componentLocalizationConfiguration.xml > > Index: componentLocalizationConfiguration.xml > =================================================================== > <!-- This configuration file for Avalon components is used for testing the > LocalizationTool pull tool --> > > <componentConfig> > <localization> > <bundles> > <bundle>org.apache.turbine.services.localization.BarBundle</bundle> > </bundles> > </localization> > </componentConfig> > > > > 1.1 jakarta-turbine-2/conf/test/roleLocalizationConfiguration.xml > > Index: roleLocalizationConfiguration.xml > =================================================================== > <!-- This configuration file for Avalon components is used for testing the > TorqueComponent --> > > <role-list> > <role > name="org.apache.fulcrum.localization.LocalizationService" > shorthand="localization" > default-class="org.apache.fulcrum.localization.DefaultLocalizationService"/> > </role-list> > > > > > 1.10 +3 -2 > jakarta-turbine-2/src/java/org/apache/turbine/services/localization/TurbineLocalizationService.java > > Index: TurbineLocalizationService.java > =================================================================== > RCS file: > /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/localization/TurbineLocalizationService.java,v > retrieving revision 1.9 > retrieving revision 1.10 > diff -u -r1.9 -r1.10 > --- TurbineLocalizationService.java 7 Apr 2003 15:42:16 -0000 1.9 > +++ TurbineLocalizationService.java 9 Sep 2003 15:04:51 -0000 1.10 > @@ -95,7 +95,8 @@ > * <li>getBundle("MyBundleName", Locale)</li> > * <li>etc.</li> > * </ul></p> > - * > + * > + * @deprecated Use the Fulcrum Localization component instead. > * @author <a href="mailto:[EMAIL PROTECTED]">Jonas Maurus</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Frank Y. Kim</a> > > > > 1.8 +30 -29 > jakarta-turbine-2/src/java/org/apache/turbine/services/localization/LocalizationTool.java > > Index: LocalizationTool.java > =================================================================== > RCS file: > /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/localization/LocalizationTool.java,v > retrieving revision 1.7 > retrieving revision 1.8 > diff -u -r1.7 -r1.8 > --- LocalizationTool.java 9 Mar 2003 03:06:29 -0000 1.7 > +++ LocalizationTool.java 9 Sep 2003 15:04:51 -0000 1.8 > @@ -1,5 +1,4 @@ > package org.apache.turbine.services.localization; > - > /* ==================================================================== > * The Apache Software License, Version 1.1 > * > @@ -53,20 +52,22 @@ > * information on the Apache Software Foundation, please see > * <http://www.apache.org/>. > */ > - > import java.util.Locale; > import java.util.MissingResourceException; > -import java.util.ResourceBundle; > - > +import org.apache.turbine.services.InstantiationException; > +import org.apache.avalon.framework.component.ComponentException; > import org.apache.commons.logging.Log; > import org.apache.commons.logging.LogFactory; > +import org.apache.fulcrum.localization.LocalizationService; > +import org.apache.turbine.services.TurbineServices; > +import org.apache.turbine.services.avaloncomponent.AvalonComponentService; > import org.apache.turbine.services.pull.ApplicationTool; > import org.apache.turbine.util.RunData; > - > /** > * A pull tool which provides lookups for localized text by delegating > - * to the configured <code>LocalizationService</code>. > + * to the configured Fulcrum <code>LocalizationService</code>. > * > + * @author <a href="mailto:[EMAIL PROTECTED]">Eric Pugh</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Jon Stevens</a> > */ > @@ -74,23 +75,33 @@ > { > /** Logging */ > private static Log log = LogFactory.getLog(LocalizationTool.class); > - > + /** Fulcrum Localization component */ > + private LocalizationService localizationService; > /** > * The language and country information parsed from the request's > * <code>Accept-Language</code> header. Reset on each request. > */ > protected Locale locale; > - > + > /** > - * The bundle for this request. > + * Lazy load the LocalizationService. > + * @return a fulcrum LocalizationService > */ > - private ResourceBundle bundle; > - > - /** > - * The name of the bundle for this tool to use. > - */ > - private String bundleName; > - > + public LocalizationService getLocalizationService() > + { > + if (localizationService == null) > + { > + AvalonComponentService acs = > + (AvalonComponentService) > TurbineServices.getInstance().getService(AvalonComponentService.SERVICE_NAME); > + try { > + localizationService = > (LocalizationService)acs.lookup(LocalizationService.ROLE); > + } > + catch (ComponentException ce) { > + throw new InstantiationException("Problem looking up > Localization Service:"+ce.getMessage()); > + } > + } > + return localizationService; > + } > /** > * Creates a new instance. Used by <code>PullService</code>. > */ > @@ -98,7 +109,6 @@ > { > refresh(); > } > - > /** > * <p>Performs text lookups for localization.</p> > * > @@ -116,7 +126,7 @@ > { > try > { > - return Localization.getString(getBundleName(null), getLocale(), key); > + return getLocalizationService().getString(getBundleName(null), > getLocale(), key); > } > catch (MissingResourceException noKey) > { > @@ -124,7 +134,6 @@ > return null; > } > } > - > /** > * Gets the current locale. > * > @@ -134,7 +143,6 @@ > { > return locale; > } > - > /** > * The return value of this method is used to set the name of the > * bundle used by this tool. Useful as a hook for using a > @@ -146,12 +154,9 @@ > */ > protected String getBundleName(Object data) > { > - return Localization.getDefaultBundleName(); > + return getLocalizationService().getDefaultBundleName(); > } > - > - > // ApplicationTool implmentation > - > /** > * Sets the request to get the <code>Accept-Language</code> header > * from (reset on each request). > @@ -162,18 +167,14 @@ > { > // Pull necessary information out of RunData while we have > // a reference to it. > - locale = Localization.getLocale(((RunData) data).getRequest()); > - bundleName = getBundleName(data); > + locale = getLocalizationService().getLocale(((RunData) > data).getRequest()); > } > } > - > /** > * No-op. > */ > public void refresh() > { > locale = null; > - bundle = null; > - bundleName = null; > } > } > > > > 1.9 +2 -1 > jakarta-turbine-2/src/java/org/apache/turbine/services/localization/LocalizationService.java > > Index: LocalizationService.java > =================================================================== > RCS file: > /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/localization/LocalizationService.java,v > retrieving revision 1.8 > retrieving revision 1.9 > diff -u -r1.8 -r1.9 > --- LocalizationService.java 7 Apr 2003 15:34:52 -0000 1.8 > +++ LocalizationService.java 9 Sep 2003 15:04:51 -0000 1.9 > @@ -71,6 +71,7 @@ > * <a > href="http://www.math.fu-berlin.de/~rene/www/java/tutorial/i18n/message/messageFormat.html">dealing > with concatenated messages</a> > * using <code>MessageFormat</code> and properties files.</p> > * > + * @deprecated Use the Fulcrum Localization component instead. > * @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Leonard Richardson</a> > > > > 1.4 +3 -2 > jakarta-turbine-2/src/java/org/apache/turbine/services/localization/LocaleTokenizer.java > > Index: LocaleTokenizer.java > =================================================================== > RCS file: > /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/localization/LocaleTokenizer.java,v > retrieving revision 1.3 > retrieving revision 1.4 > diff -u -r1.3 -r1.4 > --- LocaleTokenizer.java 9 Mar 2003 03:06:29 -0000 1.3 > +++ LocaleTokenizer.java 9 Sep 2003 15:04:51 -0000 1.4 > @@ -64,7 +64,8 @@ > /** > * Parses the HTTP <code>Accept-Language</code> header as per section > * 14.4 of RFC 2068 (HTTP 1.1 header field definitions). > - * > + * > + * @deprecated Use the Fulcrum Localization component instead. > * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a> > * @version $Id$ > */ > > > > 1.1 > jakarta-turbine-2/src/test/org/apache/turbine/services/localization/BarBundle_en_US.java > > Index: BarBundle_en_US.java > =================================================================== > package org.apache.turbine.services.localization; > > import java.util.ListResourceBundle; > > /** > * An english resource bundle for use in testing. > */ > public class BarBundle_en_US extends ListResourceBundle > { > private static final Object[][] CONTENTS = > { > { "key1", "value1" }, > { "key2", "value2" }, > { "key3", "value3" }, > { "key4", "value4" } > }; > > protected Object[][] getContents() > { > return CONTENTS; > } > } > > > > 1.1 > jakarta-turbine-2/src/test/org/apache/turbine/services/localization/LocalizationToolTest.java > > Index: LocalizationToolTest.java > =================================================================== > package org.apache.turbine.services.localization; > /* ==================================================================== > * The Apache Software License, Version 1.1 > * > * Copyright (c) 2001-2003 The Apache Software Foundation. All rights > * reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in > * the documentation and/or other materials provided with the > * distribution. > * > * 3. The end-user documentation included with the redistribution, > * if any, must include the following acknowledgment: > * "This product includes software developed by the > * Apache Software Foundation (http://www.apache.org/)." > * Alternately, this acknowledgment may appear in the software itself, > * if and wherever such third-party acknowledgments normally appear. > * > * 4. The names "Apache" and "Apache Software Foundation" and > * "Apache Turbine" must not be used to endorse or promote products > * derived from this software without prior written permission. For > * written permission, please contact [EMAIL PROTECTED] > * > * 5. Products derived from this software may not be called "Apache", > * "Apache Turbine", nor may "Apache" appear in their name, without > * prior written permission of the Apache Software Foundation. > * > * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED > * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR > * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT > * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * ==================================================================== > * > * This software consists of voluntary contributions made by many > * individuals on behalf of the Apache Software Foundation. For more > * information on the Apache Software Foundation, please see > * <http://www.apache.org/>. > */ > import java.util.Vector; > import javax.servlet.ServletConfig; > import javax.servlet.http.HttpServletResponse; > import org.apache.turbine.om.security.User; > import org.apache.turbine.services.TurbineServices; > import org.apache.turbine.services.rundata.RunDataService; > import org.apache.turbine.test.BaseTestCase; > import org.apache.turbine.test.EnhancedMockHttpServletRequest; > import org.apache.turbine.util.RunData; > import org.apache.turbine.util.TurbineConfig; > import com.mockobjects.servlet.MockHttpServletResponse; > import com.mockobjects.servlet.MockHttpSession; > import com.mockobjects.servlet.MockServletConfig; > /** > * Unit test for Localization Tool. Verifies that localization works the same > using the > * deprecated Turbine localization service as well as the new Fulcrum Localization > * component. > * > * @author <a href="mailto:[EMAIL PROTECTED]">Eric Pugh</a> > * @version $Id: LocalizationToolTest.java,v 1.1 2003/09/09 15:04:51 epugh Exp $ > */ > public class LocalizationToolTest extends BaseTestCase > { > private static TurbineConfig tc = null; > public LocalizationToolTest(String name) throws Exception > { > super(name); > } > public void testGet() throws Exception > { > LocalizationTool lt = new LocalizationTool(); > lt.init(getRunData()); > assertEquals("value1", lt.get("key1")); > assertEquals("value3", lt.get("key3")); > } > public void testGetLocale() throws Exception > { > LocalizationTool lt = new LocalizationTool(); > lt.init(getRunData()); > assertNotNull(lt.getLocale()); > assertEquals("US", lt.getLocale().getCountry()); > assertEquals("en", lt.getLocale().getLanguage()); > } > public void testInit() throws Exception > { > LocalizationTool lt = new LocalizationTool(); > lt.init(getRunData()); > assertNotNull(lt.getLocale()); > } > public void testRefresh() throws Exception > { > LocalizationTool lt = new LocalizationTool(); > lt.init(getRunData()); > assertNotNull(lt.getLocale()); > lt.refresh(); > assertNull(lt.getLocale()); > } > private RunData getRunData() throws Exception > { > RunDataService rds = (RunDataService) > TurbineServices.getInstance().getService(RunDataService.SERVICE_NAME); > EnhancedMockHttpServletRequest request = new > EnhancedMockHttpServletRequest(); > request.setupServerName("bob"); > request.setupGetProtocol("http"); > request.setupScheme("scheme"); > request.setupPathInfo("damn"); > request.setupGetServletPath("damn2"); > request.setupGetContextPath("wow"); > request.setupGetContentType("html/text"); > request.setupAddHeader("Content-type", "html/text"); > request.setupAddHeader("Accept-Language", "en-US"); > Vector v = new Vector(); > request.setupGetParameterNames(v.elements()); > MockHttpSession session = new MockHttpSession(); > session.setupGetAttribute(User.SESSION_KEY, null); > request.setSession(session); > HttpServletResponse response = new MockHttpServletResponse(); > ServletConfig config = new MockServletConfig(); > RunData runData = rds.getRunData(request, response, config); > return runData; > } > public void setUp() throws Exception > { > tc = new TurbineConfig(".", "/conf/test/TestLocalization.properties"); > tc.initialize(); > } > public void tearDown() throws Exception > { > if (tc != null) > { > tc.dispose(); > } > } > } > > > > 1.6 +3 -1 > jakarta-turbine-2/src/java/org/apache/turbine/services/InstantiationException.java > > Index: InstantiationException.java > =================================================================== > RCS file: > /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/InstantiationException.java,v > retrieving revision 1.5 > retrieving revision 1.6 > diff -u -r1.5 -r1.6 > --- InstantiationException.java 7 Apr 2003 15:30:48 -0000 1.5 > +++ InstantiationException.java 9 Sep 2003 15:04:51 -0000 1.6 > @@ -60,6 +60,8 @@ > * Thrown by <code>InitableBroker</code> and > * <code>ServiceBroker</code> classes to indicate problems with > * instatiation of requested objects. > + * > + * Make sure you don't confuse this exception with the > java.lang.InstantiationException. > * > * @author <a href="mailto:[EMAIL PROTECTED]">Kevin Burton</a> > * @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a> > > > > 1.1 > jakarta-turbine-2/src/test/org/apache/turbine/test/EnhancedMockHttpServletRequest.java > > Index: EnhancedMockHttpServletRequest.java > =================================================================== > package org.apache.turbine.test; > /* ==================================================================== > * The Apache Software License, Version 1.1 > * > * Copyright (c) 2001-2002 The Apache Software Foundation. All rights > * reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in > * the documentation and/or other materials provided with the > * distribution. > * > * 3. The end-user documentation included with the redistribution, > * if any, must include the following acknowledgment: > * "This product includes software developed by the > * Apache Software Foundation (http://www.apache.org/)." > * Alternately, this acknowledgment may appear in the software itself, > * if and wherever such third-party acknowledgments normally appear. > * > * 4. The names "Apache" and "Apache Software Foundation" and > * "Apache Turbine" must not be used to endorse or promote products > * derived from this software without prior written permission. For > * written permission, please contact [EMAIL PROTECTED] > * > * 5. Products derived from this software may not be called "Apache", > * "Apache Turbine", nor may "Apache" appear in their name, without > * prior written permission of the Apache Software Foundation. > * > * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED > * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR > * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT > * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * ==================================================================== > * > * This software consists of voluntary contributions made by many > * individuals on behalf of the Apache Software Foundation. For more > * information on the Apache Software Foundation, please see > * <http://www.apache.org/>. > */ > > import com.mockobjects.servlet.MockHttpServletRequest; > > /** > * Extension to the basic MockHttpServletRequest to provide some extra parameters > * required by Turbine. > * > * @author <a href="mailto:[EMAIL PROTECTED]">Eric Pugh</a> > * @version $Id: EnhancedMockHttpServletRequest.java,v 1.1 2003/09/09 15:04:51 > epugh Exp $ > */ > public class EnhancedMockHttpServletRequest extends MockHttpServletRequest > { > /** > * > */ > public EnhancedMockHttpServletRequest() > { > super(); > // TODO Auto-generated constructor stub > } > public int getServerPort(){ > return 8080; > } > > public String getCharacterEncoding(){ > return "US-ASCII"; > } > > } > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH [EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/ Java, perl, Solaris, Linux, xSP Consulting, Web Services freelance consultant -- Jakarta Turbine Development -- hero for hire "Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!" -- AOL CD when played backwards (User Friendly - 200-10-15) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]