Browse Source

Rename ComponentTestBase to AbstractComponentTest and make AbstractComponentTest abstract.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271099 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
b429428ae6
6 changed files with 24 additions and 20 deletions
  1. +8
    -6
      proposal/myrmidon/src/test/org/apache/myrmidon/components/AbstractComponentTest.java
  2. +2
    -2
      proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/DefaultConfigurerTest.java
  3. +2
    -2
      proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java
  4. +8
    -6
      proposal/myrmidon/src/testcases/org/apache/myrmidon/components/AbstractComponentTest.java
  5. +2
    -2
      proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/DefaultConfigurerTest.java
  6. +2
    -2
      proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java

proposal/myrmidon/src/test/org/apache/myrmidon/components/ComponentTestBase.java → proposal/myrmidon/src/test/org/apache/myrmidon/components/AbstractComponentTest.java View File

@@ -44,16 +44,17 @@ import org.apache.myrmidon.interfaces.type.TypeManager;
*
* @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 Logger m_logger;

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.
*/
protected void setUp() throws Exception
protected void setUp()
throws Exception
{
// Setup a logger
final Priority priority = Priority.DEBUG;
@@ -149,9 +151,9 @@ public class ComponentTestBase extends TestCase
* TODO - should take the expected exception, rather than the message,
* 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() );
}

/**

+ 2
- 2
proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/DefaultConfigurerTest.java View File

@@ -14,7 +14,7 @@ import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfiguration;
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.interfaces.configurer.Configurer;
import org.apache.myrmidon.interfaces.type.DefaultTypeFactory;
@@ -25,7 +25,7 @@ import org.apache.myrmidon.interfaces.type.DefaultTypeFactory;
* @author Adam Murdoch
*/
public class DefaultConfigurerTest
extends ComponentTestBase
extends AbstractComponentTest
{
private final static Resources REZ =
ResourceManager.getPackageResources( DefaultConfigurerTest.class );


+ 2
- 2
proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java View File

@@ -7,7 +7,7 @@
*/
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.interfaces.converter.MasterConverter;
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>
*/
public class DefaultDeployerTest
extends ComponentTestBase
extends AbstractComponentTest
{
private Deployer m_deployer;



proposal/myrmidon/src/testcases/org/apache/myrmidon/components/ComponentTestBase.java → proposal/myrmidon/src/testcases/org/apache/myrmidon/components/AbstractComponentTest.java View File

@@ -44,16 +44,17 @@ import org.apache.myrmidon.interfaces.type.TypeManager;
*
* @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 Logger m_logger;

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.
*/
protected void setUp() throws Exception
protected void setUp()
throws Exception
{
// Setup a logger
final Priority priority = Priority.DEBUG;
@@ -149,9 +151,9 @@ public class ComponentTestBase extends TestCase
* TODO - should take the expected exception, rather than the message,
* 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() );
}

/**

+ 2
- 2
proposal/myrmidon/src/testcases/org/apache/myrmidon/components/configurer/DefaultConfigurerTest.java View File

@@ -14,7 +14,7 @@ import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfiguration;
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.interfaces.configurer.Configurer;
import org.apache.myrmidon.interfaces.type.DefaultTypeFactory;
@@ -25,7 +25,7 @@ import org.apache.myrmidon.interfaces.type.DefaultTypeFactory;
* @author Adam Murdoch
*/
public class DefaultConfigurerTest
extends ComponentTestBase
extends AbstractComponentTest
{
private final static Resources REZ =
ResourceManager.getPackageResources( DefaultConfigurerTest.class );


+ 2
- 2
proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java View File

@@ -7,7 +7,7 @@
*/
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.interfaces.converter.MasterConverter;
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>
*/
public class DefaultDeployerTest
extends ComponentTestBase
extends AbstractComponentTest
{
private Deployer m_deployer;



Loading…
Cancel
Save