ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer DefaultDeployerTest.java
Date Sun, 03 Feb 2002 03:46:13 GMT
donaldp     02/02/02 19:46:13

  Modified:    proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer
                        DefaultDeployerTest.java
  Log:
  Convert to use immutable type
  
  Revision  Changes    Path
  1.3       +14 -15    jakarta-ant/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java
  
  Index: DefaultDeployerTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/testcases/org/apache/myrmidon/components/deployer/DefaultDeployerTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultDeployerTest.java	3 Feb 2002 02:35:37 -0000	1.2
  +++ DefaultDeployerTest.java	3 Feb 2002 03:46:13 -0000	1.3
  @@ -12,7 +12,7 @@
   import org.apache.myrmidon.interfaces.converter.MasterConverter;
   import org.apache.myrmidon.interfaces.deployer.ConverterDefinition;
   import org.apache.myrmidon.interfaces.deployer.Deployer;
  -import org.apache.myrmidon.interfaces.deployer.GeneralTypeDefinition;
  +import org.apache.myrmidon.interfaces.deployer.TypeDefinition;
   import org.apache.myrmidon.interfaces.deployer.TypeDeployer;
   import org.apache.myrmidon.interfaces.role.RoleManager;
   import org.apache.myrmidon.interfaces.type.TypeFactory;
  @@ -27,9 +27,9 @@
   {
       private Deployer m_deployer;
   
  -    public DefaultDeployerTest( String s )
  +    public DefaultDeployerTest( final String name )
       {
  -        super( s );
  +        super( name );
       }
   
       /**
  @@ -52,10 +52,8 @@
           roleManager.addNameRoleMapping( "data-type", DataType.ROLE );
   
           // Create the type definition
  -        final GeneralTypeDefinition typeDef = new GeneralTypeDefinition();
  -        typeDef.setType( "data-type" );
  -        typeDef.setName( "test-type1" );
  -        typeDef.setClassname( TestType1.class.getName() );
  +        final String destType = TestType1.class.getName();
  +        final TypeDefinition typeDef =  new TypeDefinition( "data-type", "test-type1",
destType );
   
           // Deploy the type
           final ClassLoader classLoader = getClass().getClassLoader();
  @@ -64,10 +62,10 @@
   
           // Create an instance
           final TypeFactory typeFactory = getTypeManager().getFactory( DataType.class );
  -        Object obj = typeFactory.create( "test-type1" );
  +        final Object result = typeFactory.create( "test-type1" );
   
           // Check the type
  -        assertTrue( obj instanceof TestType1 );
  +        assertTrue( result instanceof TestType1 );
       }
   
       /**
  @@ -76,10 +74,11 @@
       public void testSingleConverter() throws Exception
       {
           // Create the type definition
  -        final ConverterDefinition typeDef = new ConverterDefinition();
  -        typeDef.setClassname( TestConverter1.class.getName() );
  -        typeDef.setSourceType( "java.lang.String" );
  -        typeDef.setDestinationType( TestType1.class.getName() );
  +        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 );
   
           // Deploy the type
           final ClassLoader classLoader = getClass().getClassLoader();
  @@ -88,9 +87,9 @@
   
           // Try to convert from string to test type
           final MasterConverter converter = (MasterConverter)getComponentManager().lookup(
MasterConverter.ROLE );
  -        Object obj = converter.convert( TestType1.class, "some-string", null );
  +        final Object result = converter.convert( TestType1.class, "some-string", null );
   
           // Check the type
  -        assertTrue( obj instanceof TestType1 );
  +        assertTrue( result instanceof TestType1 );
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message