org.jboss.jsfunit.analysis
Class ManagedBeanTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jboss.jsfunit.analysis.ManagedBeanTestCase
All Implemented Interfaces:
junit.framework.Test

public class ManagedBeanTestCase
extends junit.framework.TestCase

A TestCase for a single JSF managed bean.

Version:
$$Revision: $$
Author:
Alexander Jesse

Field Summary
protected  String configFilePath
          path to the config file
protected  Class<?> managedBeanClass
          class of the managed bean
protected  String managedBeanClassName
          class name of the managed bean
protected  String managedBeanName
          name of the managed bean
protected  Node managedBeanNode
          DOM node of the managed bean to test
 
Constructor Summary
ManagedBeanTestCase(String name, String configFilePath, String managedBeanName, Node managedBeanNode)
          Create a new ManagedBeanTestCase.
 
Method Summary
 void runTest()
          Call the individual test methods.
 void testClassAttribute()
          Assert that a bean configuration has a class attribute
 void testClassLoadable()
          Assert that the configured class can be loaded from the classpath
 void testDuplicateProperties()
          Assert that no duplicate properties are configured for this managed bean.
 void testNameAttribute()
          Assert that a bean configuration has a name attribute
 void testScopeAttribute()
          Assert that a bean configuration has a scope attribute
 void testSerializableInterface()
          Assert that the classes for beans with scope session or application implement the Serialized interface as per JSF specification.
 void testValidScope()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

configFilePath

protected String configFilePath
path to the config file


managedBeanName

protected String managedBeanName
name of the managed bean


managedBeanClassName

protected String managedBeanClassName
class name of the managed bean


managedBeanNode

protected Node managedBeanNode
DOM node of the managed bean to test


managedBeanClass

protected Class<?> managedBeanClass
class of the managed bean

Constructor Detail

ManagedBeanTestCase

public ManagedBeanTestCase(String name,
                           String configFilePath,
                           String managedBeanName,
                           Node managedBeanNode)
Create a new ManagedBeanTestCase.

Parameters:
name - The name of the test-case in the JUnit test-hierarchy
configFilePath - path to a single config file
managedBeanName - the name of the bean to build the test suite for
managedBeanNode - the DOM node containing the managed bean
Method Detail

runTest

public void runTest()
Call the individual test methods.

Overrides:
runTest in class junit.framework.TestCase

testNameAttribute

public void testNameAttribute()
Assert that a bean configuration has a name attribute


testClassAttribute

public void testClassAttribute()
Assert that a bean configuration has a class attribute


testScopeAttribute

public void testScopeAttribute()
Assert that a bean configuration has a scope attribute


testClassLoadable

public void testClassLoadable()
Assert that the configured class can be loaded from the classpath


testValidScope

public void testValidScope()

testSerializableInterface

public void testSerializableInterface()
Assert that the classes for beans with scope session or application implement the Serialized interface as per JSF specification.


testDuplicateProperties

public void testDuplicateProperties()
Assert that no duplicate properties are configured for this managed bean.



Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.