当前位置: 首页>>代码示例>>Java>>正文


Java Reporter.log方法代码示例

本文整理汇总了Java中org.testng.Reporter.log方法的典型用法代码示例。如果您正苦于以下问题:Java Reporter.log方法的具体用法?Java Reporter.log怎么用?Java Reporter.log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.testng.Reporter的用法示例。


在下文中一共展示了Reporter.log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyInjectedRawTokenStandard

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI,
    description = "Verify that the injected raw token claim using @Claim(standard) is as expected")
public void verifyInjectedRawTokenStandard() throws Exception {
    Reporter.log("Begin verifyInjectedRawTokenStandard\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedRawTokenStandard";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.raw_token.name(), token)
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:ClaimValueInjectionTest.java

示例2: verifyInjectedCustomDouble2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_PROVIDER,
    description = "Verify that the injected customDouble claim is as expected")
public void verifyInjectedCustomDouble2() throws Exception {
    Reporter.log("Begin verifyInjectedCustomDouble\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedCustomDouble";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam("value", 3.141592653589793)
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:ProviderInjectionTest.java

示例3: verifyInjectedAuthTime

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_JSON,
    description = "Verify that the injected raw token claim is as expected")
public void verifyInjectedAuthTime() throws Exception {
    Reporter.log("Begin verifyInjectedAuthTime\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedAuthTime";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:18,代码来源:JsonValueInjectionTest.java

示例4: verifyExpiration

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_JWT,
        description = "Verify that the exp claim is as expected")
public void verifyExpiration() throws Exception {
    Reporter.log("Begin verifyExpiration\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyExpiration";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
            .target(uri)
            .queryParam(Claims.exp.name(), expClaim)
            .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:RequiredClaimsTest.java

示例5: verifyInjectedOptionalSubject2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_PROVIDER,
    description = "Verify that the injected sub claim is as expected")
public void verifyInjectedOptionalSubject2() throws Exception {
    Reporter.log("Begin verifyInjectedOptionalSubject\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedOptionalSubject";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.sub.name(), "24400320")
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:ProviderInjectionTest.java

示例6: verifyInjectedIssuedAt2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_JSON,
    description = "Verify that the injected iat claim is as expected from Token2")
public void verifyInjectedIssuedAt2() throws Exception {
    Reporter.log("Begin verifyInjectedIssuedAt2\n");
    HashMap<String, Long> timeClaims = new HashMap<>();
    String token2 = TokenUtils.generateTokenString("/Token2.json", null, timeClaims);
    Long iatClaim = timeClaims.get(Claims.auth_time.name());
    Long authTimeClaim = timeClaims.get(Claims.auth_time.name());
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedIssuedAt";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.iat.name(), iatClaim)
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token2).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:23,代码来源:JsonValueInjectionTest.java

示例7: verifyIssuerClaim2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_PROVIDER,
    description = "Verify that the injected token issuer claim is as expected")
public void verifyIssuerClaim2() throws Exception {
    Reporter.log("Begin verifyIssuerClaim");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedIssuer";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.iss.name(), TCKConstants.TEST_ISSUER)
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:ProviderInjectionTest.java

示例8: verifyInjectedOptionalAuthTime2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_PROVIDER,
    description = "Verify that the injected raw token claim is as expected")
public void verifyInjectedOptionalAuthTime2() throws Exception {
    Reporter.log("Begin verifyInjectedOptionalAuthTime\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedOptionalAuthTime";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:18,代码来源:ProviderInjectionTest.java

示例9: verifyInjectedUPN

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_PROVIDER,
    description = "Verify that the injected upn claim is as expected")
public void verifyInjectedUPN() throws Exception {
    Reporter.log("Begin verifyInjectedUPN\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedUPN";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.upn.name(), "[email protected]")
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:PrimitiveInjectionTest.java

示例10: verifyInjectedCustomString

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_JSON,
    description = "Verify that the injected customString claim is as expected")
public void verifyInjectedCustomString() throws Exception {
    Reporter.log("Begin verifyInjectedCustomString\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedCustomString";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam("value", "customStringValue")
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:JsonValueInjectionTest.java

示例11: verifyInjectedAudience2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_CDI_PROVIDER,
    description = "Verify that the injected aud claim is as expected")
public void verifyInjectedAudience2() throws Exception {
    Reporter.log("Begin verifyInjectedAudience\n");
    String uri = baseURL.toExternalForm() + "/endp/verifyInjectedAudience";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam(Claims.aud.name(), "s6BhdRkqt3")
        .queryParam(Claims.auth_time.name(), authTimeClaim);
    Response response = echoEndpointTarget.request(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, "Bearer " + token).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String replyString = response.readEntity(String.class);
    JsonReader jsonReader = Json.createReader(new StringReader(replyString));
    JsonObject reply = jsonReader.readObject();
    Reporter.log(reply.toString());
    Assert.assertTrue(reply.getBoolean("pass"), reply.getString("msg"));
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:19,代码来源:ProviderInjectionTest.java

示例12: callHeartbeat

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_JAXRS,
    description = "Validate a request without an MP-JWT to unsecured endpoint has HTTP_OK with expected response")
public void callHeartbeat() throws Exception {
    Reporter.log("callHeartbeat, expect HTTP_OK");
    String uri = baseURL.toExternalForm() + "/endp/heartbeat";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam("input", "hello")
        ;
    Response response = echoEndpointTarget.request(TEXT_PLAIN).get();
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_OK);
    String reply = response.readEntity(String.class);
    Assert.assertTrue(reply.startsWith("Heartbeat:"), "Saw Heartbeat: ...");
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:16,代码来源:RolesAllowedTest.java

示例13: echoWithToken2

import org.testng.Reporter; //导入方法依赖的package包/类
@RunAsClient
@Test(groups = TEST_GROUP_JAXRS, description = "Validate a request with MP-JWT Token2 calling echo fails with HTTP_FORBIDDEN")
public void echoWithToken2() throws Exception {
    Reporter.log("echoWithToken2, expect HTTP_FORBIDDEN");
    String token2 = TokenUtils.generateTokenString("/Token2.json");

    String uri = baseURL.toExternalForm() + "/endp/echo";
    WebTarget echoEndpointTarget = ClientBuilder.newClient()
        .target(uri)
        .queryParam("input", "hello")
        ;
    Response response = echoEndpointTarget.request(TEXT_PLAIN).header(HttpHeaders.AUTHORIZATION, "Bearer "+token2).get();
    String reply = response.readEntity(String.class);
    Assert.assertEquals(response.getStatus(), HttpURLConnection.HTTP_FORBIDDEN);
}
 
开发者ID:eclipse,项目名称:microprofile-jwt-auth,代码行数:16,代码来源:RolesAllowedTest.java

示例14: retry

import org.testng.Reporter; //导入方法依赖的package包/类
@Override
public boolean retry(ITestResult result) {
	if (retryCount <= maxRetryCount) {
		String message = "Retry for [" + result.getName() + "] on class [" + result.getTestClass().getName() + "] Retry "
				+ retryCount + " times";
		logger.info(message);
		Reporter.setCurrentTestResult(result);
		Reporter.log("RunCount=" + (retryCount + 1));
		retryCount++;
		return true;
	}
	return false;
}
 
开发者ID:quanqinle,项目名称:WebAndAppUITesting,代码行数:14,代码来源:TestngRetry.java

示例15: onTestFailure

import org.testng.Reporter; //导入方法依赖的package包/类
/**
 * Take screenshot in case of test failure.
 */
@Override
public void onTestFailure(ITestResult tr)
{
    super.onTestFailure(tr);

    WebDriver webDriver = findWebDriverByReflection(tr);

    if (webDriver == null)
    {
        LOGGER.debug(String
                .format("The test class '%s' does not have any field of type 'org.openqa.selenium.WebDriver'. "
                        + "ScreenshotTestListener can not continue.", tr.getTestClass().getName()));
        return;
    }

    File f = ((TakesScreenshot) webDriver).getScreenshotAs(OutputType.FILE);

    Format formatter = new SimpleDateFormat("dd_MMM_hh_mm_ss");

    String timestamp = formatter.format(new Date());
    String fileName = tr.getTestClass().getRealClass().getSimpleName() + "_" + timestamp + ".png";

    Path screenshotPath = null;

    try
    {
        screenshotPath = Paths.get(currentDir, "target", fileName);

        LOGGER.info("copying failure screenshot file '" + fileName + "' to '" + screenshotPath + "'");

        Files.copy(f.toPath(), screenshotPath, StandardCopyOption.REPLACE_EXISTING);
        Reporter.log("[Console Log] Screenshot saved in " + screenshotPath);
    } catch (IOException e)
    {
        LOGGER.debug("Error during the screenshot copy file operation:" + e.getMessage());
    }
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:41,代码来源:ScreenshotListener.java


注:本文中的org.testng.Reporter.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。