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

Commit 396282a7 authored by Paul Duffin's avatar Paul Duffin
Browse files

Fix test so that it runs as a JUnit 4 rather than JUnit 3 test

The test indirectly extended junit.framework.TestCase from JUnit 3 but
used JUnit 4 @Test annotations. That combination caused the runner
to run it as a JUnit 3 test which is almost certainly not what was
wanted. Amongst other issues it means that @Ignore annotations did not
work.

This change stops it extending AndroidTestCase and fixes a problem
with a non test method being annotated with @Test.

Bug: 122886015
Test: atest FrameworksTelephonyTests
Change-Id: I67b334ac898cca05283387832f7a848cc552b33f
parent 1f2e8825
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,8 +15,9 @@
 */
package com.android.internal.telephony;

import static org.junit.Assert.assertEquals;

import android.telephony.PhoneNumberFormattingTextWatcher;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.text.Editable;
import android.text.Selection;
@@ -25,7 +26,7 @@ import android.text.TextWatcher;

import org.junit.Test;

public class PhoneNumberWatcherTest extends AndroidTestCase {
public class PhoneNumberWatcherTest {
    @Test @SmallTest
    public void testAppendChars() {
        final String multiChars = "65012345";
@@ -300,7 +301,6 @@ public class PhoneNumberWatcherTest extends AndroidTestCase {
        assertEquals(expected.length(), Selection.getSelectionEnd(number));
    }

    @Test @SmallTest
    private TextWatcher getTextWatcher() {
        return new PhoneNumberFormattingTextWatcher("US");
    }