下面给大家分享的是一个java junit单元测试实例,一起来了解一下吧,希望下面的java实例可以对你有所帮助呢。
首先的话,创建一个java工程,在工程当中创建一个被单元测试的Student数据类。package com.phicomme.hu;
public class Student
{
private String name;
private String sex;
private int high;
private int age;
private String school;
public Student(String name, String sex, int high, int age, String school)
{
this.name = name;
this.sex = sex;
this.high = high;
this.age = age;
this.school = school;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getSex()
{
return sex;
}
public void setSex(String sex)
{
th