From ed9fb8b039c41a7e8ac20aebe2095f7c09023fa6 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 3 Feb 2002 03:50:43 +0000 Subject: [PATCH] Update test to correct bug introduced git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271113 13f79535-47bb-0310-9956-ffa450edef68 --- .../components/deployer/DefaultDeployerTest.java | 12 ++++++++---- .../components/deployer/DefaultDeployerTest.java | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java index a64e81c40..010cbb021 100644 --- a/proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java @@ -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 ); diff --git a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java index a64e81c40..010cbb021 100644 --- a/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java +++ b/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java @@ -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 );