Search in sources :

Example 6 with NetworkType

use of com.att.aro.core.peripheral.pojo.NetworkType in project VideoOptimzer by attdevsupport.

the class NetworkTypeReaderImplTest method readData.

@Test
public void readData() throws IOException {
    Mockito.when(filereader.fileExist(Mockito.anyString())).thenReturn(true);
    String[] arr = new String[] { // 0
    "1.358205538539E9 10", // 1
    "1.358205540396E9 15", // 2
    "1.35820554882E9 3", // 3
    "1.358205549444E9 1", // 4
    "1.358205552859E9 9", // 5
    "1.358205564577E9 3", // 6
    "1.358205565208E9 10", // 7
    "1.358205565834E9 15", // 8
    "1.358205572238E9 3", // 9
    "1.358205572969E9 8", // 10
    "1.358205584581E9 3", // 11
    "1.358205586095E9 13", // 12
    "1.358205590906E9 3", // 13
    "1.358205591561E9 2", // 14
    "1.358205594481E9 5", // 15
    "1.358205605874E9 3", // 16
    "1.358205606144E9 0", // 17
    "1.358205607302E9 15", // 18
    "1.358205614199E9 -1", // 19
    "1.358205623225E9 -1", // 20
    "1.358205763101E9 15", // 21
    "1.358205779064E9 3", // 22
    "1.358205779663E9 33", // 23
    "1.358205782276E9 fe", // 24
    "1.358205790737E9 3", // 25
    "1.358205791067E9 10", // 26
    "1.358205801382E9 15" };
    Mockito.when(filereader.readAllLine(Mockito.anyString())).thenReturn(arr);
    networkTypeReader.setFileReader(filereader);
    NetworkTypeObject info = networkTypeReader.readData("/", 0, 0);
    List<NetworkType> listNetworkType = info.getNetworkTypesList();
    assertEquals(11, listNetworkType.size(), 0);
    List<NetworkBearerTypeInfo> listNetworkBearerTypeInfo = info.getNetworkTypeInfos();
    assertEquals(27, listNetworkBearerTypeInfo.size(), 0);
    assertEquals(1.358205538539E9, listNetworkBearerTypeInfo.get(0).getBeginTimestamp(), 0);
    assertEquals(1.358205801382E9, listNetworkBearerTypeInfo.get(26).getBeginTimestamp(), 0);
    assertEquals("HSPAP", listNetworkBearerTypeInfo.get(26).getNetworkType().toString());
    Mockito.when(filereader.fileExist(Mockito.anyString())).thenReturn(false);
    Mockito.when(filereader.readAllLine(Mockito.anyString())).thenReturn(arr);
    info = networkTypeReader.readData("/", 0, 0);
    assertTrue(listNetworkType != null);
    Mockito.when(filereader.fileExist(Mockito.anyString())).thenReturn(true);
    arr = new String[] { "1.358205538539E9 bd", "1.358205540396E9 15" };
    Mockito.when(filereader.readAllLine(Mockito.anyString())).thenReturn(arr);
    info = networkTypeReader.readData("/", 0, 0);
    listNetworkType = info.getNetworkTypesList();
    assertEquals(2, listNetworkType.size(), 0);
}
Also used : NetworkTypeObject(com.att.aro.core.peripheral.pojo.NetworkTypeObject) NetworkType(com.att.aro.core.peripheral.pojo.NetworkType) NetworkBearerTypeInfo(com.att.aro.core.packetanalysis.pojo.NetworkBearerTypeInfo) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Aggregations

NetworkType (com.att.aro.core.peripheral.pojo.NetworkType)6 NetworkBearerTypeInfo (com.att.aro.core.packetanalysis.pojo.NetworkBearerTypeInfo)4 BaseTest (com.att.aro.core.BaseTest)2 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)2 NetworkTypeObject (com.att.aro.core.peripheral.pojo.NetworkTypeObject)2 ArrayList (java.util.ArrayList)2 XYIntervalSeries (org.jfree.data.xy.XYIntervalSeries)2 Test (org.junit.Test)2 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)1 BatteryInfo (com.att.aro.core.peripheral.pojo.BatteryInfo)1 BluetoothInfo (com.att.aro.core.peripheral.pojo.BluetoothInfo)1 CameraInfo (com.att.aro.core.peripheral.pojo.CameraInfo)1 GpsInfo (com.att.aro.core.peripheral.pojo.GpsInfo)1 RadioInfo (com.att.aro.core.peripheral.pojo.RadioInfo)1 ScreenStateInfo (com.att.aro.core.peripheral.pojo.ScreenStateInfo)1 UserEvent (com.att.aro.core.peripheral.pojo.UserEvent)1 WifiInfo (com.att.aro.core.peripheral.pojo.WifiInfo)1 IOException (java.io.IOException)1 EnumMap (java.util.EnumMap)1 XYToolTipGenerator (org.jfree.chart.labels.XYToolTipGenerator)1