Source:
public void testInvalidSelector ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String higherPriority = "" + ( ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <permission android:name=\"permissionOne\"" ) + " tools:node=\"remove\"" ) + " tools:selector=\"com.example.libXYZ\">\n" ) + " </permission>\n" ) + "\n" ) + "</manifest>" ) ; java.lang.String lowerPriorityOne = "" + ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib1\">\n" ) + "\n" ) + " <permission android:name=\"permissionOne\"" ) + " android:protectionLevel=\"signature\">\n" ) + " </permission>\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument refDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "higherPriority" ) , higherPriority ) ; com.android.manifmerger.XmlDocument firstLibrary = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "lowerPriorityOne" ) , lowerPriorityOne ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( new com.android.utils.StdLogger ( StdLogger.Level.VERBOSE ) ) ; com.google.common.base.Optional < com.android.manifmerger.XmlDocument > result = refDocument.merge ( firstLibrary , mergingReportBuilder ) ; assertFalse ( result.isPresent ( ) ) ; com.google.common.collect.ImmutableList < com.android.manifmerger.MergingReport.Record > loggingRecords = mergingReportBuilder.build ( ) . getLoggingRecords ( ) ; assertEquals ( 1 , loggingRecords.size ( ) ) ; assertEquals ( MergingReport.Record.Severity.ERROR , loggingRecords.get ( 0 ) . getSeverity ( ) ) ; assertTrue ( loggingRecords.get ( 0 ) . getMessage ( ) . contains ( "tools:selector" ) ) ; }

Target:
public void testInvalidSelector ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.lang.String higherPriority = "" + ( ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib3\">\n" ) + "\n" ) + " <permission android:name=\"permissionOne\"" ) + " tools:node=\"remove\"" ) + " tools:selector=\"com.example.libXYZ\">\n" ) + " </permission>\n" ) + "\n" ) + "</manifest>" ) ; java.lang.String lowerPriorityOne = "" + ( ( ( ( ( ( ( ( ( "<manifest\n" + " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" ) + " xmlns:tools=\"http://schemas.android.com/tools\"\n" ) + " package=\"com.example.lib1\">\n" ) + "\n" ) + " <permission android:name=\"permissionOne\"" ) + " android:protectionLevel=\"signature\">\n" ) + " </permission>\n" ) + "\n" ) + "</manifest>" ) ; com.android.manifmerger.XmlDocument refDocument = com.android.manifmerger.TestUtils.xmlDocumentFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "higherPriority" ) , higherPriority ) ; com.android.manifmerger.XmlDocument firstLibrary = com.android.manifmerger.TestUtils.xmlLibraryFromString ( new com.android.manifmerger.TestUtils.TestSourceLocation ( getClass ( ) , "lowerPriorityOne" ) , lowerPriorityOne ) ; com.android.manifmerger.MergingReport.Builder mergingReportBuilder = new com.android.manifmerger.MergingReport.Builder ( new com.android.utils.StdLogger ( StdLogger.Level.VERBOSE ) ) ; com.google.common.base.Optional < com.android.manifmerger.XmlDocument > result = refDocument.merge ( firstLibrary , mergingReportBuilder ) ; assertFalse ( result.isPresent ( ) ) ; com.google.common.collect.ImmutableList < com.android.manifmerger.MergingReport.Record > loggingRecords = mergingReportBuilder.build ( ) . getLoggingRecords ( ) ; assertEquals ( 1 , loggingRecords.size ( ) ) ; assertEquals ( MergingReport.Record.Severity.ERROR , loggingRecords.get ( 0 ) . getSeverity ( ) ) ; assertTrue ( loggingRecords.get ( 0 ) . getMessage ( ) . contains ( "tools:selector" ) ) ; }