Browse Source

Update test to correct bug introduced

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271113 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
ed9fb8b039
2 changed files with 16 additions and 8 deletions
  1. +8
    -4
      proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java
  2. +8
    -4
      proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java

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

@@ -47,13 +47,16 @@ public class DefaultDeployerTest
*/
public void testSingleType() throws Exception
{
final String roleName = "data-type";
final String typeName = "test-type1";
final String classname = TestType1.class.getName();

// Determine the shorthand for the DataType role
final RoleManager roleManager = (RoleManager)getComponentManager().lookup( RoleManager.ROLE );
roleManager.addNameRoleMapping( "data-type", DataType.ROLE );
roleManager.addNameRoleMapping( roleName, DataType.ROLE );

// Create the type definition
final String destType = TestType1.class.getName();
final TypeDefinition typeDef = new TypeDefinition( "data-type", "test-type1", destType );
final TypeDefinition typeDef = new TypeDefinition( typeName, roleName, classname );

// Deploy the type
final ClassLoader classLoader = getClass().getClassLoader();
@@ -62,7 +65,7 @@ public class DefaultDeployerTest

// Create an instance
final TypeFactory typeFactory = getTypeManager().getFactory( DataType.class );
final Object result = typeFactory.create( "test-type1" );
final Object result = typeFactory.create( typeName );

// Check the type
assertTrue( result instanceof TestType1 );
@@ -77,6 +80,7 @@ public class DefaultDeployerTest
final String classname = TestConverter1.class.getName();
final String source = "java.lang.String";
final String destClass = TestType1.class.getName();

final ConverterDefinition typeDef =
new ConverterDefinition( classname, source, destClass );



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

@@ -47,13 +47,16 @@ public class DefaultDeployerTest
*/
public void testSingleType() throws Exception
{
final String roleName = "data-type";
final String typeName = "test-type1";
final String classname = TestType1.class.getName();

// Determine the shorthand for the DataType role
final RoleManager roleManager = (RoleManager)getComponentManager().lookup( RoleManager.ROLE );
roleManager.addNameRoleMapping( "data-type", DataType.ROLE );
roleManager.addNameRoleMapping( roleName, DataType.ROLE );

// Create the type definition
final String destType = TestType1.class.getName();
final TypeDefinition typeDef = new TypeDefinition( "data-type", "test-type1", destType );
final TypeDefinition typeDef = new TypeDefinition( typeName, roleName, classname );

// Deploy the type
final ClassLoader classLoader = getClass().getClassLoader();
@@ -62,7 +65,7 @@ public class DefaultDeployerTest

// Create an instance
final TypeFactory typeFactory = getTypeManager().getFactory( DataType.class );
final Object result = typeFactory.create( "test-type1" );
final Object result = typeFactory.create( typeName );

// Check the type
assertTrue( result instanceof TestType1 );
@@ -77,6 +80,7 @@ public class DefaultDeployerTest
final String classname = TestConverter1.class.getName();
final String source = "java.lang.String";
final String destClass = TestType1.class.getName();

final ConverterDefinition typeDef =
new ConverterDefinition( classname, source, destClass );



Loading…
Cancel
Save