public void testConstructor()
{
try
{
new InfoDescriptor(
m_name, null, m_version, m_lifestyle, m_schema, getProperties() );
fail("Did not throw the proper NullPointerException");
}
catch (NullPointerException npe)
{
// Success!
}
try
{
new InfoDescriptor(
m_name, "foo/fake/ClassName", m_version, m_lifestyle,
m_schema, getProperties());
fail("Did not throw the proper IllegalArgumentException");
}
catch (IllegalArgumentException iae)
{
// Success!
}
try
{
new InfoDescriptor(
m_name, m_classname, m_version, InfoDescriptor.POOLED,
m_schema, getProperties() );
new InfoDescriptor(
m_name, m_classname, m_version, InfoDescriptor.SINGLETON,
m_schema, getProperties() );
new InfoDescriptor(
m_name, m_classname, m_version, InfoDescriptor.THREAD,
m_schema, getProperties() );
new InfoDescriptor(
m_name, m_classname, m_version, InfoDescriptor.TRANSIENT,
m_schema, getProperties() );
// All these should pass.
new InfoDescriptor(
m_name, m_classname, m_version, "Fake Lifestyle",
m_schema, getProperties() );
fail( "Did not throw the proper IllegalArgumentException" );
}