Why Does Poeple Import Org.junit.Assert Statically

Why Does Poeple Import Org.junit.Assert Statically


  • 20 Jan, 2012

    Poeple use the static import statement on org.junit.Assert to save coding time on calling its assetion methods. With a normal import statement, assertion method names must qualified with the class name like this:import org.junit.Assert; ... Assert.assertEquals(12, message.length());With a static import statement, assertion method names can be used directly like this:import static org.junit.Assert.*;... assertEquals(12, message.length());

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.