【Java】-NO.14.Java.4.Java.1.001-【Java JUnit 5 】-

1.0.0 Summary

Tittle:【Java】-NO.14.Java.4.Java.1.001-【Java JUnit 5 】-

Style:Java

Series:JUnit

Since:2017-05-17

End:....

Total Hours:...

Degree Of Diffculty:2

Degree Of Mastery:2

Practical Level:2

Desired Goal:2

Archieve Goal:....

Gerneral Evaluation:...

Writer:kingdelee

Related Links:

http://www.cnblogs.com/kingdelee/

1.1.0 

@BeforeEach and @BeforeAll

Set<Integer> s1;
Set<Integer> s2;
Set<Integer> result;


@BeforeEach public void buildPreDate() { System.out.println("public void buildPreDate()"); s1 = new HashSet<>(); s1.add(1); s1.add(2); s1.add(3); s2 = new HashSet<>(); s2.add(2); s2.add(3); s2.add(4); } @BeforeAll public static void buildPreDateByStatic() { System.out.println("public static void buildPreDateByStatic()"); } /** * 并集 */ @Test public void t1() { Set<Integer> union = union(s1, s2); System.out.println(union); }

output:

public static void buildPreDateByStatic()
public void buildPreDate()
[1, 2, 3, 4]

  

  

猜你喜欢

转载自www.cnblogs.com/kingdelee/p/6869696.html