本文整理汇总了Java中ru.yandex.qatools.allure.annotations.Description类的典型用法代码示例。如果您正苦于以下问题:Java Description类的具体用法?Java Description怎么用?Java Description使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Description类属于ru.yandex.qatools.allure.annotations包,在下文中一共展示了Description类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:GladsonAntony,项目名称:WebAutomation_AllureParallel,代码行数:17,代码来源:Test1.java
示例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;
}
};
}
开发者ID:kirlionik,项目名称:allure-cucumber-plugin,代码行数:19,代码来源:AllureReporter.java
示例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);
}
开发者ID:eclipse,项目名称:hawkbit-extensions,代码行数:21,代码来源:S3RepositoryTest.java
示例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);
}
开发者ID:eclipse,项目名称:hawkbit-extensions,代码行数:27,代码来源:S3RepositoryTest.java
示例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());
}
开发者ID:eclipse,项目名称:hawkbit-extensions,代码行数:18,代码来源:S3RepositoryTest.java
示例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);
}
}
开发者ID:eclipse,项目名称:hawkbit-extensions,代码行数:18,代码来源:S3RepositoryTest.java
示例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);
}
}
开发者ID:eclipse,项目名称:hawkbit-extensions,代码行数:18,代码来源:S3RepositoryTest.java
示例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) {
}
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:PreAuthTokenSourceTrustAuthenticationProviderTest.java
示例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) {
}
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:22,代码来源:PreAuthTokenSourceTrustAuthenticationProviderTest.java
示例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);
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:MgmtSoftwareModuleResourceTest.java
示例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);
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:AmqpMessageHandlerServiceIntegrationTest.java
示例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)));
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:20,代码来源:MgmtRolloutResourceTest.java
示例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());
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:20,代码来源:AmqpMessageHandlerServiceIntegrationTest.java
示例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);
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:27,代码来源:ExceptionInfoTest.java
示例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);
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:24,代码来源:DosFilterTest.java
示例16: removeMandatoryModuleToDistributionSetType
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@WithUser(principal = "uploadTester", allSpPermissions = true)
@Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes/{ID} DELETE requests.")
public void removeMandatoryModuleToDistributionSetType() throws Exception {
DistributionSetType testType = generateTestType();
mvc.perform(delete("/rest/v1/distributionsettypes/{dstID}/mandatorymoduletypes/{smtId}", testType.getId(),
osType.getId()).contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print())
.andExpect(status().isOk());
testType = distributionSetTypeManagement.get(testType.getId()).get();
assertThat(testType.getLastModifiedBy()).isEqualTo("uploadTester");
assertThat(testType.getOptLockRevision()).isEqualTo(2);
assertThat(testType.getOptionalModuleTypes()).containsExactly(appType);
assertThat(testType.getMandatoryModuleTypes()).isEmpty();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:MgmtDistributionSetTypeResourceTest.java
示例17: deleteSoftwareModuleMetadata
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Verfies that existing metadata can be deleted.")
public void deleteSoftwareModuleMetadata() {
final String knownKey1 = "myKnownKey1";
final String knownValue1 = "myKnownValue1";
SoftwareModule ah = testdataFactory.createSoftwareModuleApp();
softwareModuleManagement.createMetaData(
entityFactory.softwareModuleMetadata().create(ah.getId()).key(knownKey1).value(knownValue1));
ah = softwareModuleManagement.get(ah.getId()).get();
assertThat(softwareModuleManagement.findMetaDataBySoftwareModuleId(new PageRequest(0, 10), ah.getId())
.getContent()).as("Contains the created metadata element")
.containsExactly(new JpaSoftwareModuleMetadata(knownKey1, ah, knownValue1));
softwareModuleManagement.deleteMetaData(ah.getId(), knownKey1);
assertThat(softwareModuleManagement.findMetaDataBySoftwareModuleId(new PageRequest(0, 10), ah.getId())
.getContent()).as("Metadata elemenets are").isEmpty();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:22,代码来源:SoftwareModuleManagementTest.java
示例18: uploadArtifactWithCustomName
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("verfies that option to upload artifacts with a custom defined by metadata, i.e. not the file name of the binary itself.")
public void uploadArtifactWithCustomName() throws Exception {
final SoftwareModule sm = testdataFactory.createSoftwareModuleOs();
assertThat(artifactManagement.count()).isEqualTo(0);
// create test file
final byte random[] = RandomStringUtils.random(5 * 1024).getBytes();
final MockMultipartFile file = new MockMultipartFile("file", "origFilename", null, random);
// upload
mvc.perform(fileUpload("/rest/v1/softwaremodules/{smId}/artifacts", sm.getId()).file(file)
.param("filename", "customFilename").accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isCreated())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.providedFilename", equalTo("customFilename"))).andExpect(status().isCreated());
// check result in db...
// repo
assertThat(artifactManagement.count()).isEqualTo(1);
// hashes
assertThat(artifactManagement.getByFilename("customFilename")).as("Local artifact is wrong").isPresent();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:25,代码来源:MgmtSoftwareModuleResourceTest.java
示例19: checkThatDsRevisionsIsNotChangedWithTargetAssignment
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("The test verfies that the DS itself is not changed because of an target assignment"
+ " which is a relationship but not a changed on the entity itself..")
public void checkThatDsRevisionsIsNotChangedWithTargetAssignment() {
final DistributionSet dsA = testdataFactory.createDistributionSet("a");
testdataFactory.createDistributionSet("b");
final Target targ = testdataFactory.createTarget("target-id-A");
assertThat(dsA.getOptLockRevision()).as("lock revision is wrong")
.isEqualTo(distributionSetManagement.getWithDetails(dsA.getId()).get().getOptLockRevision());
assignDistributionSet(dsA, Arrays.asList(targ));
assertThat(dsA.getOptLockRevision()).as("lock revision is wrong")
.isEqualTo(distributionSetManagement.getWithDetails(dsA.getId()).get().getOptLockRevision());
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:DeploymentManagementTest.java
示例20: cancelActionOK
import ru.yandex.qatools.allure.annotations.Description; //导入依赖的package包/类
@Test
@Description("Ensures that a deletion of an active action results in cancelation triggered.")
public void cancelActionOK() throws Exception {
// prepare test
final Target tA = createTargetAndStartAction();
// test - cancel the active action
mvc.perform(
delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}",
tA.getControllerId(), deploymentManagement.findActionsByTarget(tA.getControllerId(), PAGE)
.getContent().get(0).getId()))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isNoContent());
final Action action = deploymentManagement.findAction(
deploymentManagement.findActionsByTarget(tA.getControllerId(), PAGE).getContent().get(0).getId()).get();
// still active because in "canceling" state and waiting for controller
// feedback
assertThat(action.isActive()).isTrue();
// action has not been cancelled confirmed from controller, so DS
// remains assigned until
// confirmation
assertThat(deploymentManagement.getAssignedDistributionSet(tA.getControllerId())).isPresent();
assertThat(deploymentManagement.getInstalledDistributionSet(tA.getControllerId())).isNotPresent();
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:26,代码来源:MgmtTargetResourceTest.java
注:本文中的ru.yandex.qatools.allure.annotations.Description类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论