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);
}
Aggregations