Home | History | Annotate | Download | only in junit
      1 package test.junit;
      2 
      3 import org.testng.Assert;
      4 
      5 import java.io.Serializable;
      6 
      7 import junit.framework.TestCase;
      8 
      9 public class SetNameTest extends TestCase implements Serializable {
     10   public static int m_ctorCount = 0;
     11 
     12   public SetNameTest() {
     13     ppp("CTOR");
     14     m_ctorCount++;
     15   }
     16 
     17   @Override
     18   public void setName(String name) {
     19     ppp("SETNAME " + name);
     20     super.setName(name);
     21   }
     22 
     23   public void testFoo() {
     24     Assert.assertEquals("testFoo", getName());
     25     ppp("FOO");
     26   }
     27 
     28   public void testBar() {
     29     Assert.assertEquals("testBar", getName());
     30     ppp("BAR");
     31   }
     32 
     33   private void ppp(String string) {
     34     if (false) {
     35       System.out.println("[FooBarTest#" + hashCode() + "] " + string);
     36     }
     37   }
     38 }