Browse Source

Bring testcases back into line with removal of -ref pattern from attributes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272258 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
aaf5713fe7
1 changed files with 48 additions and 14 deletions
  1. +48
    -14
      proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java

+ 48
- 14
proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java View File

@@ -317,12 +317,22 @@ public class DefaultConfigurerTestCase
m_context.setProperty( "prop-a", "some value" ); m_context.setProperty( "prop-a", "some value" );


// Configure the object // Configure the object
configure( test, config );
try
{
configure( test, config );
}
catch( ConfigurationException e )
{
//Expected to fail as -ref no longer supported
//pattern for attributes
return;
}


fail( "-ref pattern on attributes no longer supported" );
// Check the configured object // Check the configured object
final ConfigTestReferenceAttribute expected = new ConfigTestReferenceAttribute();
expected.setSomeProp( "some value" );
assertEquals( expected, test );
//final ConfigTestReferenceAttribute expected = new ConfigTestReferenceAttribute();
//expected.setSomeProp( "some value" );
//assertEquals( expected, test );
} }


/** /**
@@ -398,12 +408,22 @@ public class DefaultConfigurerTestCase
final ConfigTestReferenceConversion test = new ConfigTestReferenceConversion(); final ConfigTestReferenceConversion test = new ConfigTestReferenceConversion();


// Configure // Configure
configure( test, config );
try
{
configure( test, config );
}
catch( ConfigurationException e )
{
//Good should no longer work
return;
}

fail( "-ref pattern on attributes no longer supported" );


// Check result // Check result
final ConfigTestReferenceConversion expected = new ConfigTestReferenceConversion();
expected.setPropA( new MyRole1Adaptor( refValue ) );
assertEquals( expected, test );
//final ConfigTestReferenceConversion expected = new ConfigTestReferenceConversion();
//expected.setPropA( new MyRole1Adaptor( refValue ) );
//assertEquals( expected, test );
} }


/** /**
@@ -658,20 +678,31 @@ public class DefaultConfigurerTestCase
m_context.setProperty( "prop-a", "some indirect value" ); m_context.setProperty( "prop-a", "some indirect value" );


// Configure the object // Configure the object
configure( test, config );
try
{
configure( test, config );
}
catch( ConfigurationException e )
{
return;
}


fail( "-ref pattern on attributes no longer supported" );
// Check the configured object // Check the configured object
final ConfigTestIdResolve expected = new ConfigTestIdResolve();
expected.setSomeProp( "some indirect value" );
assertEquals( expected, test );
//final ConfigTestIdResolve expected = new ConfigTestIdResolve();
//expected.setSomeProp( "some indirect value" );
//assertEquals( expected, test );
} }


/** /**
* Tests an unknown reference. * Tests an unknown reference.
*/ */
public void testUnknownReference()
public void __testUnknownReference()
throws Exception throws Exception
{ {
//Should rework
fail( "-ref pattern on attributes no longer supported" );

// Setup test data // Setup test data
final DefaultConfiguration config = new DefaultConfiguration( "test", "test" ); final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
config.setAttribute( "some-prop-ref", "unknown-prop" ); config.setAttribute( "some-prop-ref", "unknown-prop" );
@@ -698,9 +729,12 @@ public class DefaultConfigurerTestCase
/** /**
* Tests handling of mismatched reference type. * Tests handling of mismatched reference type.
*/ */
public void testMismatchedRefType()
public void __testMismatchedRefType()
throws Exception throws Exception
{ {
//FIXME: rework testcase
fail( "-ref pattern on attributes no longer supported" );

// Setup test data // Setup test data
final DefaultConfiguration config = new DefaultConfiguration( "test", "test" ); final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
config.setAttribute( "some-prop-ref", "prop-a" ); config.setAttribute( "some-prop-ref", "prop-a" );


Loading…
Cancel
Save