InstantRunBuildInfo { public boolean hasNoChanges() { return getArtifacts().isEmpty(); } InstantRunBuildInfo(@NonNull String xml, @NonNull Element root); @NonNull String getTimeStamp(); long getSecretToken(); @NonNull String getVerifierStatus(); boolean canHotswap(); boolean hasNoChanges(); int getFeatureLevel(); @NonNull List<InstantRunArtifact> getArtifacts(); boolean hasOneOf(@NonNull InstantRunArtifactType... types); boolean hasMainApk(); @Nullable static InstantRunBuildInfo get(@NonNull String xml); boolean isCompatibleFormat(); int getFormat(); void serializeTo(@NonNull Writer writer); static final String ATTR_API_LEVEL; static final String VALUE_VERIFIER_STATUS_COMPATIBLE; }
@Test public void testHasNoChanges() throws IOException { InstantRunBuildInfo info = getBuildInfo("instantrun", "build-info-no-artifacts.xml"); assertTrue("If there are no artifacts, then it doesn't matter what the verifier said.", info.hasNoChanges()); info = getBuildInfo("instantrun", "build-info-res.xml"); assertFalse("If there is an artifact, then there are changes", info.hasNoChanges()); info = getBuildInfo("instantrun", "no-changes.xml"); assertTrue(info.hasNoChanges()); }