2013年6月13日

Junit 测试 简明教程

摘要: 类中方法出现的情况无bug的方法出现bug的方法未写好的方法超时的方法单元测试创建步骤1. 创建一个测试对象2. 注意下面的注解@Before@Test(expected = ArithmeticException.class)@Test(timeout=1000)@Ignore("xxxxxxxxx")@After3. assertEquals(期待的结果, 实际的结果);可选的其他方案一、import static org.junit.Assert.assertEquals;import org.junit.Test;import org.junit.runner.Ru 阅读全文

posted @ 2013-06-13 22:01 Knuth_档案 阅读(223) 评论(0) 推荐(0) 编辑

Map接口

摘要: Map 模拟数学上 函数 概念HashMap TreeMap LinkedHashMap1. 支持键、值、键值对进行迭代2. 迭代期间安全删除项目3. put get containsKey containsValue size isEmptykeySet entrySet values 三种遍历方式中选择哪种方式比较好呢?(写法按照下面图片的写法来做)HashMap 建议选用keySettreeMap 建议选用treeSet 阅读全文

posted @ 2013-06-13 15:13 Knuth_档案 阅读(123) 评论(0) 推荐(0) 编辑

导航