Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cea9e6df authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Frameworks: Annotate JUnit4 tests with @Test & @Ignore

Mollify Errorprone.

Bug: 72076216
Bug: 73792882
Test: m javac-check RUN_ERROR_PRONE=true
Test: m RunFrameworksServicesRoboTests
Test: atest AppStateTrackerTest
Test: atest ActivityRecordTests
Change-Id: I8c496067e850a6c1dc17fdadc0a39c621e3a2f68
parent 020c03aa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ import com.android.server.testing.shadows.ShadowBackupDataInput;
import com.android.server.testing.shadows.ShadowBackupDataOutput;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher;
@@ -489,8 +490,9 @@ public class PerformBackupTaskTest {
    }

    // TODO: Giving NPE at PerformBackupTask:524 because mCurrentPackage is null (PackageManager
    // rightfully threw NameNotFoundException). Uncomment @Test when fixed.
    // @Test
    // rightfully threw NameNotFoundException). Remove @Ignore when fixed.
    @Ignore
    @Test
    public void testRunTask_whenAgentUnknown() throws Exception {
        // Not calling setUpAgent()
        TransportMock transportMock = setUpTransport(mTransport);
+3 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ import com.android.internal.app.IAppOpsService;
import com.android.server.AppStateTracker.Listener;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -660,6 +661,8 @@ public class AppStateTrackerTest {
        areRestrictedWithExemption(instance, UID_2, PACKAGE_2, NONE);
    }

    @Ignore("b/73792882")
    @Test
    public void loadPersistedAppOps() throws Exception {
        final AppStateTrackerTestable instance = newInstance();

+3 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.util.MutableBoolean;

import org.junit.runner.RunWith;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;

@@ -111,7 +112,8 @@ public class ActivityRecordTests extends ActivityTestsBase {
    }

    // TODO: b/71582913
    //@Test
    @Ignore("b/71582913")
    @Test
    public void testPausingWhenVisibleFromStopped() throws Exception {
        final MutableBoolean pauseFound = new MutableBoolean(false);
        doAnswer((InvocationOnMock invocationOnMock) -> {