本文整理汇总了Java中ru.yandex.qatools.allure.annotations.Description类的典型用法代码示例。如果您正苦于以下问题:Java Description类的具体用法?Java Description怎么用?Java Description使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Description类属于ru.yandex.qatools.allure.annotations包,在下文中一共展示了Description类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGoogle
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@TestCaseId("TC_GMail_001")
@Description("To verify the working of GMail link from Google Home Page using JavaScript Executor")
@Features("GMail Page")
@Test(dataProvider="excelSheetNameAsMethodName",dataProviderClass=ExcelDataProvider.class)
public void testGoogle(@Parameter("Testcase ID")String testCaseID,@Parameter("Email ID")String emailID, @Parameter("Password")String password) throws Exception
{
/* googleHomePage()
.verifyPageTitle()
.clickonGmailLink()
.gmailPage()
.enterEmailID(emailID);*/
System.out.println("TestCase ID: "+testCaseID);
System.out.println("EmailID "+emailID);
System.out.println("Password: "+password);
}
示例2: getDescriptionAnnotation
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
private Description getDescriptionAnnotation(final String description){
return new Description(){
@Override
public String value() {
return description;
}
@Override
public DescriptionType type() {
return DescriptionType.TEXT;
}
@Override
public Class<? extends Annotation> annotationType() {
return Description.class;
}
};
}
示例3: storeInputStreamCallAmazonS3Client
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verifies that the amazonS3 client is called to put the object to S3 with the correct inputstream and meta-data")
public void storeInputStreamCallAmazonS3Client() throws IOException, NoSuchAlgorithmException {
final byte[] rndBytes = randomBytes();
final String knownSHA1 = getSha1OfBytes(rndBytes);
final String knownContentType = "application/octet-stream";
// test
storeRandomBytes(rndBytes, knownContentType);
// verify
Mockito.verify(amazonS3Mock).putObject(eq(s3Properties.getBucketName()),
eq(TENANT.toUpperCase() + "/" + knownSHA1), inputStreamCaptor.capture(),
objectMetaDataCaptor.capture());
final ObjectMetadata recordedObjectMetadata = objectMetaDataCaptor.getValue();
assertThat(recordedObjectMetadata.getContentType()).isEqualTo(knownContentType);
assertThat(recordedObjectMetadata.getContentMD5()).isNotNull();
assertThat(recordedObjectMetadata.getContentLength()).isEqualTo(rndBytes.length);
}
示例4: getArtifactBySHA1Hash
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verifies that the amazonS3 client is called to retrieve the correct artifact from S3 and the mapping to the DBArtifact is correct")
public void getArtifactBySHA1Hash() {
final String knownSHA1Hash = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
final long knownContentLength = 100;
final String knownContentType = "application/octet-stream";
final String knownMd5 = "098f6bcd4621d373cade4e832627b4f6";
final String knownMdBase16 = BaseEncoding.base16().lowerCase().encode(knownMd5.getBytes());
final String knownMd5Base64 = BaseEncoding.base64().encode(knownMd5.getBytes());
when(amazonS3Mock.getObject(anyString(), anyString())).thenReturn(s3ObjectMock);
when(s3ObjectMock.getObjectMetadata()).thenReturn(s3ObjectMetadataMock);
when(s3ObjectMetadataMock.getContentLength()).thenReturn(knownContentLength);
when(s3ObjectMetadataMock.getETag()).thenReturn(knownMd5Base64);
when(s3ObjectMetadataMock.getContentType()).thenReturn(knownContentType);
// test
final AbstractDbArtifact artifactBySha1 = s3RepositoryUnderTest.getArtifactBySha1(TENANT, knownSHA1Hash);
// verify
assertThat(artifactBySha1.getArtifactId()).isEqualTo(knownSHA1Hash);
assertThat(artifactBySha1.getContentType()).isEqualTo(knownContentType);
assertThat(artifactBySha1.getSize()).isEqualTo(knownContentLength);
assertThat(artifactBySha1.getHashes().getSha1()).isEqualTo(knownSHA1Hash);
assertThat(artifactBySha1.getHashes().getMd5()).isEqualTo(knownMdBase16);
}
示例5: artifactIsNotUploadedIfAlreadyExists
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verifies that the amazonS3 client is not called to put the object to S3 due the artifact already exists on S3")
public void artifactIsNotUploadedIfAlreadyExists() throws NoSuchAlgorithmException, IOException {
final byte[] rndBytes = randomBytes();
final String knownSHA1 = getSha1OfBytes(rndBytes);
final String knownContentType = "application/octet-stream";
when(amazonS3Mock.doesObjectExist(s3Properties.getBucketName(), knownSHA1)).thenReturn(true);
// test
storeRandomBytes(rndBytes, knownContentType);
// verify
Mockito.verify(amazonS3Mock, never()).putObject(eq(s3Properties.getBucketName()), eq(knownSHA1),
inputStreamCaptor.capture(), objectMetaDataCaptor.capture());
}
示例6: sha1HashValuesAreNotTheSameThrowsException
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verifies that given SHA1 hash are checked and if not match will throw exception")
public void sha1HashValuesAreNotTheSameThrowsException() throws IOException {
final byte[] rndBytes = randomBytes();
final String knownContentType = "application/octet-stream";
final String wrongSHA1Hash = "wrong";
final String wrongMD5 = "wrong";
// test
try {
storeRandomBytes(rndBytes, knownContentType, new DbArtifactHash(wrongSHA1Hash, wrongMD5));
fail("Expected an HashNotMatchException, but didn't throw");
} catch (final HashNotMatchException e) {
assertThat(e.getHashFunction()).isEqualTo(HashNotMatchException.SHA1);
}
}
示例7: md5HashValuesAreNotTheSameThrowsException
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verifies that given MD5 hash are checked and if not match will throw exception")
public void md5HashValuesAreNotTheSameThrowsException() throws IOException, NoSuchAlgorithmException {
final byte[] rndBytes = randomBytes();
final String knownContentType = "application/octet-stream";
final String knownSHA1 = getSha1OfBytes(rndBytes);
final String wrongMD5 = "wrong";
// test
try {
storeRandomBytes(rndBytes, knownContentType, new DbArtifactHash(knownSHA1, wrongMD5));
fail("Expected an HashNotMatchException, but didn't throw");
} catch (final HashNotMatchException e) {
assertThat(e.getHashFunction()).isEqualTo(HashNotMatchException.MD5);
}
}
示例8: principalAndCredentialsNotTheSameThrowsAuthenticationException
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Testing in case the containing controllerId in the URI request path does not accord with the controllerId in the request header.")
public void principalAndCredentialsNotTheSameThrowsAuthenticationException() {
final String principal = "controllerIdURL";
final String credentials = "controllerIdHeader";
final PreAuthenticatedAuthenticationToken token = new PreAuthenticatedAuthenticationToken(principal,
Arrays.asList(credentials));
token.setDetails(webAuthenticationDetailsMock);
// test, should throw authentication exception
try {
underTestWithoutSourceIpCheck.authenticate(token);
fail("Should not work with wrong credentials");
} catch (final BadCredentialsException e) {
}
}
示例9: priniciapAndCredentialsAreTheSameButSourceIpRequestNotMatching
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Testing that the controllerId in the URI request match with the controllerId in the request header but the request are not coming from a trustful source.")
public void priniciapAndCredentialsAreTheSameButSourceIpRequestNotMatching() {
final String remoteAddress = "192.168.1.1";
final String principal = "controllerId";
final String credentials = "controllerId";
final PreAuthenticatedAuthenticationToken token = new PreAuthenticatedAuthenticationToken(principal,
Arrays.asList(credentials));
token.setDetails(webAuthenticationDetailsMock);
when(webAuthenticationDetailsMock.getRemoteAddress()).thenReturn(remoteAddress);
// test, should throw authentication exception
try {
underTestWithSourceIpCheck.authenticate(token);
fail("as source is not trusted.");
} catch (final InsufficientAuthenticationException e) {
}
}
示例10: downloadArtifact
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Tests binary download of an artifact including verfication that the downloaded binary is consistent and that the etag header is as expected identical to the SHA1 hash of the file.")
public void downloadArtifact() throws Exception {
final SoftwareModule sm = testdataFactory.createSoftwareModuleOs();
final byte random[] = RandomStringUtils.random(5 * 1024).getBytes();
final Artifact artifact = artifactManagement.create(new ByteArrayInputStream(random), sm.getId(), "file1",
false);
final Artifact artifact2 = artifactManagement.create(new ByteArrayInputStream(random), sm.getId(), "file2",
false);
downloadAndVerify(sm, random, artifact);
downloadAndVerify(sm, random, artifact2);
assertThat(softwareModuleManagement.findAll(PAGE)).as("Softwaremodule size is wrong").hasSize(1);
assertThat(artifactManagement.count()).isEqualTo(2);
}
示例11: status
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Register a target and send a valid update action status (cancel_rejected). Verfiy if the updated action status is correct.")
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
@Expect(type = TargetAssignDistributionSetEvent.class, count = 1),
@Expect(type = CancelTargetAssignmentEvent.class, count = 1),
@Expect(type = ActionUpdatedEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1),
@Expect(type = SoftwareModuleCreatedEvent.class, count = 3),
@Expect(type = SoftwareModuleUpdatedEvent.class, count = 6),
@Expect(type = DistributionSetCreatedEvent.class, count = 1),
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
public void canceledRejectedActionStatus() {
final String controllerId = TARGET_PREFIX + "canceledRejectedActionStatus";
final Long actionId = registerTargetAndCancelActionId(controllerId);
sendActionUpdateStatus(new DmfActionUpdateStatus(actionId, DmfActionStatus.CANCEL_REJECTED));
assertAction(actionId, 1, Status.RUNNING, Status.CANCELING, Status.CANCEL_REJECTED);
}
示例12: rolloutPagedListIsLimitedToQueryParam
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Testing that rollout paged list is limited by the query param limit")
public void rolloutPagedListIsLimitedToQueryParam() throws Exception {
final DistributionSet dsA = testdataFactory.createDistributionSet("");
testdataFactory.createTargets(20, "target", "rollout");
// setup - create 2 rollouts
postRollout("rollout1", 10, dsA.getId(), "id==target*", 20);
postRollout("rollout2", 5, dsA.getId(), "id==target*", 20);
// Run here, because Scheduler is disabled during tests
rolloutManagement.handleRollouts();
mvc.perform(get("/rest/v1/rollouts?limit=1").accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.content", hasSize(1))).andExpect(jsonPath("$.total", equalTo(2)));
}
示例13: updateAttributes
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verify that sending an update controller attribute message to an existing target works.")
@ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1),
@Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) })
public void updateAttributes() {
final String controllerId = TARGET_PREFIX + "updateAttributes";
// setup
registerAndAssertTargetWithExistingTenant(controllerId, 1);
final DmfAttributeUpdate controllerAttribute = new DmfAttributeUpdate();
controllerAttribute.getAttributes().put("test1", "testA");
controllerAttribute.getAttributes().put("test2", "testB");
// test
sendUpdateAttributeMessage(controllerId, TENANT_EXIST, controllerAttribute);
// validate
assertUpdateAttributes(controllerId, controllerAttribute.getAttributes());
}
示例14: setterAndGetterOnExceptionInfo
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Ensures that setters and getters match on teh payload.")
public void setterAndGetterOnExceptionInfo() {
final String knownExceptionClass = "hawkbit.test.exception.Class";
final String knownErrorCode = "hawkbit.error.code.Known";
final String knownMessage = "a known message";
final List<String> knownParameters = new ArrayList<>();
knownParameters.add("param1");
knownParameters.add("param2");
final ExceptionInfo underTest = new ExceptionInfo();
underTest.setErrorCode(knownErrorCode);
underTest.setExceptionClass(knownExceptionClass);
underTest.setMessage(knownMessage);
underTest.setParameters(knownParameters);
assertThat(underTest.getErrorCode()).as("The error code should match with the known error code in the test")
.isEqualTo(knownErrorCode);
assertThat(underTest.getExceptionClass())
.as("The exception class should match with the known error code in the test")
.isEqualTo(knownExceptionClass);
assertThat(underTest.getMessage()).as("The message should match with the known error code in the test")
.isEqualTo(knownMessage);
assertThat(underTest.getParameters()).as("The parameters should match with the known error code in the test")
.isEqualTo(knownParameters);
}
示例15: putPostFloddingAttackThatisPrevented
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Ensures that a WRITE DoS attempt is blocked ")
public void putPostFloddingAttackThatisPrevented() throws Exception {
final Long actionId = prepareDeploymentBase();
final String feedback = JsonBuilder.deploymentActionFeedback(actionId.toString(), "proceeding");
MvcResult result = null;
int requests = 0;
do {
result = mvc.perform(post("/{tenant}/controller/v1/4711/deploymentBase/" + actionId + "/feedback",
tenantAware.getCurrentTenant()).header(HttpHeaders.X_FORWARDED_FOR, "10.0.0.1").content(feedback)
.contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))
.andReturn();
requests++;
// we give up after 500 requests
assertThat(requests).isLessThan(500);
} while (result.getResponse().getStatus() != HttpStatus.TOO_MANY_REQUESTS.value());
// the filter shuts down after 10 POST requests
assertThat(requests).isGreaterThanOrEqualTo(10);
}