Source:
public void testOrientation ( ) { com.android.ide.common.layout.LinearLayoutRule rule = new com.android.ide.common.layout.LinearLayoutRule ( ) ; initialize ( rule , "android.widget.LinearLayout" ) ; com.android.ide.common.layout.TestNode node = com.android.ide.common.layout.TestNode.create ( "android.widget.LinearLayout" ) . id ( "@+id/LinearLayout012" ) ; node.putAttributeInfo ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , "orientation" , new com.android.ide.common.layout.TestAttributeInfo ( com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION , com.android.ide.common.api.IAttributeInfo.Format.ENUM_SET , "android.widget.LinearLayout" , new java.lang.String [ ] { "horizontal" , "vertical" } , null , null ) ) ; assertNull ( node.getStringAttr ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION ) ) ; java.util.List < com.android.ide.common.api.RuleAction > contextMenu = new java.util.ArrayList < com.android.ide.common.api.RuleAction > ( ) ; rule.addContextMenuActions ( contextMenu , node ) ; assertEquals ( 7 , contextMenu.size ( ) ) ; com.android.ide.common.api.RuleAction orientationAction = contextMenu.get ( 1 ) ; assertEquals ( "Orientation" , orientationAction.getTitle ( ) ) ; assertTrue ( orientationAction.getClass ( ) . getName ( ) , ( orientationAction instanceof com.android.ide.common.api.RuleAction.Choices ) ) ; com.android.ide.common.api.RuleAction.Choices choices = ( ( com.android.ide.common.api.RuleAction.Choices ) ( orientationAction ) ) ; com.android.ide.common.api.IMenuCallback callback = choices.getCallback ( ) ; callback.action ( orientationAction , java.util.Collections.singletonList ( node ) , com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL , true ) ; java.lang.String orientation = node.getStringAttr ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION ) ; assertEquals ( com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL , orientation ) ; callback.action ( orientationAction , java.util.Collections.singletonList ( node ) , com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL , true ) ; orientation = node.getStringAttr ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION ) ; assertEquals ( com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL , orientation ) ; }

Target:
public void testOrientation ( ) { com.android.ide.common.layout.LinearLayoutRule rule = new com.android.ide.common.layout.LinearLayoutRule ( ) ; initialize ( rule , "android.widget.LinearLayout" ) ; com.android.ide.common.layout.TestNode node = com.android.ide.common.layout.TestNode.create ( "android.widget.LinearLayout" ) . id ( "@+id/LinearLayout012" ) ; node.putAttributeInfo ( com.android.util.XmlUtils.ANDROID_URI , "orientation" , new com.android.ide.common.layout.TestAttributeInfo ( com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION , com.android.ide.common.api.IAttributeInfo.Format.ENUM_SET , "android.widget.LinearLayout" , new java.lang.String [ ] { "horizontal" , "vertical" } , null , null ) ) ; assertNull ( node.getStringAttr ( com.android.util.XmlUtils.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION ) ) ; java.util.List < com.android.ide.common.api.RuleAction > contextMenu = new java.util.ArrayList < com.android.ide.common.api.RuleAction > ( ) ; rule.addContextMenuActions ( contextMenu , node ) ; assertEquals ( 7 , contextMenu.size ( ) ) ; com.android.ide.common.api.RuleAction orientationAction = contextMenu.get ( 1 ) ; assertEquals ( "Orientation" , orientationAction.getTitle ( ) ) ; assertTrue ( orientationAction.getClass ( ) . getName ( ) , ( orientationAction instanceof com.android.ide.common.api.RuleAction.Choices ) ) ; com.android.ide.common.api.RuleAction.Choices choices = ( ( com.android.ide.common.api.RuleAction.Choices ) ( orientationAction ) ) ; com.android.ide.common.api.IMenuCallback callback = choices.getCallback ( ) ; callback.action ( orientationAction , java.util.Collections.singletonList ( node ) , com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL , true ) ; java.lang.String orientation = node.getStringAttr ( com.android.util.XmlUtils.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION ) ; assertEquals ( com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL , orientation ) ; callback.action ( orientationAction , java.util.Collections.singletonList ( node ) , com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL , true ) ; orientation = node.getStringAttr ( com.android.util.XmlUtils.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION ) ; assertEquals ( com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL , orientation ) ; }