zoukankan      html  css  js  c++  java
  • 编写Android工程里测试代码的步骤

    第一步: 写个类去继承 AndroidTestCase

    public class TestStudent extends AndroidTestCase

    并且编写一个测试的方法,

    注意,测试的方法必须是 public void , 并且方法不能够接收任何的参数信息

    1 public void testInsert(){
    2 }

    第二步: 在清单文件中添加 使用到的指令集 ,以及 使用到 的类库

      <!-- 通过包命来指定要测试的目标 应用程序  -->
        <instrumentation
            android:name="android.test.InstrumentationTestRunner"
            android:targetPackage="com.why.studentsystem" >
     </instrumentation>
    
    
    并且还需要在 application 元素下,添加 uses-library
    <!-- 使用到 这个 类库  -->
           <uses-library android:name="android.test.runner"/>

    第三步:  运行测试方法 (右键Run As  Android Junit Test)

    public void testAdd(){}
  • 相关阅读:
    mask_rcnn调用训练好的模型
    class list
    dataset prepare
    ZT笔记本配置mask_rcnn环境
    mask_rcnn参数
    TorchVisionV0.9中引入的ML模型
    犀牛 水杯练习
    模型的部分ifc
    Error log
    yolov5训练日志
  • 原文地址:https://www.cnblogs.com/wanghaoyuhappy/p/5252530.html
Copyright © 2011-2022 走看看