Package org.jboss.as.model.test
Class FailedOperationTransformationConfig.ChainedConfig
java.lang.Object
org.jboss.as.model.test.FailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>
org.jboss.as.model.test.FailedOperationTransformationConfig.ChainedConfig
- All Implemented Interfaces:
FailedOperationTransformationConfig.PathAddressConfig
- Enclosing class:
- FailedOperationTransformationConfig
public static class FailedOperationTransformationConfig.ChainedConfig
extends FailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>
A standard configuration that allows several checkers to be used for an attribute.
For proper test coverage, the configs should be added in the same order as the rejecting transformers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
Fields inherited from class org.jboss.as.model.test.FailedOperationTransformationConfig.AttributesPathAddressConfig
attributes, complexAttributes, noWriteFailureAttributes, readOnlyAttributes -
Constructor Summary
ConstructorsConstructorDescriptionChainedConfig(List<FailedOperationTransformationConfig.AttributesPathAddressConfig<?>> configs, String... attributes) ConstructorChainedConfig(List<FailedOperationTransformationConfig.AttributesPathAddressConfig<?>> configs, org.jboss.as.controller.AttributeDefinition... attributes) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCorrectMore(org.jboss.dmr.ModelNode operation) Whether something can be corrected in the operation to make it pass.protected booleancheckValue(String attrName, org.jboss.dmr.ModelNode attribute, boolean isGeneratedWriteAttribute) org.jboss.dmr.ModelNodecorrectOperation(org.jboss.dmr.ModelNode operation) Correct the operation, only called ifFailedOperationTransformationConfig.PathAddressConfig.canCorrectMore(ModelNode)returnedtrueIt is preferable to correct one attribute at a time.protected org.jboss.dmr.ModelNodecorrectValue(org.jboss.dmr.ModelNode toResolve, boolean isGeneratedWriteAttribute) org.jboss.dmr.ModelNodecorrectWriteAttributeOperation(org.jboss.dmr.ModelNode operation) Correct the operation.createBuilder(String... attributes) createBuilder(org.jboss.as.controller.AttributeDefinition... attributes) booleanexpectFailed(org.jboss.dmr.ModelNode operation) Whether it is expected that the following operation should failbooleanexpectFailedWriteAttributeOperation(org.jboss.dmr.ModelNode operation) Whether it is expected that the following write attribute operation should failprotected booleanisAttributeWritable(String attributeName) Methods inherited from class org.jboss.as.model.test.FailedOperationTransformationConfig.AttributesPathAddressConfig
checkValue, configureComplexAttribute, convert, correctUndefinedValue, createWriteAttributeOperations, expectDiscarded, setNotExpectedWriteFailure, setNotExpectedWriteFailure, setReadOnly, setReadOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.model.test.FailedOperationTransformationConfig.PathAddressConfig
operationDone
-
Constructor Details
-
ChainedConfig
public ChainedConfig(List<FailedOperationTransformationConfig.AttributesPathAddressConfig<?>> configs, String... attributes) Constructor- Parameters:
configs- the configurations to use. For proper test coverage, these should be added in the same order as the rejecting transformersattributes- the attributes to apply these transformers to
-
ChainedConfig
public ChainedConfig(List<FailedOperationTransformationConfig.AttributesPathAddressConfig<?>> configs, org.jboss.as.controller.AttributeDefinition... attributes) Constructor- Parameters:
configs- the configurations to use. For proper test coverage, these should be added in the same order as the rejecting transformersattributes- the attributes to apply these transformers to
-
-
Method Details
-
expectFailed
public boolean expectFailed(org.jboss.dmr.ModelNode operation) Description copied from interface:FailedOperationTransformationConfig.PathAddressConfigWhether it is expected that the following operation should fail- Specified by:
expectFailedin interfaceFailedOperationTransformationConfig.PathAddressConfig- Overrides:
expectFailedin classFailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>- Parameters:
operation- the operation to check- Returns:
trueif expected to fail
-
correctOperation
public org.jboss.dmr.ModelNode correctOperation(org.jboss.dmr.ModelNode operation) Description copied from interface:FailedOperationTransformationConfig.PathAddressConfigCorrect the operation, only called ifFailedOperationTransformationConfig.PathAddressConfig.canCorrectMore(ModelNode)returnedtrueIt is preferable to correct one attribute at a time.- Specified by:
correctOperationin interfaceFailedOperationTransformationConfig.PathAddressConfig- Overrides:
correctOperationin classFailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>- Parameters:
operation- the operation to correct- Returns:
- the corrected operation
-
correctWriteAttributeOperation
public org.jboss.dmr.ModelNode correctWriteAttributeOperation(org.jboss.dmr.ModelNode operation) Description copied from interface:FailedOperationTransformationConfig.PathAddressConfigCorrect the operation. This only deals with one attribute, and the framework will only call this once if it failed andFailedOperationTransformationConfig.PathAddressConfig.correctWriteAttributeOperation(ModelNode)returnedtrue, so make sure to do everything to correct thevalueattribute.- Specified by:
correctWriteAttributeOperationin interfaceFailedOperationTransformationConfig.PathAddressConfig- Overrides:
correctWriteAttributeOperationin classFailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>- Parameters:
operation- the 'write-attribute' operation to correct- Returns:
- the corrected operation
-
isAttributeWritable
-
canCorrectMore
public boolean canCorrectMore(org.jboss.dmr.ModelNode operation) Description copied from interface:FailedOperationTransformationConfig.PathAddressConfigWhether something can be corrected in the operation to make it pass. It is preferable to correct one attribute at a time.- Specified by:
canCorrectMorein interfaceFailedOperationTransformationConfig.PathAddressConfig- Overrides:
canCorrectMorein classFailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>- Parameters:
operation- the operation to check- Returns:
trueif expected to fail,falseotherwise
-
expectFailedWriteAttributeOperation
public boolean expectFailedWriteAttributeOperation(org.jboss.dmr.ModelNode operation) Description copied from interface:FailedOperationTransformationConfig.PathAddressConfigWhether it is expected that the following write attribute operation should fail- Specified by:
expectFailedWriteAttributeOperationin interfaceFailedOperationTransformationConfig.PathAddressConfig- Overrides:
expectFailedWriteAttributeOperationin classFailedOperationTransformationConfig.AttributesPathAddressConfig<FailedOperationTransformationConfig.ChainedConfig>- Parameters:
operation- the 'add' operation to correct- Returns:
trueif expected to fail
-
checkValue
protected boolean checkValue(String attrName, org.jboss.dmr.ModelNode attribute, boolean isGeneratedWriteAttribute) -
correctValue
protected org.jboss.dmr.ModelNode correctValue(org.jboss.dmr.ModelNode toResolve, boolean isGeneratedWriteAttribute) -
createBuilder
public static FailedOperationTransformationConfig.ChainedConfig.Builder createBuilder(String... attributes) -
createBuilder
public static FailedOperationTransformationConfig.ChainedConfig.Builder createBuilder(org.jboss.as.controller.AttributeDefinition... attributes)
-