Search in sources :

Example 6 with AlarmInfo

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

the class AlarmInfoReaderImplTest method readData_BadData.

@Test
public void readData_BadData() throws IOException {
    Mockito.when(filereader.readAllLine(Mockito.anyString())).thenReturn(new String[] { "<6>[    0.000z00] Initializing cgroup subsys cpu", "<6>[ 1770.877611] alarm_timer_triggered type 0 at 302m2491z4374", "<MCLL>[    0.000000] CPU: ARMv7 Processor [412fc082] revision 2 (ARMv7), cr=10c53c7d" });
    Date traceDateTime = new Date();
    Mockito.when(filereader.fileExist(traceFolder + Util.FILE_SEPARATOR + TraceDataConst.FileName.KERNEL_LOG_FILE)).thenReturn(true);
    List<AlarmInfo> list = reader.readData(traceFolder, 123, 124, traceDateTime);
    assertTrue(list.size() == 0);
}
Also used : AlarmInfo(com.att.aro.core.peripheral.pojo.AlarmInfo) Date(java.util.Date) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 7 with AlarmInfo

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

the class AlarmInfoReaderImplTest method readData.

@Test
public void readData() throws IOException {
    // reader = context.getBean(AlarmInfoReaderImpl.class);
    // IFileManager filereader = Mockito.mock(IFileManager.class);
    String[] arr = getAlarmData();
    Mockito.when(filereader.readAllLine(Mockito.anyString())).thenReturn(arr);
    Date traceDateTime = new Date();
    Mockito.when(filereader.fileExist(traceFolder + Util.FILE_SEPARATOR + TraceDataConst.FileName.KERNEL_LOG_FILE)).thenReturn(true);
    List<AlarmInfo> list = reader.readData(traceFolder, 123, 124, traceDateTime);
    assertTrue(list.size() > 0);
}
Also used : AlarmInfo(com.att.aro.core.peripheral.pojo.AlarmInfo) Date(java.util.Date) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Aggregations

AlarmInfo (com.att.aro.core.peripheral.pojo.AlarmInfo)7 Date (java.util.Date)5 BaseTest (com.att.aro.core.BaseTest)4 Test (org.junit.Test)4 AlarmType (com.att.aro.core.peripheral.pojo.AlarmInfo.AlarmType)2 IOException (java.io.IOException)2 ScheduledAlarmInfo (com.att.aro.core.packetanalysis.pojo.ScheduledAlarmInfo)1 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)1 TraceResultType (com.att.aro.core.packetanalysis.pojo.TraceResultType)1 ThermalStatusReaderImpl (com.att.aro.core.peripheral.impl.ThermalStatusReaderImpl)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 CollectOptions (com.att.aro.core.peripheral.pojo.CollectOptions)1 CpuActivityList (com.att.aro.core.peripheral.pojo.CpuActivityList)1 GpsInfo (com.att.aro.core.peripheral.pojo.GpsInfo)1 LocationEvent (com.att.aro.core.peripheral.pojo.LocationEvent)1 NetworkTypeObject (com.att.aro.core.peripheral.pojo.NetworkTypeObject)1 RadioInfo (com.att.aro.core.peripheral.pojo.RadioInfo)1 ScreenStateInfo (com.att.aro.core.peripheral.pojo.ScreenStateInfo)1