添加测试数据

This commit is contained in:
liujing
2021-08-02 21:08:20 +08:00
parent e6d3f1e59b
commit 3ada9738ff
3 changed files with 112 additions and 24 deletions

View File

@@ -224,6 +224,8 @@ public class CommonUtils {
case TelephonyManager.NETWORK_TYPE_LTE:
name = "4G";
break;
// case TelephonyManager.NETWORK_TYPE_NR:
// name = "5G";
case TelephonyManager.NETWORK_TYPE_UNKNOWN:
name = "UNKNOWN";
break;

View File

@@ -1,7 +1,5 @@
package com.mogo.module.check.model;
import com.mogo.commons.data.BaseData;
import java.io.Serializable;
import java.util.ArrayList;
@@ -11,17 +9,12 @@ import java.util.ArrayList;
* @since: 7/28/21
*/
public class CheckItemInfo implements Serializable {
private TypeEnum type;
private String title;
private ArrayList itemList;
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
//项目指标描述 如:版本升级/存在风险等
private String value;
private DetailItem itemList;
//是否存在异常
private boolean usual;
public String getTitle() {
return title;
@@ -31,15 +24,53 @@ public class CheckItemInfo implements Serializable {
this.title = title;
}
public ArrayList getItemList() {
public DetailItem getItemList() {
return itemList;
}
public void setItemList(ArrayList itemList) {
public void setItemList(DetailItem itemList) {
this.itemList = itemList;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public boolean isUsual() {
return usual;
}
public void setUsual(boolean unusual) {
this.usual = unusual;
}
public static class DetailItem implements Serializable {
private String title;
private String value;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}
/**
* 系统检测-鹰眼
*/
@@ -164,8 +195,3 @@ class HardwareForADAS implements Serializable {
}
interface TypeEnum {
String TITLE_TYPE = "title_type";
String LIST_TYPE = "list_type";
String IMAGE_TYPE = "image_type";
}

View File

@@ -91,20 +91,38 @@ public class CheckActivity extends AppCompatActivity {
}
/**
* 版本检测
* **************************************************************************************版本检测
*/
public void versionCheckResult() {
ArrayList arrayList = new ArrayList(2);
//adas
//鹰眼
String verCodeStr = CommonUtils.getVersionName(context, true);
Log.d(TAG, "版本检测结果:鹰眼" + verCodeStr);
//测试数据
CheckItemInfo itemInfo = new CheckItemInfo();
itemInfo.setUsual(true);
itemInfo.setTitle("自动驾驶升级到版本3.1.2.7");
if ("不是最新版本" != null) {
itemInfo.setValue("版本升级");
}
arrayList.add(itemInfo);
CheckItemInfo yingyan = new CheckItemInfo();
yingyan.setUsual(true);
yingyan.setTitle("鹰眼版本3.2");
yingyan.setValue("最新版本 无风险");
arrayList.add(yingyan);
dataArrayList.add(arrayList);
}
/**
* 系统检测
* **************************************************************************************系统检测
*/
public void systemCheckResult() {
ArrayList arrayList = new ArrayList();
//网络
netStatus();
//电量
@@ -113,12 +131,53 @@ public class CheckActivity extends AppCompatActivity {
double cpu = CommonUtils.getCPU(packageName);
//内存占比
double memory = CommonUtils.getMemory(packageName);
//自动驾驶测试数据
CheckItemInfo itemInfo = new CheckItemInfo();
itemInfo.setTitle("自动驾驶系统");
itemInfo.setUsual(false);
itemInfo.setValue("存在风险");
CheckItemInfo.DetailItem item = new CheckItemInfo.DetailItem();
item.setTitle("工控机链接状态");
item.setValue("断开");
itemInfo.setItemList(item);
arrayList.add(itemInfo);
//鹰眼测试数据
CheckItemInfo yingyan = new CheckItemInfo();
yingyan.setTitle("鹰眼软件");
yingyan.setUsual(false);
yingyan.setValue("存在风险");
CheckItemInfo.DetailItem netItem = new CheckItemInfo.DetailItem();
netItem.setTitle("网络状态");
netItem.setValue(mSignalStrength);
itemInfo.setItemList(netItem);
CheckItemInfo.DetailItem batteryItem = new CheckItemInfo.DetailItem();
batteryItem.setTitle("电池状态");
batteryItem.setValue(String.valueOf(battery));
itemInfo.setItemList(batteryItem);
CheckItemInfo.DetailItem cpuItem = new CheckItemInfo.DetailItem();
cpuItem.setTitle("CPU占比");
cpuItem.setValue(String.valueOf(cpu));
itemInfo.setItemList(cpuItem);
CheckItemInfo.DetailItem memoryItem = new CheckItemInfo.DetailItem();
memoryItem.setTitle("内存占比");
memoryItem.setValue(String.valueOf(memory));
itemInfo.setItemList(cpuItem);
arrayList.add(yingyan);
}
/**
* 网络
*/
public void netStatus() {
public String netStatus() {
//网络类型
String networkType = CommonUtils.getNetworkType(context);
//网络强度
@@ -128,11 +187,12 @@ public class CheckActivity extends AppCompatActivity {
} else {
Log.d(TAG, "网络未连接");
}
return mSignalStrength;
}
/**
* 软件测试
* **************************************************************************************软件测试
* 时延
*/
public void software() {
@@ -150,7 +210,7 @@ public class CheckActivity extends AppCompatActivity {
}
/**
* 硬件测试 FROM ADAS
* **************************************************************************************硬件测试 FROM ADAS
*/
public void hardware() {