
ar.com.dgarcia.javaspec.impl.model.impl.NullContainerGroup 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.impl;
import ar.com.dgarcia.javaspec.impl.context.NullContextDefinition;
import ar.com.dgarcia.javaspec.impl.model.SpecElement;
import ar.com.dgarcia.javaspec.impl.model.SpecGroup;
import ar.com.dgarcia.javaspec.impl.model.SpecTest;
import ar.com.dgarcia.javaspec.impl.model.TestContextDefinition;
import java.util.Collections;
import java.util.List;
/**
* This type represents a null group to be used as root container
* Created by kfgodel on 12/07/14.
*/
public class NullContainerGroup implements SpecGroup {
private TestContextDefinition testContext;
@Override
public boolean isEmpty() {
return true;
}
@Override
public List getSubGroups() {
throw new UnsupportedOperationException("Null container doesn't have subgroups");
}
@Override
public String getName() {
return "null container";
}
@Override
public List getBeforeBlocks() {
return Collections.emptyList();
}
@Override
public List getAfterBlocks() {
return Collections.emptyList();
}
@Override
public List getDeclaredTests() {
throw new UnsupportedOperationException("Null container doesn't have subgroups");
}
@Override
public boolean isMarkedAsDisabled() {
return false;
}
@Override
public void markAsDisabled() {
throw new UnsupportedOperationException("Null container cannot be disabled");
}
@Override
public void addSubGroup(GroupSpecDefinition addedGroup) {
throw new UnsupportedOperationException("Null container cannot have subgroup");
}
@Override
public void addTest(TestSpecDefinition addedSpec) {
throw new UnsupportedOperationException("Null container cannot have test");
}
@Override
public void addBeforeBlock(Runnable aCodeBlock) {
throw new UnsupportedOperationException("Null container cannot have before block");
}
@Override
public void addAfterBlock(Runnable aCodeBlock) {
throw new UnsupportedOperationException("Null container cannot have after block");
}
@Override
public List getSpecElements() {
return Collections.emptyList();
}
@Override
public boolean hasNoTests() {
return true;
}
@Override
public TestContextDefinition getTestContext() {
return testContext;
}
public static NullContainerGroup create() {
NullContainerGroup nullContainerGroup = new NullContainerGroup();
nullContainerGroup.testContext = NullContextDefinition.create();
return nullContainerGroup;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy