org.apache.commons.configuration.beanutils
Class TestBeanHelper

java.lang.Object
  extended by org.apache.commons.configuration.beanutils.TestBeanHelper

public class TestBeanHelper
extends Object

Test class for BeanHelper.

Since:
1.3
Version:
$Id: TestBeanHelper.java 1225344 2011-12-28 21:28:23Z oheger $
Author:
Commons Configuration team

Nested Class Summary
static class TestBeanHelper.TestBean
          A simple bean class used for testing creation operations.
 
Constructor Summary
TestBeanHelper()
           
 
Method Summary
 void setUp()
           
 void tearDown()
           
 void testCreateBean()
          Tests creating a bean.
 void testCreateBeanWithDefaultClass()
          Tests creating a bean.
 void testCreateBeanWithDefaultFactory()
          Tests creating a bean using the default bean factory.
 void testCreateBeanWithException()
          Tests creating a bean when the factory throws an exception.
 void testCreateBeanWithFactoryDefaultClass()
          Tests creating a bean when the bean's class is specified as the default class of the bean factory.
 void testCreateBeanWithInvalidClass()
          Tries to create a bean with a non existing class.
 void testCreateBeanWithNoClass()
          Tries to create a bean when no class is provided.
 void testCreateBeanWithNullDeclaration()
          Tests creating a bean when no bean declaration is provided.
 void testCreateBeanWithParameter()
          Tests if a parameter is correctly passed to the bean factory.
 void testCreateBeanWithUnknownFactory()
          Tests creating a bean using a non registered factory.
 void testDeregisterBeanFactory()
          Tests to deregister a bean factory.
 void testGetDefaultBeanFactory()
          Tests whether the default bean factory is correctly initialized.
 void testInitBean()
          Tests initializing a bean.
 void testInitBeanWithInvalidProperty()
          Tries to initialize a bean with a bean declaration that contains an invalid property value.
 void testInitBeanWithNoData()
          Tests initializing a bean when the bean declaration does not contain any data.
 void testRegisterBeanFactory()
          Tests registering a new bean factory.
 void testRegisterBeanFactoryNull()
          Tries to register a null factory.
 void testRegisterBeanFactoryNullName()
          Tries to register a bean factory with a null name.
 void testSetDefaultBeanFactoryNull()
          Tests setting the default bean factory to null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestBeanHelper

public TestBeanHelper()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

testRegisterBeanFactory

public void testRegisterBeanFactory()
Tests registering a new bean factory.


testRegisterBeanFactoryNull

public void testRegisterBeanFactoryNull()
Tries to register a null factory. This should cause an exception.


testRegisterBeanFactoryNullName

public void testRegisterBeanFactoryNullName()
Tries to register a bean factory with a null name. This should cause an exception.


testDeregisterBeanFactory

public void testDeregisterBeanFactory()
Tests to deregister a bean factory.


testGetDefaultBeanFactory

public void testGetDefaultBeanFactory()
Tests whether the default bean factory is correctly initialized.


testSetDefaultBeanFactoryNull

public void testSetDefaultBeanFactoryNull()
Tests setting the default bean factory to null. This should caus an exception.


testInitBean

public void testInitBean()
Tests initializing a bean.


testInitBeanWithNoData

public void testInitBeanWithNoData()
Tests initializing a bean when the bean declaration does not contain any data.


testInitBeanWithInvalidProperty

public void testInitBeanWithInvalidProperty()
Tries to initialize a bean with a bean declaration that contains an invalid property value. This should cause an exception.


testCreateBean

public void testCreateBean()
Tests creating a bean. All necessary information is stored in the bean declaration.


testCreateBeanWithNullDeclaration

public void testCreateBeanWithNullDeclaration()
Tests creating a bean when no bean declaration is provided. This should cause an exception.


testCreateBeanWithDefaultClass

public void testCreateBeanWithDefaultClass()
Tests creating a bean. The bean's class is specified as the default class argument.


testCreateBeanWithFactoryDefaultClass

public void testCreateBeanWithFactoryDefaultClass()
Tests creating a bean when the bean's class is specified as the default class of the bean factory.


testCreateBeanWithNoClass

public void testCreateBeanWithNoClass()
Tries to create a bean when no class is provided. This should cause an exception.


testCreateBeanWithInvalidClass

public void testCreateBeanWithInvalidClass()
Tries to create a bean with a non existing class. This should cause an exception.


testCreateBeanWithDefaultFactory

public void testCreateBeanWithDefaultFactory()
Tests creating a bean using the default bean factory.


testCreateBeanWithUnknownFactory

public void testCreateBeanWithUnknownFactory()
Tests creating a bean using a non registered factory.


testCreateBeanWithException

public void testCreateBeanWithException()
Tests creating a bean when the factory throws an exception.


testCreateBeanWithParameter

public void testCreateBeanWithParameter()
Tests if a parameter is correctly passed to the bean factory.



Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.