git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271099 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -44,16 +44,17 @@ import org.apache.myrmidon.interfaces.type.TypeManager; | |||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class ComponentTestBase extends TestCase | |||||
| public abstract class AbstractComponentTest | |||||
| extends TestCase | |||||
| { | { | ||||
| private DefaultComponentManager m_componentManager; | private DefaultComponentManager m_componentManager; | ||||
| private Logger m_logger; | private Logger m_logger; | ||||
| private final static String PATTERN = "[%8.8{category}] %{message}\\n%{throwable}"; | private final static String PATTERN = "[%8.8{category}] %{message}\\n%{throwable}"; | ||||
| public ComponentTestBase( String s ) | |||||
| public AbstractComponentTest( final String name ) | |||||
| { | { | ||||
| super( s ); | |||||
| super( name ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -75,7 +76,8 @@ public class ComponentTestBase extends TestCase | |||||
| /** | /** | ||||
| * Setup the test case - prepares the set of components. | * Setup the test case - prepares the set of components. | ||||
| */ | */ | ||||
| protected void setUp() throws Exception | |||||
| protected void setUp() | |||||
| throws Exception | |||||
| { | { | ||||
| // Setup a logger | // Setup a logger | ||||
| final Priority priority = Priority.DEBUG; | final Priority priority = Priority.DEBUG; | ||||
| @@ -149,9 +151,9 @@ public class ComponentTestBase extends TestCase | |||||
| * TODO - should take the expected exception, rather than the message, | * TODO - should take the expected exception, rather than the message, | ||||
| * to check the entire cause chain. | * to check the entire cause chain. | ||||
| */ | */ | ||||
| protected void assertSameMessage( final String msg, final Throwable exc ) | |||||
| protected void assertSameMessage( final String message, final Throwable throwable ) | |||||
| { | { | ||||
| assertEquals( msg, exc.getMessage() ); | |||||
| assertEquals( message, throwable.getMessage() ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -14,7 +14,7 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.avalon.framework.configuration.DefaultConfiguration; | import org.apache.avalon.framework.configuration.DefaultConfiguration; | ||||
| import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
| import org.apache.myrmidon.components.ComponentTestBase; | |||||
| import org.apache.myrmidon.components.AbstractComponentTest; | |||||
| import org.apache.myrmidon.components.workspace.DefaultTaskContext; | import org.apache.myrmidon.components.workspace.DefaultTaskContext; | ||||
| import org.apache.myrmidon.interfaces.configurer.Configurer; | import org.apache.myrmidon.interfaces.configurer.Configurer; | ||||
| import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | ||||
| @@ -25,7 +25,7 @@ import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | |||||
| * @author Adam Murdoch | * @author Adam Murdoch | ||||
| */ | */ | ||||
| public class DefaultConfigurerTest | public class DefaultConfigurerTest | ||||
| extends ComponentTestBase | |||||
| extends AbstractComponentTest | |||||
| { | { | ||||
| private final static Resources REZ = | private final static Resources REZ = | ||||
| ResourceManager.getPackageResources( DefaultConfigurerTest.class ); | ResourceManager.getPackageResources( DefaultConfigurerTest.class ); | ||||
| @@ -7,7 +7,7 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | package org.apache.myrmidon.components.deployer; | ||||
| import org.apache.myrmidon.components.ComponentTestBase; | |||||
| import org.apache.myrmidon.components.AbstractComponentTest; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.interfaces.converter.MasterConverter; | import org.apache.myrmidon.interfaces.converter.MasterConverter; | ||||
| import org.apache.myrmidon.interfaces.deployer.ConverterDefinition; | import org.apache.myrmidon.interfaces.deployer.ConverterDefinition; | ||||
| @@ -23,7 +23,7 @@ import org.apache.myrmidon.interfaces.type.TypeFactory; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class DefaultDeployerTest | public class DefaultDeployerTest | ||||
| extends ComponentTestBase | |||||
| extends AbstractComponentTest | |||||
| { | { | ||||
| private Deployer m_deployer; | private Deployer m_deployer; | ||||
| @@ -44,16 +44,17 @@ import org.apache.myrmidon.interfaces.type.TypeManager; | |||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class ComponentTestBase extends TestCase | |||||
| public abstract class AbstractComponentTest | |||||
| extends TestCase | |||||
| { | { | ||||
| private DefaultComponentManager m_componentManager; | private DefaultComponentManager m_componentManager; | ||||
| private Logger m_logger; | private Logger m_logger; | ||||
| private final static String PATTERN = "[%8.8{category}] %{message}\\n%{throwable}"; | private final static String PATTERN = "[%8.8{category}] %{message}\\n%{throwable}"; | ||||
| public ComponentTestBase( String s ) | |||||
| public AbstractComponentTest( final String name ) | |||||
| { | { | ||||
| super( s ); | |||||
| super( name ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -75,7 +76,8 @@ public class ComponentTestBase extends TestCase | |||||
| /** | /** | ||||
| * Setup the test case - prepares the set of components. | * Setup the test case - prepares the set of components. | ||||
| */ | */ | ||||
| protected void setUp() throws Exception | |||||
| protected void setUp() | |||||
| throws Exception | |||||
| { | { | ||||
| // Setup a logger | // Setup a logger | ||||
| final Priority priority = Priority.DEBUG; | final Priority priority = Priority.DEBUG; | ||||
| @@ -149,9 +151,9 @@ public class ComponentTestBase extends TestCase | |||||
| * TODO - should take the expected exception, rather than the message, | * TODO - should take the expected exception, rather than the message, | ||||
| * to check the entire cause chain. | * to check the entire cause chain. | ||||
| */ | */ | ||||
| protected void assertSameMessage( final String msg, final Throwable exc ) | |||||
| protected void assertSameMessage( final String message, final Throwable throwable ) | |||||
| { | { | ||||
| assertEquals( msg, exc.getMessage() ); | |||||
| assertEquals( message, throwable.getMessage() ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -14,7 +14,7 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.avalon.framework.configuration.DefaultConfiguration; | import org.apache.avalon.framework.configuration.DefaultConfiguration; | ||||
| import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
| import org.apache.myrmidon.components.ComponentTestBase; | |||||
| import org.apache.myrmidon.components.AbstractComponentTest; | |||||
| import org.apache.myrmidon.components.workspace.DefaultTaskContext; | import org.apache.myrmidon.components.workspace.DefaultTaskContext; | ||||
| import org.apache.myrmidon.interfaces.configurer.Configurer; | import org.apache.myrmidon.interfaces.configurer.Configurer; | ||||
| import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | ||||
| @@ -25,7 +25,7 @@ import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | |||||
| * @author Adam Murdoch | * @author Adam Murdoch | ||||
| */ | */ | ||||
| public class DefaultConfigurerTest | public class DefaultConfigurerTest | ||||
| extends ComponentTestBase | |||||
| extends AbstractComponentTest | |||||
| { | { | ||||
| private final static Resources REZ = | private final static Resources REZ = | ||||
| ResourceManager.getPackageResources( DefaultConfigurerTest.class ); | ResourceManager.getPackageResources( DefaultConfigurerTest.class ); | ||||
| @@ -7,7 +7,7 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | package org.apache.myrmidon.components.deployer; | ||||
| import org.apache.myrmidon.components.ComponentTestBase; | |||||
| import org.apache.myrmidon.components.AbstractComponentTest; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.interfaces.converter.MasterConverter; | import org.apache.myrmidon.interfaces.converter.MasterConverter; | ||||
| import org.apache.myrmidon.interfaces.deployer.ConverterDefinition; | import org.apache.myrmidon.interfaces.deployer.ConverterDefinition; | ||||
| @@ -23,7 +23,7 @@ import org.apache.myrmidon.interfaces.type.TypeFactory; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class DefaultDeployerTest | public class DefaultDeployerTest | ||||
| extends ComponentTestBase | |||||
| extends AbstractComponentTest | |||||
| { | { | ||||
| private Deployer m_deployer; | private Deployer m_deployer; | ||||