Author: seade
Date: Wed May 6 22:38:39 2009
New Revision: 772453
URL: http://svn.apache.org/viewvc?rev=772453&view=rev
Log:
One of the test cases was ambiguous - it was named one thing but seemed to be
testing something else in a manner that suggests a possible problem. The
change corrects the named test and adds a new one for testing configuration
files with integrated roles. The new test currently fails, so either I do not
fully understand how it is supposed to work or something is broken.
Modified:
turbine/fulcrum/trunk/testcontainer/src/test/org/apache/fulcrum/testcontainer/YaafiContainerTest.java
Modified:
turbine/fulcrum/trunk/testcontainer/src/test/org/apache/fulcrum/testcontainer/YaafiContainerTest.java
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/testcontainer/src/test/org/apache/fulcrum/testcontainer/YaafiContainerTest.java?rev=772453&r1=772452&r2=772453&view=diff
==============================================================================
---
turbine/fulcrum/trunk/testcontainer/src/test/org/apache/fulcrum/testcontainer/YaafiContainerTest.java
(original)
+++
turbine/fulcrum/trunk/testcontainer/src/test/org/apache/fulcrum/testcontainer/YaafiContainerTest.java
Wed May 6 22:38:39 2009
@@ -84,6 +84,26 @@
public void testLoadingContainerWithNoRolesfileFails()
{
SimpleComponent sc = null;
+ this.setRoleFileName(null);
+ try
+ {
+ sc = (SimpleComponent)
this.lookup(SimpleComponent.class.getName());
+ fail("We should fail");
+ }
+ catch (ComponentException e)
+ {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ catch (Exception e)
+ {
+ // We expect to fail with a ConfigurationException
+ }
+ }
+
+ public void testLoadingContainerWithIntegratedRolesfile()
+ {
+ SimpleComponent sc = null;
this.setRoleFileName(null);
this.setConfigurationFileName(
@@ -91,13 +111,16 @@
try
{
sc = (SimpleComponent) this.lookup(SimpleComponent.ROLE);
- fail("We should fail");
}
catch (Exception e)
{
- //good We expect to fail
+ e.printStackTrace();
+ fail(e.getMessage());
}
-
+ assertTrue(sc instanceof AlternativeComponentImpl);
+ assertNotNull(sc);
+ sc.test();
+ this.release(sc);
}
}