Class JGivenMethodRule

  • All Implemented Interfaces:
    org.junit.rules.MethodRule
    Direct Known Subclasses:
    StandaloneScenarioRule

    public class JGivenMethodRule
    extends java.lang.Object
    implements org.junit.rules.MethodRule
    JUnit Rule to enable JGiven in a JUnit test
    Since:
    0.13.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.tngtech.jgiven.impl.ScenarioBase scenario  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, java.lang.Object target)  
      protected void failed​(java.lang.Throwable e)  
      com.tngtech.jgiven.impl.ScenarioBase getScenario()
      Returns the ScenarioBase instance of this rule
      protected void starting​(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod testMethod, java.lang.Object target)  
      protected void succeeded()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • scenario

        protected final com.tngtech.jgiven.impl.ScenarioBase scenario
    • Constructor Detail

      • JGivenMethodRule

        public JGivenMethodRule()
        Since:
        0.12.0
      • JGivenMethodRule

        public JGivenMethodRule​(com.tngtech.jgiven.impl.ScenarioBase scenario)
        Since:
        0.8.1
    • Method Detail

      • getScenario

        public com.tngtech.jgiven.impl.ScenarioBase getScenario()
        Returns the ScenarioBase instance of this rule
      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runners.model.FrameworkMethod method,
                                                       java.lang.Object target)
        Specified by:
        apply in interface org.junit.rules.MethodRule
      • succeeded

        protected void succeeded()
                          throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • failed

        protected void failed​(java.lang.Throwable e)
                       throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • starting

        protected void starting​(org.junit.runners.model.Statement base,
                                org.junit.runners.model.FrameworkMethod testMethod,
                                java.lang.Object target)