Buggy code:
@ Test public void testAliasedResourceAndAttributeReadWriteFromAliased ( ) throws Exception { } @ Test public void testInvokeOpFromCore ( ) throws Exception { } @ Test public void testInvokeOpFromAliased ( ) throws Exception { } @ Test public void readChildrenTypes ( ) throws Exception { } @ Test public void testReadChildresNamesNoModel ( ) throws Exception { } @ Test public void testReadChildresNamesWithModel ( ) throws Exception { } @ Test public void testReadChildrenResources ( ) throws Exception { } @ Test public void testReadOperationNamesCore ( ) throws Exception { } @ Test public void testReadOperationNamesAliased ( ) throws Exception { } @ Test public void testReadOperationDescriptionCore ( ) throws Exception { } @ Test public void testReadOperationDescriptionAliased ( ) throws Exception { } @ Test public void testDescribeHandler ( ) throws Exception { } private void testAliasedResourceAndAttributeReadWrite ( String main , String other ) throws Exception { } private void checkInvokeOp ( String main , String other ) throws Exception { } private void addCore ( String main ) throws Exception { } private void addChild ( String main ) throws Exception { } private void readResource ( boolean includeRuntime , boolean includeAlias , String ro , String rw , String rt , String childRw ) throws Exception { } private void readResource ( boolean includeRuntime , boolean includeAlias , String ro , String rw , String rt , String childRw , String ... address ) throws Exception { } private void checkResource ( boolean includeAlias , ModelNode model , String ro , String rw , String rt , String childRw ) throws Exception { } private void checkReadResourceDescription ( ModelNode resource , boolean aliasedChild ) throws Exception { } private void checkChildResourceDescription ( ModelNode resource ) { } private void readOperationNames ( String core ) throws Exception { } private void checkOperationNames ( ModelNode result , String unique ) { } private void readOperationDescription ( String core ) throws Exception { } private void readOperationDescriptionForChild ( String core , String child ) throws Exception { } private void writeAttribute ( String name , String value , String ... address ) throws Exception { } private String readAttribute ( String name , String ... address ) throws Exception { } private void undefineAttribute ( String name , String ... address ) throws Exception { } private void checkAttribute ( ModelNode attr , String description , String accessType , String storage ) { } @ Override @ SuppressWarnings ( "deprecation" ) protected void initModel ( Resource rootResource , ManagementResourceRegistration registration ) { } private PathElement getCoreModelElement ( ) { } private PathElement getAliasedModelElement ( ) { } private PathElement getChildModelElement ( ) { } private PathElement getAliasedChildModelElement ( ) { } private static SimpleAttributeDefinition READ_WRITE = new SimpleAttributeDefinition ( "rw" , ModelType . STRING , true ) ; private static SimpleAttributeDefinition READ_ONLY = new SimpleAttributeDefinition ( "ro" , ModelType . STRING , false ) ; private static SimpleAttributeDefinition RUNTIME = SimpleAttributeDefinitionBuilder . create ( "rt" , STRING , false ) . setStorageRuntime ( ) . build ( ) ; private static SimpleAttributeDefinition READ_WRITE_ALIAS = SimpleAttributeDefinitionBuilder . create ( "rwa" , AliasResourceTestCase . READ_WRITE ) . setFlags ( ALIAS ) . build ( ) ; private static SimpleAttributeDefinition READ_ONLY_ALIAS = SimpleAttributeDefinitionBuilder . create ( "roa" , AliasResourceTestCase . READ_ONLY ) . setFlags ( ALIAS ) . build ( ) ; private class CoreResourceDefinition extends SimpleResourceDefinition { public CoreResourceDefinition ( ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { } } private class ChildResourceDefinition extends SimpleResourceDefinition { public ChildResourceDefinition ( ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { } } static ResourceDescriptionResolver createResourceDescriptionResolver ( ) { } private static class CoreAddHandler extends AbstractAddStepHandler { @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } } private static class CoreRemoveHandler extends AbstractRemoveStepHandler { protected void performRemove ( OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } } private static class CoreRuntimeHandler implements OperationStepHandler { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . set ( "runtime" ) ; context . stepCompleted ( ) ; } } private static class ChildAddHandler extends AbstractAddStepHandler { @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } } private static class ChildRemoveHandler extends AbstractRemoveStepHandler { protected void performRemove ( OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { } } private static class TestOperationHandler implements OperationStepHandler { final String value ; public TestOperationHandler ( String value ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . set ( value ) ; context . stepCompleted ( ) ; } } public static class TestAliasEntry extends AliasEntry { public TestAliasEntry ( final ManagementResourceRegistration target ) { } @ Override public PathAddress convertToTargetAddress ( PathAddress addr ) { } } private static class TestAttributeAliasHandler implements OperationStepHandler { private final String targetAttribute ; static final AliasResourceTestCase . TestAttributeAliasHandler READ_ONLY_ALIAS = new AliasResourceTestCase . TestAttributeAliasHandler ( "ro" ) ; static final AliasResourceTestCase . TestAttributeAliasHandler READ_WRITE_ALIAS = new AliasResourceTestCase . TestAttributeAliasHandler ( "rw" ) ; public TestAttributeAliasHandler ( String targetAttribute ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { OperationStepHandler step = ( operation . get ( OP ) . asString ( ) . equals ( WRITE_ATTRIBUTE_OPERATION ) ) ? WriteAttributeHandler . INSTANCE : ReadAttributeHandler . INSTANCE ; ModelNode aliasOp = operation . clone ( ) ; aliasOp . get ( NAME ) . set ( targetAttribute ) ; <START_BUG> context . addStep ( aliasOp , step , IMMEDIATE ) ; <END_BUG> context . stepCompleted ( ) ; } } }

Fix:
context . addStep ( aliasOp , step , Stage . MODEL , true ) ;