org.testng.annotations.Factory.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.testng.annotations.Factory.<init>()方法的一些代码示例,展示了Factory.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.<init>()方法的具体详情如下:
包路径:org.testng.annotations.Factory
类名称:Factory
方法名:<init>

Factory.<init>介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

@Factory(dataProvider = "featuresConfig")
public TestRegexpFunctions(FeaturesConfig featuresConfig)
{
  super(featuresConfig);
}

代码示例来源:origin: cbeust/testng

@Factory(dataProvider = "dp", dataProviderClass = StaticDataProvider.class)
 public FactoryDataProviderStaticSample(int n) {
  super(n);
 }
}

代码示例来源:origin: cbeust/testng

@Factory(dataProvider = "data-provider")
public TestClassAFiveMethodsWithFactoryUsingDataProviderAndNoDepsSample(String suiteName, String testName, String
    sleepFor, String dpVal) {
  this.suiteName = suiteName;
  this.testName = testName;
  this.sleepFor = Integer.parseInt(sleepFor);
  this.dpVal = dpVal;
}

代码示例来源:origin: cbeust/testng

@Factory
public Object[] createFixture() {
 count++;
 return new Object[] {new Object[] {new Object()}};
}

代码示例来源:origin: cbeust/testng

@TestInfo(name = "glutton")
@Factory(dataProvider = "cookie-master", dataProviderClass = DataProviderHouse.class)
public TwoFactoriesShareSameDataProviderSampleOne(String cookieName, int count) {
 this.cookieName = cookieName;
 this.count = count;
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] createObjects() {
  AbstractBaseSample test = buildTest();
  return new Object[] {test};
 }
}

代码示例来源:origin: cbeust/testng

@Factory(dataProvider = "dp")
 public Object[] init(int n) {
  return new Object[] {new SimpleTest(n)};
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public static Object[] testF() {
  List<OrderSample> result = new ArrayList<>();
  for (int i = 0; i < 5; i++) {
   result.add(new OrderSample(i));
  }
  return result.toArray();
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] create() {
  return new Object[] {new FactoryBaseSample()};
 }
}

代码示例来源:origin: cbeust/testng

@Factory(dataProvider = "dp")
 public Object[] factory(int[] array) {
  List<Object> result = new ArrayList<>();
  for (int n : array) {
   result.add(new OddSample(n));
  }

  return result.toArray();
 }
}

代码示例来源:origin: cbeust/testng

@Parameters({"factory-param"})
@Factory
public Object[] createObjects(String param) {
 assertEquals(param, "FactoryParam");
 assertFalse(isInvoked, "Should only be invoked once");
 isInvoked = true;
 return new Object[] {new FactoryTest2(42), new FactoryTest2(43)};
}

代码示例来源:origin: cbeust/testng

@Factory(indices = 1)
 public static Object[] arrayFactory() {
  return new Object[] {new ArrayFactorySample("foo"), new ArrayFactorySample("bar")};
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] createInstances() {
  return new NestedFactorySample[] {
   new NestedFactorySample(1, 0.1f), new NestedFactorySample(10, 0.5f),
  };
 }
}

代码示例来源:origin: cbeust/testng

@Factory
public static Object[] create() {
 return new Object[] {
   new SimpleTestClassPoweredByFactoryWithFailedMethod(),
   new SimpleTestClassPoweredByFactoryWithFailedMethod(),
 };
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] createTests() {
  Object[] instances = new Object[2];
  instances[0] = new FactoryClassWithFailedBeforeMethodAndMultipleInvocations();
  instances[1] = new FactoryClassWithFailedBeforeMethodAndMultipleInvocations();
  return instances;
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] factory() {
  return new Object[] {new SuiteFactoryOnceSample1Test(), new SuiteFactoryOnceSample1Test()};
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] createTests() {
  Object[] instances = new Object[2];
  instances[0] = new FactoryClassWithFailedBeforeClassMethod();
  instances[1] = new FactoryClassWithFailedBeforeClassMethod();
  return instances;
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] init() {
  return new Object[] {new TestInstanceSample(1), new TestInstanceSample(2)};
 }
}

代码示例来源:origin: cbeust/testng

@Factory
 public Object[] create() {
  return new Object[] {new InstanceDataProviderSample(), new InstanceDataProviderSample()};
 }
}

代码示例来源:origin: cbeust/testng

@Factory
public Object[] createObjects() {
 return new Object[] {
  new MySample(1), new MySample(2), new MySample(3),
 };
}

相关文章