Class FallbackTest

java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.fault.tolerance.tck.FallbackTest
All Implemented Interfaces:
org.testng.IHookable, org.testng.ITestNGListener

public class FallbackTest extends org.jboss.arquillian.testng.Arquillian
Test fallback was invoked correctly; fallback handler supporting CDI injection; type safety on fallback class.
Author:
Neil Young
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.jboss.arquillian.testng.Arquillian

    org.jboss.arquillian.testng.Arquillian.UpdateResultListener
  • Field Summary

    Fields inherited from class org.jboss.arquillian.testng.Arquillian

    ARQUILLIAN_DATA_PROVIDER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.jboss.shrinkwrap.api.spec.WebArchive
     
    void
    Analogous to testFallbackSuccess with Class level annotations that are inherited by serviceA but overridden by serviceB.
    void
    Test that a method in a Fallback service is driven after the specified number of retries are executed.
    void
    Analogous to testFallbackMethodSuccess but serviceE has a pair of parameters.
    void
    Test that a Fallback service is driven after the specified number of retries are executed.
    void
    Test that a Fallback service is driven after the specified number of retries are executed.
    void
    Test that a Fallback service is driven after the specified number of retries are executed.
    void
    A refinement on testFallbackSuccess to test that a bean may be injected in the FallbackHandler.
    void
    Test that a Fallback service can work alone, without other annotations.
    void
    Test that a Fallback service can work alone, without other annotations.

    Methods inherited from class org.jboss.arquillian.testng.Arquillian

    arquillianAfterClass, arquillianAfterSuite, arquillianAfterTest, arquillianArgumentProvider, arquillianBeforeClass, arquillianBeforeSuite, arquillianBeforeTest, run

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FallbackTest

      public FallbackTest()
  • Method Details

    • deploy

      @Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy()
    • testFallbackSuccess

      public void testFallbackSuccess()
      Test that a Fallback service is driven after the specified number of retries are executed. Each of serviceA and serviceB specify the same FallbackHandler. The test checks that the handler has been driven in the correct ExecutionContext and that the Service has been executed the correct number of times.
    • testFallbackWithBeanSuccess

      public void testFallbackWithBeanSuccess()
      A refinement on testFallbackSuccess to test that a bean may be injected in the FallbackHandler. Each of serviceA and serviceB specify the same FallbackHandler. The test checks that the handler has been driven in the correct ExecutionContext and that the Service has been executed the correct number of times.
    • testClassLevelFallbackSuccess

      public void testClassLevelFallbackSuccess()
      Analogous to testFallbackSuccess with Class level annotations that are inherited by serviceA but overridden by serviceB.
    • testFallbacktNoTimeout

      public void testFallbacktNoTimeout()
      Test that a Fallback service is driven after the specified number of retries are executed. A timeout is configured for serviceC but the service should fail before the timeout is reached and generate a RuntimeException. After a retry the Fallback will be executed.
    • testFallbackTimeout

      public void testFallbackTimeout()
      Test that a Fallback service is driven after the specified number of retries are executed. A timeout is configured for serviceC and in this case the service should generate Timeout exceptions. After a retry the Fallback will be executed.
    • testFallbackMethodSuccess

      public void testFallbackMethodSuccess()
      Test that a method in a Fallback service is driven after the specified number of retries are executed. ServiceD specifies a method on a FallbackHandler. The test checks that the FallbackHandler method has been driven and that the Service has been executed the correct number of times.
    • testFallbackMethodWithArgsSuccess

      public void testFallbackMethodWithArgsSuccess()
      Analogous to testFallbackMethodSuccess but serviceE has a pair of parameters. ServiceE specifies a method on a FallbackHandler. The test checks that the FallbackHandler method has been driven and that the Service has been executed the correct number of times.
    • testStandaloneHandlerFallback

      public void testStandaloneHandlerFallback()
      Test that a Fallback service can work alone, without other annotations.

      ServiceA fallback is driven by a class implementing FallbackHandler. ServiceA is only called once.

    • testStandaloneMethodFallback

      public void testStandaloneMethodFallback()
      Test that a Fallback service can work alone, without other annotations.

      ServiceB fallback is driven by a FallbackHandler method in the same class. ServiceB is only called once.