58 lines
1.5 KiB
Java
58 lines
1.5 KiB
Java
import com.google.gson.Gson;
|
|
import com.google.gson.internal.LinkedTreeMap;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.sl.house_property.MyApplication;
|
|
import com.sl.house_property.R;
|
|
import com.squareup.picasso.Picasso;
|
|
|
|
import org.json.JSONObject;
|
|
import org.junit.After;
|
|
import org.junit.Before;
|
|
import org.junit.Test;
|
|
|
|
import java.lang.reflect.Type;
|
|
import java.util.ArrayList;
|
|
|
|
import adapter.BaseRecycleViewAdapter;
|
|
import entity.DiscoveryListEntity;
|
|
import tools.PicassoRoundTransform;
|
|
import utils.GetJsonDataUtil;
|
|
|
|
/**
|
|
* Time: 2021/2/19
|
|
* Author: jianbo
|
|
* Description:
|
|
*/
|
|
|
|
public class DateUtilsTest {
|
|
|
|
@Before//注解
|
|
public void setUp() throws Exception {
|
|
|
|
System.out.println("测试开始执行的代码在这里执行,可做初始化操作");
|
|
}
|
|
|
|
@After
|
|
public void tearDown() throws Exception {
|
|
System.out.println("测试结束后的执行代码在这里执行,可做释放资源操作");
|
|
}
|
|
|
|
|
|
/**
|
|
* 单元测试 测试 DateUtils.timeStampToString这个时间戳转换成日期时间字符串的方法是否通过
|
|
*/
|
|
@Test
|
|
public void timeStampToString() {
|
|
|
|
String JsonData = new GetJsonDataUtil().getJson(MyApplication.getContext(), "controlStatus.json");//获取assets目录下的json文件数据
|
|
Type type = new TypeToken<ArrayList<DiscoveryListEntity>>() {
|
|
}.getType();
|
|
// ArrayList<DiscoveryListEntity> o = new Gson().fromJson(JsonData, type);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|