From aaf5713fe7d7826fed7d88566f3df0e2c7c4bda3 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 7 Apr 2002 02:11:29 +0000 Subject: [PATCH] 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 --- .../test/DefaultConfigurerTestCase.java | 62 ++++++++++++++----- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java index eced05dfc..bb808392b 100644 --- a/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java +++ b/proposal/myrmidon/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java @@ -317,12 +317,22 @@ public class DefaultConfigurerTestCase m_context.setProperty( "prop-a", "some value" ); // 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 - 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(); // 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 - 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" ); // 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 - 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. */ - public void testUnknownReference() + public void __testUnknownReference() throws Exception { + //Should rework + fail( "-ref pattern on attributes no longer supported" ); + // Setup test data final DefaultConfiguration config = new DefaultConfiguration( "test", "test" ); config.setAttribute( "some-prop-ref", "unknown-prop" ); @@ -698,9 +729,12 @@ public class DefaultConfigurerTestCase /** * Tests handling of mismatched reference type. */ - public void testMismatchedRefType() + public void __testMismatchedRefType() throws Exception { + //FIXME: rework testcase + fail( "-ref pattern on attributes no longer supported" ); + // Setup test data final DefaultConfiguration config = new DefaultConfiguration( "test", "test" ); config.setAttribute( "some-prop-ref", "prop-a" );