1 package test.factory; 2 3 import org.testng.annotations.Factory; 4 5 /** 6 * Factory to test that setUp methods are correctly interleaved even 7 * when we use similar instances of a same test class. 8 * 9 * @author cbeust 10 */ 11 public class Factory2Test { 12 13 @Factory() createObjects()14 public Object[] createObjects() 15 { 16 return new Object[] { new Sample2(), new Sample2() }; 17 } 18 19 ppp(String s)20 private static void ppp(String s) { 21 System.out.println("[FactoryTest] " + s); 22 } 23 }