
ar.com.dgarcia.javaspec.impl.model.SpecGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-spec Show documentation
Show all versions of java-spec Show documentation
Junit testing extension to allow specs expressibility
The newest version!
package ar.com.dgarcia.javaspec.impl.model;
import ar.com.dgarcia.javaspec.impl.model.impl.GroupSpecDefinition;
import ar.com.dgarcia.javaspec.impl.model.impl.TestSpecDefinition;
import java.util.List;
/**
* This type represents a test group inside a spec
* Created by kfgodel on 12/07/14.
*/
public interface SpecGroup extends SpecElement {
/**
* Indicates if this group contains any spec test.
* @return true if there's no spec in this group
*/
boolean isEmpty();
/**
* Returns the ordered list of declared groups inside this one
* @return The list of this sub-groups
*/
List getSubGroups();
/**
* Returns the name identifying this group
* @return The name given by describe
*/
String getName();
/**
* Returns the ordered list of tests declared directly inside the body of this group
* @return The test list
*/
List getDeclaredTests();
/**
* Indicates that this group is disabled as all its childs
* @return true if this group is disabled
*/
boolean isMarkedAsDisabled();
/**
* Disables this group and its childs
*/
void markAsDisabled();
/**
* Adds a new group definition to this group.
* @param addedGroup The group to add as child of this
*/
void addSubGroup(GroupSpecDefinition addedGroup);
/**
* Adds a new test spec to this group
* @param addedSpec The test to add as child of this group
*/
void addTest(TestSpecDefinition addedSpec);
/**
* Adds a before block to this group definition. Every test on this group, and every subgroup will execute it
* @param aCodeBlock The code to execute before tests
*/
void addBeforeBlock(Runnable aCodeBlock);
/**
* Adds an after block to this group definition. Every test on this group and every subgroup will execute it.
*
* @param aCodeBlock The code to execute after tests
*/
void addAfterBlock(Runnable aCodeBlock);
/**
* Returns all the elements in the order declared in this group.
* Elements will be SpecGroup or SpecTest
* @return The list of declared elemetns
*/
List getSpecElements();
/**
* Indicates if this group has no test directly or indirectly by its children
* @return true if this group has no test. False if it has, even if disabled
*/
boolean hasNoTests();
/**
* Returns the context definition in the scope of this group.
* The context returned can re-define some of the variables from parent context
* @return The context for this group
*/
TestContextDefinition getTestContext();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy