epugh 2004/03/28 09:20:54 Modified: src/test/org/apache/stratum/messenger MessengerComponentTest.java src/test/org/apache/stratum/component TestComponentLoader.java . project.xml src/java/org/apache/stratum/component ComponentLoader.java src/test/org/apache/stratum/scheduler/examplejobs JobOne.java JobTwo.java src/test/org/apache/stratum/scheduler TestScheduler.java Log: Beta 5 which supports the latest Commons Configuration
as well as cleanups of import statements. Revision Changes Path 1.2 +6 -8 jakarta-turbine-stratum/src/test/org/apache/stratum/messenger/MessengerComponentTest.java Index: MessengerComponentTest.java =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/src/test/org/apache/stratum/messenger/MessengerComponentTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessengerComponentTest.java 22 Jun 2002 04:27:33 -0000 1.1 +++ MessengerComponentTest.java 28 Mar 2004 17:20:54 -0000 1.2 @@ -54,18 +54,16 @@ * <http://www.apache.org/>. */ -import java.io.IOException; -import junit.framework.Test; import junit.framework.TestCase; -import junit.framework.TestSuite; + +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.log4j.Category; + import com.mockobjects.ExpectationCounter; import com.mockobjects.ExpectationValue; import com.mockobjects.Verifiable; import com.mockobjects.util.Verifier; -import org.apache.log4j.Category; -import org.apache.commons.configuration.Configuration; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.stratum.component.ComponentLoader; /** * Test cases to exercise the MessengerComponent. 1.10 +4 -6 jakarta-turbine-stratum/src/test/org/apache/stratum/component/TestComponentLoader.java Index: TestComponentLoader.java =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/src/test/org/apache/stratum/component/TestComponentLoader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- TestComponentLoader.java 21 Jan 2004 14:24:06 -0000 1.9 +++ TestComponentLoader.java 28 Mar 2004 17:20:54 -0000 1.10 @@ -54,14 +54,12 @@ * <http://www.apache.org/>. */ -import java.io.IOException; -import junit.framework.Test; import junit.framework.TestCase; -import junit.framework.TestSuite; -import org.apache.log4j.Category; + import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.stratum.component.ComponentLoader; +import org.apache.log4j.Category; public class TestComponentLoader extends TestCase { @@ -75,7 +73,7 @@ { config = new PropertiesConfiguration(CONFIG); } - catch (IOException ioe) + catch (ConfigurationException ce) { log.error("unable to configure ComponentLoader from '" + CONFIG + "'."); } 1.39 +6 -0 jakarta-turbine-stratum/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/project.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- project.xml 28 Mar 2004 17:09:41 -0000 1.38 +++ project.xml 28 Mar 2004 17:20:54 -0000 1.39 @@ -77,6 +77,12 @@ <organization>Tucana</organization> </developer> <developer> + <name>Eric Pugh</name> + <id>epugh</id> + <email>[EMAIL PROTECTED]</email> + <organization>OpenSource Connections</organization> + </developer> + <developer> <name>Eric Dobbs</name> <id>dobbs</id> <email>[EMAIL PROTECTED]</email> 1.11 +143 -157 jakarta-turbine-stratum/src/java/org/apache/stratum/component/ComponentLoader.java Index: ComponentLoader.java =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/component/ComponentLoader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ComponentLoader.java 21 Jan 2004 14:24:06 -0000 1.10 +++ ComponentLoader.java 28 Mar 2004 17:20:54 -0000 1.11 @@ -1,62 +1,52 @@ package org.apache.stratum.component; -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2001-2004 The Apache Software Foundation. All rights - * reserved. - * +/* + * ==================================================================== The + * Apache Software License, Version 1.1 + * + * Copyright (c) 2001-2004 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. + * 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/>. + * + * 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.io.IOException; import java.util.List; +import org.apache.commons.configuration.CompositeConfiguration; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.log4j.Category; @@ -65,47 +55,46 @@ /** * Loader for Components implementing the lifecyle Interfaces. - * - * NOTE: This class is in its infancy and will more than likely - * change. - * - * @author <a href="mailto:eric NOSPAM dobbse.net">Eric Dobbs</a> - * @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a> + * + * NOTE: This class is in its infancy and will more than likely change. + * + * @author <a href="mailto:eric NOSPAM dobbse.net">Eric Dobbs </a> + * @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl </a> * @version $Id$ */ -public class ComponentLoader -{ +public class ComponentLoader { + /** - * Log4j category used for logging. NOTE: we should change this to - * use the commons-logging API. + * Log4j category used for logging. NOTE: we should change this to use the + * commons-logging API. */ private static Category log = Category.getInstance(ComponentLoader.class); - + /** * Component tag used in Configurations */ private static String COMPONENT = "component"; - + /** * Class name tag used in Configurations */ private static String CLASSNAME = "classname"; - + /** - * Extension used for Configuration files. + * Extension used for Configuration files. */ - private static String CONFIG = "config"; - + private static String CONFIG = "config"; + /** - * Extension used for Additional properties. + * Extension used for Additional properties. */ - private static String PROPERTY = "property"; + private static String PROPERTY = "property"; /** * Name tag used in Configurations */ - private static String NAME = "name"; - + private static String NAME = "name"; + /** * Configuration used by this ComponentLoader. */ @@ -113,51 +102,48 @@ /** * Constructor - * + * * @param configuration */ - public ComponentLoader(Configuration configuration) - { + public ComponentLoader(Configuration configuration) { this.configuration = configuration; } /** * Set the configuration for this ComponentLoader - * - * @param configuration Configuration + * + * @param configuration + * Configuration */ - public void setConfiguration(Configuration configuration) - { + public void setConfiguration(Configuration configuration) { this.configuration = configuration; } /** * Support method for testing the constructor - * + * * @return the configuration */ - public Configuration getConfiguration() - { + public Configuration getConfiguration() { return configuration; } /** - * <p>Load all the components listed in the ComponentLoader's - * configuration. Log any errors, but throw no exceptions if - * components cannot be loaded.</p> - * - * Configuration notes:<br/> - * Components are identified in the properties file as - * follows:<br/> - * <code> + * <p> + * Load all the components listed in the ComponentLoader's configuration. + * Log any errors, but throw no exceptions if components cannot be loaded. + * </p> + * + * Configuration notes: <br/>Components are identified in the properties + * file as follows: <br/><code> * component.name=NAME * component.NAME.classname = com.mycompany.components.SomeComponent * component.NAME.config = path/to/SomeComponent.properties * </code> + * * @return an array of loaded components */ - public Object[] load() - { + public Object[] load() { List components = configuration.getList(COMPONENT + '.' + NAME); Object[] loadedComponents = new Object[components.size()]; @@ -166,73 +152,64 @@ String componentConfig; Configuration componentAdditionalConfig; - for (int i = 0; i < components.size(); i++) - { + for (int i = 0; i < components.size(); i++) { componentName = (String) components.get(i); componentClassName = getComponentClassname(componentName); componentConfig = getComponentConfigFile(componentName); - componentAdditionalConfig = - getComponentAdditionalConfig(componentName); + componentAdditionalConfig = getComponentAdditionalConfig(componentName); log.info("loading component: name=" + componentName + " class=" + componentClassName + " config=" + componentConfig); loadedComponents[i] = loadComponent(componentClassName, - componentConfig, - componentAdditionalConfig); + componentConfig, componentAdditionalConfig); } return loadedComponents; } /** - * load the given component, configure it with the given config - * file, and initialize it. <br> - * The component must implement the <code>Initializable</code> and - * <code>Configurable</code> interfaces. - * + * load the given component, configure it with the given config file, and + * initialize it. <br> + * The component must implement the <code>Initializable</code> and <code>Configurable</code> + * interfaces. + * * @see Initializable * @see Configurable - * @param className the String class name of the component to load - * @param configFile the String path name of the component's config file + * @param className + * the String class name of the component to load + * @param configFile + * the String path name of the component's config file * @return the loaded component or null if it failed to load */ - public Object loadComponent(String className, - String configFile, - Configuration additionalConfig) - { + public Object loadComponent(String className, String configFile, + Configuration additionalConfig) { Object component = null; - if (log.isDebugEnabled()) - { + if (log.isDebugEnabled()) { log.debug("attempting to load '" + className - + "' with the config file '" + configFile + "'."); + + "' with the config file '" + configFile + "'."); } - try - { + try { component = Class.forName(className).newInstance(); // configure component using the given config file - ((Configurable) component) - .configure(new PropertiesConfiguration(configFile, - additionalConfig)); + CompositeConfiguration config = new CompositeConfiguration(); + config.addConfiguration(new PropertiesConfiguration(configFile)); + config.addConfiguration(additionalConfig); + ((Configurable) component).configure(config); // initialize component ((Initializable) component).initialize(); - if (log.isDebugEnabled()) - { + if (log.isDebugEnabled()) { log.debug("good news! " + className - + " successfully configured and initialized"); + + " successfully configured and initialized"); } - } - catch (IOException ioe) - { + } catch (IOException ioe) { log.error(className + " could not be configured with file '" - + configFile + "'.", ioe); - } - catch (Exception e) - { + + configFile + "'.", ioe); + } catch (Exception e) { log.error(className + " could not be initialized!", e); } @@ -240,51 +217,60 @@ } /** - * <p>Get the component's classname as defined in the ComponentLoader - * configuration.</p> - * - * <p>Example property:<br/> - * component.NAME.classname=com.mycompany.components.MyComponent</p> - * - * @param name the String NAME of the component in the classfile + * <p> + * Get the component's classname as defined in the ComponentLoader + * configuration. + * </p> + * + * <p> + * Example property: <br/> + * component.NAME.classname=com.mycompany.components.MyComponent + * </p> + * + * @param name + * the String NAME of the component in the classfile * @return the configured classname */ - private String getComponentClassname(String name) - { - return configuration.getString(COMPONENT + '.' + name - + '.' + CLASSNAME); + private String getComponentClassname(String name) { + return configuration + .getString(COMPONENT + '.' + name + '.' + CLASSNAME); } /** - * <p>Get the component's config file as defined in the ComponentLoader - * configuration.</p> - * - * <p>Example property:<br/> - * component.NAME.config=path/to/your/config</p> - * - * @param name the String NAME of the component in the classfile + * <p> + * Get the component's config file as defined in the ComponentLoader + * configuration. + * </p> + * + * <p> + * Example property: <br/>component.NAME.config=path/to/your/config + * </p> + * + * @param name + * the String NAME of the component in the classfile * @return the configured config file */ - private String getComponentConfigFile(String name) - { + private String getComponentConfigFile(String name) { return configuration.getString(COMPONENT + '.' + name + '.' + CONFIG); } /** - * <p>Get any additional configuration properties from the master - * configuration.</p> - * - * <p>Example property:<br/> - * component.NAME.property.key1==value1<br/> - * component.NAME.property.key2==value2<br/> - * component.NAME.property.key3==value3<br/> + * <p> + * Get any additional configuration properties from the master + * configuration. + * </p> + * + * <p> + * Example property: <br/>component.NAME.property.key1==value1 <br/> + * component.NAME.property.key2==value2 <br/> + * component.NAME.property.key3==value3 <br/> * </p> - * - * @param name the String NAME of the component in the classfile + * + * @param name + * the String NAME of the component in the classfile * @return the extra properties as a Configuration object */ - private Configuration getComponentAdditionalConfig(String name) - { + private Configuration getComponentAdditionalConfig(String name) { return configuration.subset(COMPONENT + '.' + name + '.' + PROPERTY); } } 1.2 +102 -101 jakarta-turbine-stratum/src/test/org/apache/stratum/scheduler/examplejobs/JobOne.java Index: JobOne.java =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/src/test/org/apache/stratum/scheduler/examplejobs/JobOne.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JobOne.java 11 Jun 2002 14:07:04 -0000 1.1 +++ JobOne.java 28 Mar 2004 17:20:54 -0000 1.2 @@ -1,102 +1,103 @@ -package org.apache.stratum.scheduler.examplejobs; - -/* ==================================================================== - * 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 org.quartz.*; -import org.quartz.simpl.*; - -import java.util.Date; - - -/** - * <p>A dumb implementation of Job, for unittesting purposes.</p> - * - * @author James House - */ -public class JobOne implements Job { - - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Constructors. - * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - public JobOne() - { - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Interface. - * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /** - * <p>Called by the <code>[EMAIL PROTECTED] org.quartz.Scheduler}</code> when a - * <code>[EMAIL PROTECTED] org.quartz.Trigger}</code> fires that is associated with the - * <code>Job</code>.</p> - * - * @throws JobExecutionException if there is an exception while executing - * the job. - */ - public void execute(JobExecutionContext context) - throws JobExecutionException - { - System.out.println(" --- Testing Scheduler Component\n --- " - + context.getJobDetail().getFullName() + " executed.[" + new Date() + "]"); - } - +package org.apache.stratum.scheduler.examplejobs; + +/* ==================================================================== + * 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 java.util.Date; + +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + + +/** + * <p>A dumb implementation of Job, for unittesting purposes.</p> + * + * @author James House + */ +public class JobOne implements Job { + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Constructors. + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + public JobOne() + { + } + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Interface. + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * <p>Called by the <code>[EMAIL PROTECTED] org.quartz.Scheduler}</code> when a + * <code>[EMAIL PROTECTED] org.quartz.Trigger}</code> fires that is associated with the + * <code>Job</code>.</p> + * + * @throws JobExecutionException if there is an exception while executing + * the job. + */ + public void execute(JobExecutionContext context) + throws JobExecutionException + { + System.out.println(" --- Testing Scheduler Component\n --- " + + context.getJobDetail().getFullName() + " executed.[" + new Date() + "]"); + } + } 1.2 +102 -101 jakarta-turbine-stratum/src/test/org/apache/stratum/scheduler/examplejobs/JobTwo.java Index: JobTwo.java =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/src/test/org/apache/stratum/scheduler/examplejobs/JobTwo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JobTwo.java 11 Jun 2002 14:07:04 -0000 1.1 +++ JobTwo.java 28 Mar 2004 17:20:54 -0000 1.2 @@ -1,102 +1,103 @@ -package org.apache.stratum.scheduler.examplejobs; - -/* ==================================================================== - * 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 org.quartz.*; -import org.quartz.simpl.*; - -import java.util.Date; - - -/** - * <p>A dumb implementation of Job, for unittesting purposes.</p> - * - * @author James House - */ -public class JobTwo implements Job { - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Constructors. - * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - public JobTwo() - { - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Interface. - * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /** - * <p>Called by the <code>[EMAIL PROTECTED] org.quartz.Scheduler}</code> when a - * <code>[EMAIL PROTECTED] org.quartz.Trigger}</code> fires that is associated with the - * <code>Job</code>.</p> - * - * @throws JobExecutionException if there is an exception while executing - * the job. - */ - public void execute(JobExecutionContext context) - throws JobExecutionException - { - System.err.println(" --- Testing Scheduler Component\n --- " - + context.getJobDetail().getFullName() + " executed.[" + new Date() + "]"); - } - +package org.apache.stratum.scheduler.examplejobs; + +/* ==================================================================== + * 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 java.util.Date; + +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + + +/** + * <p>A dumb implementation of Job, for unittesting purposes.</p> + * + * @author James House + */ +public class JobTwo implements Job { + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Constructors. + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + public JobTwo() + { + } + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Interface. + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * <p>Called by the <code>[EMAIL PROTECTED] org.quartz.Scheduler}</code> when a + * <code>[EMAIL PROTECTED] org.quartz.Trigger}</code> fires that is associated with the + * <code>Job</code>.</p> + * + * @throws JobExecutionException if there is an exception while executing + * the job. + */ + public void execute(JobExecutionContext context) + throws JobExecutionException + { + System.err.println(" --- Testing Scheduler Component\n --- " + + context.getJobDetail().getFullName() + " executed.[" + new Date() + "]"); + } + } 1.3 +2 -9 jakarta-turbine-stratum/src/test/org/apache/stratum/scheduler/TestScheduler.java Index: TestScheduler.java =================================================================== RCS file: /home/cvs/jakarta-turbine-stratum/src/test/org/apache/stratum/scheduler/TestScheduler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestScheduler.java 21 Jun 2002 22:02:33 -0000 1.2 +++ TestScheduler.java 28 Mar 2004 17:20:54 -0000 1.3 @@ -11,24 +11,17 @@ import java.io.File; import java.io.FileInputStream; -import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; -import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.XMLIntrospector; +import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.betwixt.strategy.DefaultPluralStemmer; -import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.configuration.ConfigurationConverter; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.logging.impl.SimpleLog; /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]