Loading tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java +17 −13 Original line number Diff line number Diff line Loading @@ -26,7 +26,10 @@ import android.test.AndroidTestCase; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class CellIdentityNrTest extends AndroidTestCase { private static final String MCC = "310"; Loading @@ -39,13 +42,14 @@ public class CellIdentityNrTest extends AndroidTestCase { private static final int PCI = 123; private static final int TAC = 32767; private static final int NCI = 8675309; private static final int BAND = AccessNetworkConstants.NgranBands.BAND_1; private static final List<Integer> BANDS = new ArrayList<>(Arrays.asList( AccessNetworkConstants.NgranBands.BAND_1, AccessNetworkConstants.NgranBands.BAND_1)); @Test public void testGetMethod() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN the get method should return correct value Loading @@ -65,11 +69,11 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_sameParameters() { // GIVEN an instance of CellIdentityNr, and create another object with the same parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are equivalent assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr); Loading @@ -79,11 +83,11 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_differentParameters() { // GIVEN an instance of CellIdentityNr, and create another object with different parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are different assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr); Loading @@ -93,8 +97,8 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testParcel() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // WHEN write the object to parcel and create another object with that parcel Parcel parcel = Parcel.obtain(); Loading @@ -108,7 +112,7 @@ public class CellIdentityNrTest extends AndroidTestCase { assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI); assertThat(anotherCellIdentityNr.getTac()).isEqualTo(TAC); assertThat(anotherCellIdentityNr.getBand()).isEqualTo(BAND); assertThat(anotherCellIdentityNr.getBands()).isEqualTo(BANDS); assertThat(anotherCellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); assertThat(anotherCellIdentityNr.getOperatorAlphaShort()).isEqualTo(ALPHAS); assertThat(anotherCellIdentityNr.getMccString()).isEqualTo(MCC); Loading tests/telephonytests/src/com/android/internal/telephony/RILTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1625,7 +1625,7 @@ public class RILTest extends TelephonyTest { (CellSignalStrengthNr) cellInfoNr.getCellSignalStrength(); CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, CellInfo.UNAVAILABLE, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList()); CellSignalStrengthNr expectedSignalStrength = new CellSignalStrengthNr(-RSRP, -RSRQ, SIGNAL_NOISE_RATIO, -RSRP, -RSRQ, SIGNAL_NOISE_RATIO); Loading Loading
tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java +17 −13 Original line number Diff line number Diff line Loading @@ -26,7 +26,10 @@ import android.test.AndroidTestCase; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class CellIdentityNrTest extends AndroidTestCase { private static final String MCC = "310"; Loading @@ -39,13 +42,14 @@ public class CellIdentityNrTest extends AndroidTestCase { private static final int PCI = 123; private static final int TAC = 32767; private static final int NCI = 8675309; private static final int BAND = AccessNetworkConstants.NgranBands.BAND_1; private static final List<Integer> BANDS = new ArrayList<>(Arrays.asList( AccessNetworkConstants.NgranBands.BAND_1, AccessNetworkConstants.NgranBands.BAND_1)); @Test public void testGetMethod() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN the get method should return correct value Loading @@ -65,11 +69,11 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_sameParameters() { // GIVEN an instance of CellIdentityNr, and create another object with the same parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are equivalent assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr); Loading @@ -79,11 +83,11 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_differentParameters() { // GIVEN an instance of CellIdentityNr, and create another object with different parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are different assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr); Loading @@ -93,8 +97,8 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testParcel() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // WHEN write the object to parcel and create another object with that parcel Parcel parcel = Parcel.obtain(); Loading @@ -108,7 +112,7 @@ public class CellIdentityNrTest extends AndroidTestCase { assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI); assertThat(anotherCellIdentityNr.getTac()).isEqualTo(TAC); assertThat(anotherCellIdentityNr.getBand()).isEqualTo(BAND); assertThat(anotherCellIdentityNr.getBands()).isEqualTo(BANDS); assertThat(anotherCellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); assertThat(anotherCellIdentityNr.getOperatorAlphaShort()).isEqualTo(ALPHAS); assertThat(anotherCellIdentityNr.getMccString()).isEqualTo(MCC); Loading
tests/telephonytests/src/com/android/internal/telephony/RILTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1625,7 +1625,7 @@ public class RILTest extends TelephonyTest { (CellSignalStrengthNr) cellInfoNr.getCellSignalStrength(); CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, CellInfo.UNAVAILABLE, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList()); CellSignalStrengthNr expectedSignalStrength = new CellSignalStrengthNr(-RSRP, -RSRQ, SIGNAL_NOISE_RATIO, -RSRP, -RSRQ, SIGNAL_NOISE_RATIO); Loading