Source:
public void testAddingSystemProperties ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String xml = "" + ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" ) + " <activity android:name=\"activityOne\"/>\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument document = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testAddingSystemProperties#xml" ) , xml ) ; ManifestMerger2.SystemProperty.VERSION_CODE.addTo ( mActionRecorder , document , "101" ) ; assertEquals ( "101" , document.getXml ( ) . getDocumentElement ( ) . getAttribute ( "android:versionCode" ) ) ; ManifestMerger2.SystemProperty.VERSION_NAME.addTo ( mActionRecorder , document , "1.0.1" ) ; assertEquals ( "1.0.1" , document.getXml ( ) . getDocumentElement ( ) . getAttribute ( "android:versionName" ) ) ; ManifestMerger2.SystemProperty.MIN_SDK_VERSION.addTo ( mActionRecorder , document , "10" ) ; org.w3c.dom.Element usesSdk = ( ( org.w3c.dom.Element ) ( document.getXml ( ) . getElementsByTagName ( "uses-sdk" ) . item ( 0 ) ) ) ; assertNotNull ( usesSdk ) ; assertEquals ( "10" , usesSdk.getAttribute ( "android:minSdkVersion" ) ) ; ManifestMerger2.SystemProperty.TARGET_SDK_VERSION.addTo ( mActionRecorder , document , "14" ) ; usesSdk = ( ( org.w3c.dom.Element ) ( document.getXml ( ) . getElementsByTagName ( "uses-sdk" ) . item ( 0 ) ) ) ; assertNotNull ( usesSdk ) ; assertEquals ( "14" , usesSdk.getAttribute ( "android:targetSdkVersion" ) ) ; }

Target:
public void testAddingSystemProperties ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String xml = "" + ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" ) + " <activity android:name=\"activityOne\"/>\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument document = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "testAddingSystemProperties#xml" ) , xml ) ; ManifestMerger2.SystemProperty.VERSION_CODE.addTo ( mActionRecorder , document , "101" ) ; assertEquals ( "101" , document.getXml ( ) . getDocumentElement ( ) . getAttribute ( "android:versionCode" ) ) ; ManifestMerger2.SystemProperty.VERSION_NAME.addTo ( mActionRecorder , document , "1.0.1" ) ; assertEquals ( "1.0.1" , document.getXml ( ) . getDocumentElement ( ) . getAttribute ( "android:versionName" ) ) ; ManifestMerger2.SystemProperty.MIN_SDK_VERSION.addTo ( mActionRecorder , document , "10" ) ; org.w3c.dom.Element usesSdk = ( ( org.w3c.dom.Element ) ( document.getXml ( ) . getElementsByTagName ( "uses-sdk" ) . item ( 0 ) ) ) ; assertNotNull ( usesSdk ) ; assertEquals ( "10" , usesSdk.getAttribute ( "android:minSdkVersion" ) ) ; ManifestMerger2.SystemProperty.TARGET_SDK_VERSION.addTo ( mActionRecorder , document , "14" ) ; usesSdk = ( ( org.w3c.dom.Element ) ( document.getXml ( ) . getElementsByTagName ( "uses-sdk" ) . item ( 0 ) ) ) ; assertNotNull ( usesSdk ) ; assertEquals ( "14" , usesSdk.getAttribute ( "android:targetSdkVersion" ) ) ; ManifestMerger2.SystemProperty.MAX_SDK_VERSION.addTo ( mActionRecorder , document , "16" ) ; usesSdk = ( ( org.w3c.dom.Element ) ( document.getXml ( ) . getElementsByTagName ( "uses-sdk" ) . item ( 0 ) ) ) ; assertNotNull ( usesSdk ) ; assertEquals ( "16" , usesSdk.getAttribute ( "android:maxSdkVersion" ) ) ; }