Skip to content

Commit

Permalink
[alibaba#1815]fix unit test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
zongtanghu committed Jun 3, 2020
1 parent 09752e3 commit 94c41e1
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@ public class LifeCycleClassTest {
@Before
public void setup() throws Exception{
this.res = new Resource(0);
Assert.assertEquals(this.res.getCounter(), 0);
Assert.assertEquals(0, this.res.getCounter());
}

@After
public void cleanup() throws Exception{
this.res.destroy();
Assert.assertEquals(this.res.getCounter(), 0);
Assert.assertEquals(0, this.res.getCounter());
}

@Test
public void testResource_LifeCycleMethod() throws Exception{
this.res.increament();
Assert.assertEquals(this.res.getCounter(), 1);
Assert.assertEquals(1, this.res.getCounter());
this.res.increament();
Assert.assertEquals(this.res.getCounter(), 2);
Assert.assertEquals(2, this.res.getCounter());
this.res.increament();
Assert.assertEquals(this.res.getCounter(), 3);
Assert.assertEquals(3, this.res.getCounter());
this.res.increament();
Assert.assertEquals(this.res.getCounter(), 4);
Assert.assertEquals(4, this.res.getCounter());
}

class Resource implements LifeCycle {
Expand Down

0 comments on commit 94c41e1

Please sign in to comment.