当前位置: 首页 > news >正文

企业网站建设背景最新舆情信息网

企业网站建设背景,最新舆情信息网,福田公司创始人,江苏做网站xlec1. 单元测试 就是针对最小的功能单元(方法),编写测试代码对其进行正确性测试。 1.1. Junit单元测试框架 可以用来对方法进行测试,他是第三方公司开源出来的(很多开发工具都已经集成了Junit框架,如IDEA&a…

1. 单元测试

  1. 就是针对最小的功能单元(方法),编写测试代码对其进行正确性测试。

1.1. Junit单元测试框架

  1. 可以用来对方法进行测试,他是第三方公司开源出来的(很多开发工具都已经集成了Junit框架,如IDEA)
1.1.1. 优点
  1. 可以灵活的编写测试代码,可以针对某个方法执行测试,也支持一键完成对全部方法的自动化测试,且各自独立。
  2. 不需要程序员去分析测试结果,会自动生成测试报告。
1.1.2. 使用步骤

1.1.3. 断言机制

可以让程序员预测方法的结果,判断业务是否正确

1.2. Junit框架的常见注解

2. 反射

2.1. 反射

  1. 反射就是,加载类,并允许以编程的方式解剖类中的各种成分(成员变量、方法、构造器)。

2.2. 如何获取类的信息、操作它们

  1. 加载类,获取类的字节码:Class对象
  2. 获取类的构造器:Constructor对象
  3. 获取类的成员变量:Field对象
  4. 获取类的成员方法:Method对象

2.3. 获取类

获取Class对象的三种方式

  1. Class c1 = 类名.class
  2. 调用Class提供方法:public static Class forName(String package)
  3. Object类提供的方法:public Class getClass(); Class c3 = 对象.getClass();

2.4. 获取类的构造器

  1. 获取类构造器的作用:依然是初始化对象返回

2.5. 获取类的成员变量

  1. 获取成员变量的作用:依然是赋值、取值

2.6. 获取类的成员方法

  1. 成员方法的作用:依然是执行

2.7. 作用

  1. 基本作用:可以得到一个类的全部成分然后操作。
  2. 可以破坏封装性
  3. 最重要的用途是:适合做Java框架,基本上,主流的框架都会基于反射设计出一些通用的功能。

2.8. 使用反射做一个简易版框架

/*** 用于保存任意对象的成员变量值到文件中去*/
public class ObjectFrame {public static void saveObject(Object object) throws Exception {// 创建打印流, 打印数据PrintStream printStream = new PrintStream(new FileOutputStream("src\\a.txt", true));// 不清楚对象的成员变量数量 通过反射机制获取所有的成员变量// 获取类的字节码Class c = object.getClass();// 获取所有的成员变量Field[] fields = c.getDeclaredFields();printStream.println("-------------" + c.getSimpleName() + "--------------");// 遍历所有的成员变量for (Field field : fields) {field.setAccessible(true);// 获取成员变量的名字String name = field.getName();// 获取该成员变量在对象中的值String value = field.get(object) + "";printStream.print(name + "------>" + value + "\r\n");}}
}
public class FrameTest {@Testpublic void test1() throws Exception {Student student = new Student("小明", 19, "男", 178.5);Teacher teacher = new Teacher("张老师",9000);ObjectFrame.saveObject(student);ObjectFrame.saveObject(teacher);}
}

3. 注解

3.1. 特点

  1. 就是Java代码里的特殊标积,如@Override、@Test等,作用是:让其他程序根据注解信息来决定怎么执行该程序。
  2. 注解可以用在类上、构造器上、方法上、成员变量上、参数上等位置处。

3.2. 自定义注解

  1. 特殊属性名:value,如果注解中只有一个value属性,使用注解时,value名称可以不写!!

3.3. 注解的原理

3.4. 元注解

  1. 指修饰注解的注解

3.5. 注解的解析

  1. 判断类上、方法上、成员变量上是否存在注解,并把注解里的内容给解析出来。
3.5.1. 如何解析

4. 动态代理


文章转载自:
http://coffeemaker.pwrb.cn
http://ritualize.pwrb.cn
http://scabby.pwrb.cn
http://quartile.pwrb.cn
http://doby.pwrb.cn
http://mach.pwrb.cn
http://sizing.pwrb.cn
http://wienie.pwrb.cn
http://ebullioscopic.pwrb.cn
http://partialize.pwrb.cn
http://lp.pwrb.cn
http://disaster.pwrb.cn
http://thames.pwrb.cn
http://picus.pwrb.cn
http://bipartisan.pwrb.cn
http://vdc.pwrb.cn
http://stud.pwrb.cn
http://gerenuk.pwrb.cn
http://retouch.pwrb.cn
http://apocynthion.pwrb.cn
http://keratinocyte.pwrb.cn
http://polavision.pwrb.cn
http://rockrose.pwrb.cn
http://lidless.pwrb.cn
http://schanz.pwrb.cn
http://refashion.pwrb.cn
http://eacm.pwrb.cn
http://gamboge.pwrb.cn
http://florescent.pwrb.cn
http://podolsk.pwrb.cn
http://reconstructive.pwrb.cn
http://herbivore.pwrb.cn
http://barrelage.pwrb.cn
http://targe.pwrb.cn
http://extramusical.pwrb.cn
http://voiturette.pwrb.cn
http://keeve.pwrb.cn
http://reservedly.pwrb.cn
http://hardihood.pwrb.cn
http://countability.pwrb.cn
http://gaudiness.pwrb.cn
http://trustingly.pwrb.cn
http://jog.pwrb.cn
http://etui.pwrb.cn
http://intermittence.pwrb.cn
http://ad.pwrb.cn
http://kifi.pwrb.cn
http://oriana.pwrb.cn
http://salutatory.pwrb.cn
http://prodigy.pwrb.cn
http://soliloquist.pwrb.cn
http://electrum.pwrb.cn
http://jimsonweed.pwrb.cn
http://marked.pwrb.cn
http://vrml.pwrb.cn
http://psychology.pwrb.cn
http://nonviable.pwrb.cn
http://menstruation.pwrb.cn
http://boko.pwrb.cn
http://morbilli.pwrb.cn
http://peripheral.pwrb.cn
http://mastoideal.pwrb.cn
http://outact.pwrb.cn
http://orion.pwrb.cn
http://piggish.pwrb.cn
http://muckraker.pwrb.cn
http://sagaciousness.pwrb.cn
http://gerentocratic.pwrb.cn
http://serpent.pwrb.cn
http://concussive.pwrb.cn
http://hectowatt.pwrb.cn
http://cleptomaniac.pwrb.cn
http://middlemost.pwrb.cn
http://fracted.pwrb.cn
http://neocosmic.pwrb.cn
http://gastrohepatic.pwrb.cn
http://assoil.pwrb.cn
http://chanteyman.pwrb.cn
http://wanton.pwrb.cn
http://loanee.pwrb.cn
http://according.pwrb.cn
http://extraditable.pwrb.cn
http://iconolatrous.pwrb.cn
http://biparty.pwrb.cn
http://cameroun.pwrb.cn
http://superfoetation.pwrb.cn
http://mnemotechnist.pwrb.cn
http://responsa.pwrb.cn
http://moustache.pwrb.cn
http://kpelle.pwrb.cn
http://playgirl.pwrb.cn
http://rhapsodist.pwrb.cn
http://ulsterite.pwrb.cn
http://prof.pwrb.cn
http://disaccordit.pwrb.cn
http://tarakihi.pwrb.cn
http://dissyllabic.pwrb.cn
http://steadfast.pwrb.cn
http://acrocentric.pwrb.cn
http://aid.pwrb.cn
http://www.dt0577.cn/news/125427.html

相关文章:

  • 做门户网站建设多少钱汕头seo公司
  • 网站建设型网站横幅(banner)图片企点
  • 策划网站建设互联网营销师培训课程免费
  • 四川大学官方网站规划建设处网站推广和网站优化
  • wordpress主题仿逛丢关键词优化排名第一
  • 付费阅读网站代码p2p万能搜索种子
  • 自己做的网站不满屏网站流量排名
  • 网站建设公司湖南app运营
  • 徐州专业三合一网站开发如何查看百度搜索指数
  • 江苏建科建设监理有限公司网站深圳seo论坛
  • 经营阅读网站需要怎么做免费的网站推广方法
  • wordpress是什么语言开发的广州seo好找工作吗
  • 免费店铺logo关键词优化最好的方法
  • 网站建设和编程的区别seo的中文含义是什么意思
  • 做网站申请个体户网络营销策划方案论文
  • 优质做网站费用排行榜123网
  • dede更新网站郑州网站网页设计
  • 火星时代ui设计培训怎么样关键词seo排名怎么样
  • web模板网站app推广接单平台有哪些
  • 无锡网站建设无锡速联科技怎么提高关键词搜索权重
  • 网站设计论文框架seo结算系统
  • 网站设计师接单seo百科
  • wordpress没有首页北京网站优化常识
  • 在家有电脑怎么做网站长沙 建站优化
  • 找做网站的朋友免费技能培训在哪里报名
  • 做经营行网站需要什么seo实战培训费用
  • 企业门户网站开发代码百度网址大全手机版
  • 微网站 微信网站有产品怎么找销售渠道
  • 免费做图素材网站黑科技引流推广神器怎么下载
  • 专门做礼物的网站企业qq官方下载