org.jboss.webbeans.tck.unit.context
Class NormalContextTest

java.lang.Object
  extended by org.jboss.webbeans.tck.AbstractTest
      extended by org.jboss.webbeans.tck.unit.context.NormalContextTest

public class NormalContextTest
extends AbstractTest

Author:
Nicklas Karlsson, Pete Muir This class tests a basic context against section 8 of the specification Spec version: PRD2

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.webbeans.tck.AbstractTest
AbstractTest.RunInDependentContext
 
Field Summary
 
Fields inherited from class org.jboss.webbeans.tck.AbstractTest
BUILT_IN_BEANS, manager, visited
 
Constructor Summary
NormalContextTest()
           
 
Method Summary
 void initContext()
           
 void testContextDestroysBeansWhenDestroyed()
          The Context implementation is responsible for destroying any contextual instance it creates by passing the instance to the destroy() method of the Contextual object representing the contextual type.
 void testDestroyedInstanceMustNotBeReturnedByGet()
          A destroyed instance must not subsequently be returned by the get() method.
 void testGetMayNotCreateNewInstanceUnlessCreateIsTrue()
          The get() method may not create a new instance of the given contextual type unless the create parameter is true
 void testGetMayNotReturnNullUnlessCreateIsFalseOrContextualCreateReturnsNull()
          The get() method may not return a null value unless the create parameter is false or Contextual.create() returns a null value
 void testGetReturnsExistingInstace()
          return an existing instance of the given contextual type, or
 void testGetWithCreateFalseReturnsNull()
          if the value of the create parameter is false, return a null value, or
 void testGetWithCreateTrueReturnsNewInstance()
          if the value of the create parameter is true, create a new instance of the given contextual type by calling Bean.create() and return the new instance.
 void testInvokingGetOnInactiveContextFails()
          When a scope is inactive, any invocation of the get() from the current thread upon the Context object for that scope results in a ContextNotActiveException.
 void testOnlyMappedInstancePerContextualTypePerThread()
          There may be no more than one mapped instance per contextual type per thread
 
Methods inherited from class org.jboss.webbeans.tck.AbstractTest
activateDependentContext, after, before, createEnterpriseBean, createProducerFieldBean, createProducerMethodBean, createSimpleBean, deactivateDependentContext, deployBeans, deserialize, getEnabledDeploymentTypes, getStandardDeploymentTypes, mockCreationalContext, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormalContextTest

public NormalContextTest()
Method Detail

initContext

public void initContext()

testGetReturnsExistingInstace

@SpecAssertion(section="8.1")
public void testGetReturnsExistingInstace()
return an existing instance of the given contextual type, or


testGetWithCreateFalseReturnsNull

@SpecAssertion(section="8.1")
public void testGetWithCreateFalseReturnsNull()
if the value of the create parameter is false, return a null value, or


testGetWithCreateTrueReturnsNewInstance

@SpecAssertion(section="8.1")
public void testGetWithCreateTrueReturnsNewInstance()
if the value of the create parameter is true, create a new instance of the given contextual type by calling Bean.create() and return the new instance.


testGetMayNotReturnNullUnlessCreateIsFalseOrContextualCreateReturnsNull

@SpecAssertion(section="8.1")
public void testGetMayNotReturnNullUnlessCreateIsFalseOrContextualCreateReturnsNull()
The get() method may not return a null value unless the create parameter is false or Contextual.create() returns a null value


testGetMayNotCreateNewInstanceUnlessCreateIsTrue

@SpecAssertion(section="8.1")
public void testGetMayNotCreateNewInstanceUnlessCreateIsTrue()
The get() method may not create a new instance of the given contextual type unless the create parameter is true


testContextDestroysBeansWhenDestroyed

public void testContextDestroysBeansWhenDestroyed()
The Context implementation is responsible for destroying any contextual instance it creates by passing the instance to the destroy() method of the Contextual object representing the contextual type.


testDestroyedInstanceMustNotBeReturnedByGet

@SpecAssertion(section="8.1")
public void testDestroyedInstanceMustNotBeReturnedByGet()
A destroyed instance must not subsequently be returned by the get() method.


testInvokingGetOnInactiveContextFails

@SpecAssertion(section="8.1")
public void testInvokingGetOnInactiveContextFails()
When a scope is inactive, any invocation of the get() from the current thread upon the Context object for that scope results in a ContextNotActiveException.


testOnlyMappedInstancePerContextualTypePerThread

@SpecAssertion(section="8.1")
public void testOnlyMappedInstancePerContextualTypePerThread()
There may be no more than one mapped instance per contextual type per thread



Copyright © 2008-2009. All Rights Reserved.