发表于: 2017-11-12 21:54:59
2 899
今天学习的内容
今天学习了Junit,并写了一个单元测试,代码如下:
public class Bmt {
private String name;
private String sex;
private int age;
private String address;
private int qq;
public Bmt(String name,String sex,int age, String address,int qq){
this.name=name;
this.sex=sex;
this.age=age;
this.address=address;
this.qq=qq;
}
public String getName(){return name;}
public void setName(String name){ this.name=name;}
public String getSex(){return sex;}
public void setSex(String sex){ this.sex=sex;}
public int getAge(){return age;}
public void setAge(int age) {this.age = age;}
public String getAddress() {return address;}
public void setAddress(String address) {this.address = address;}
public int getQq() {return qq;}
public void setQq(int qq) {this.qq = qq;}
public static void main(String[] args){}
}
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class BmtTest {
static Bmt bmt;
@Before
public void setup() throws Exception{
bmt = new Bmt(4,"段正淳","男",40,"大理",555555555);
}
@After
public void tearDown() throws Exception{
System.out.println(bmt.getName()+"\n"+bmt.getSex()+"\n"+bmt.getAge()+"\n"+bmt.getAddress()+"\n"+bmt.getQq());
}
@Test
public void getName() throws Exception{}
@Test
public void setName() throws Exception{}
@Test
public void getSex() throws Exception{}
@Test
public void setSex() throws Exception{}
@Test
public void getAge() throws Exception{}
@Test
public void setAge() throws Exception{}
@Test
public void getAddress() throws Exception{}
@Test
public void setAddress() throws Exception{}
@Test
public void getQq() throws Exception{}
@Test
public void setQq() throws Exception{}
@Test
public static void main(String[] args){}
}
复习了一遍JDBCTemplate,spring和mybatis,开了周会,本周完成任务1步骤17,等于跨过了第一个难点,但是因为这里面知识点太多,很多内容只知其形式,不知其内涵,所以有时间还是需要多补一下这方面的基础,下周目标把任务一做完.
遇到的问题
写测试单元没遇到问题,一步一步来的,然后回顾了一下本周学习的内容.
今天的收获
完成了任务一步骤17,写了一个测试单元
明天的计划
完成任务一步骤21
任务进度:任务1步骤18
任务开始时间:10月28日
任务结束时间:11月19日
评论