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

x33g5p2x  于2022-01-26 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(123)

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

Parameters.<init>介绍

暂无

代码示例

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

@Parameters("a")
 public void f(String p) {
  Assert.assertEquals(p, "Correct");
 }
}

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

@Parameters({"browsername"})
@AfterClass
public void afterClass(String browsername) {
 this.browsername = browsername;
}

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

@Parameters({"browsername"})
@BeforeClass
public void beforeClass(String browsername) {
 this.browsername = browsername;
}

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

@Parameters({"browsername"})
@BeforeClass
public void beforeClass(String browsername) {
 this.browsername = browsername;
}

代码示例来源:origin: org.testng/testng

@Test
@Parameters({ "testdata" })
public void filterOutInJectedTypesFromOptionalValuesTest(XmlTest xmlTest, @Optional("optionaltestdata") String testdata) {
 JDK15AnnotationFinder finder = new JDK15AnnotationFinder(null);
 Method curMethod = new Object() {}.getClass().getEnclosingMethod();
 FilterOutInJectedTypesResult filterOutResult = org.testng.internal.Parameters.filterOutInJectedTypesFromOptionalValues(
     curMethod.getParameterTypes(), finder.findOptionalValues(curMethod));
 Assert.assertEquals(filterOutResult.getOptionalValues()[0], "optionaltestdata");
 Assert.assertEquals(filterOutResult.getParameterTypes()[0], String.class);  
  
}

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

@Parameters({
      "hive.hadoop2.metastoreHost",
      "hive.hadoop2.metastorePort",
      "hive.hadoop2.databaseName",
      "hive.hadoop2.s3.awsAccessKey",
      "hive.hadoop2.s3.awsSecretKey",
      "hive.hadoop2.s3.writableBucket"})
  @BeforeClass
  public void setup(String host, int port, String databaseName, String awsAccessKey, String awsSecretKey, String writableBucket)
  {
    super.setup(host, port, databaseName, awsAccessKey, awsSecretKey, writableBucket, false);
  }
}

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

@Parameters({ "first-name" })
@Test(groups = { "singleString"})
public void testSingleString(String firstName) {
 Assert.assertEquals(firstName, "Cedric");
}

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

@Parameters({ "parameter" })
 @Test(groups = { "inner-group" })
 public void innerDeprecated(String s) {
  assert "in".equals(s)
   : "Expected in got " + s;
 }
}

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

@Parameters({"param"})
 @Test
 public void testMethod(String param) {
  Assert.assertEquals(m_param, param);
 }
}

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

@BeforeMethod
@Parameters("parameter")
public static void beforeMethod(String parameter) {
 Assert.assertEquals(parameter, "parameter value");
}

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

@Parameters({"browsername"})
@AfterClass
public void afterClass(String browser) {
 browsers.add(browser);
}

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

@Parameters({
      "hive.hadoop2.metastoreHost",
      "hive.hadoop2.metastorePort",
      "hive.hadoop2.databaseName",
      "hive.hadoop2.s3.awsAccessKey",
      "hive.hadoop2.s3.awsSecretKey",
      "hive.hadoop2.s3.writableBucket"})
  @BeforeClass
  public void setup(String host, int port, String databaseName, String awsAccessKey, String awsSecretKey, String writableBucket)
  {
    super.setup(host, port, databaseName, awsAccessKey, awsSecretKey, writableBucket, true);
  }
}

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

@Test
 @Parameters({"notnull", "nullvalue"})
 public void nullParameter(String notNull, int mustBeNull) {
  Assert.assertNotNull(notNull, "not null parameter expected");
  Assert.assertNull(mustBeNull, "null parameter expected");
 }
}

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

@Test
  @Parameters({"parameter1", "parameter2", "parameter3", "parameter4"})
  public void inheritedParameter(String p1, String p2, String p3, String p4) {
   Assert.assertEquals(p1, "p1");
   Assert.assertEquals(p2, "c3p2");
   Assert.assertEquals(p3, "c2p3");
   Assert.assertEquals(p4, "c3p4");
  }
}

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

@Parameters({ "expected-calls" })
 @Test
 public void testCheckCount(String expectedCalls) {
  int i = Integer.valueOf(expectedCalls);
  int numCalls =  CountCalls.getNumCalls();
  Assert.assertEquals(numCalls, i);
 }
}

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

@Parameters({"param"})
@BeforeTest
public void testInit(String param) {
 m_param = param;
}

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

@Parameters({"browser"})
@BeforeTest
public void setUpTest(String browser, ITestContext context) {
  this.browser = browser;
  this.context = context;
}

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

@Test
  @Parameters({"parameter1", "parameter2", "parameter3", "parameter4"})
  public void inheritedParameter(String p1, String p2, String p3, @Optional("abc")String p4) {
   Assert.assertEquals(p1, "p1");
   Assert.assertEquals(p2, "c2p2");
   Assert.assertEquals(p3, "c2p3");
   Assert.assertEquals(p4, "abc");
  }
}

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

@Parameters({"hive.hadoop2.metastoreHost", "hive.hadoop2.metastorePort", "hive.hadoop2.databaseName", "hive.hadoop2.timeZone"})
  @BeforeClass
  public void initialize(String host, int port, String databaseName, String timeZone)
      throws UnknownHostException
  {
    String hadoopMasterIp = System.getProperty("hadoop-master-ip");
    if (hadoopMasterIp != null) {
      // Even though Hadoop is accessed by proxy, Hadoop still tries to resolve hadoop-master
      // (e.g: in: NameNodeProxies.createProxy)
      // This adds a static resolution for hadoop-master to docker container internal ip
      NetUtils.addStaticResolution("hadoop-master", hadoopMasterIp);
    }

    setup(host, port, databaseName, timeZone);
  }
}

代码示例来源: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)};
}

相关文章