本文整理汇总了Java中org.databene.contiperf.Required类的典型用法代码示例。如果您正苦于以下问题:Java Required类的具体用法?Java Required怎么用?Java Required使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Required类属于org.databene.contiperf包,在下文中一共展示了Required类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serviceDestroyApplicationSessionRequestSuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Service destroy application session request success test.
*
* @throws Exception
* the exception
*/
@Test
@PerfTest(threads = 4, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 600, percentile95 = 850, throughput = 10)
public void serviceDestroyApplicationSessionRequestSuccessTest() throws Exception {
setAuthenticatedAnonymousUser();
final CreateApplicationSessionRequest createTestApplicationSession = createTestApplicationSession();
final DestroyApplicationSessionRequest destroyApplicationSessionRequest = new DestroyApplicationSessionRequest();
destroyApplicationSessionRequest.setSessionId(createTestApplicationSession.getSessionId());
final ServiceResponse response = applicationManager.service(destroyApplicationSessionRequest);
assertNotNull(EXPECT_A_RESULT,response);
assertEquals(EXPECT_SUCCESS,ServiceResult.SUCCESS,response.getResult());
final ApplicationSession applicationSession = applicationSessionDAO.findFirstByProperty(ApplicationSession_.sessionId, createTestApplicationSession.getSessionId());
assertNotNull(EXPECT_A_RESULT,applicationSession);
assertNotNull(EXPECT_A_RESULT,applicationSession.getDestroyedDate());
}
示例2: serviceRegisterUserRequestSuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Service register user request success test.
*
* @throws Exception
* the exception
*/
@Test
@PerfTest(threads = 4, duration = 5000, warmUp = 1500)
@Required(max = 2000, average = 1200, percentile95 = 1500, throughput = 2)
public void serviceRegisterUserRequestSuccessTest() throws Exception {
final CreateApplicationSessionRequest createApplicationSesstion = createApplicationSesstionWithRoleAnonymous();
final RegisterUserRequest serviceRequest = new RegisterUserRequest();
serviceRequest.setCountry("Sweden");
serviceRequest.setUsername(UUID.randomUUID().toString());
serviceRequest.setEmail(serviceRequest.getUsername() + "@email.com");
serviceRequest.setUserpassword("Userpassword1!");
serviceRequest.setUserType(UserType.PRIVATE);
serviceRequest.setSessionId(createApplicationSesstion.getSessionId());
final RegisterUserResponse response = (RegisterUserResponse) applicationManager.service(serviceRequest);
assertNotNull(EXPECT_A_RESULT, response);
assertEquals(EXPECT_SUCCESS,ServiceResult.SUCCESS, response.getResult());
final DataContainer<UserAccount, Long> dataContainer = applicationManager.getDataContainer(UserAccount.class);
final List<UserAccount> allBy = dataContainer.getAllBy(UserAccount_.username, serviceRequest.getUsername());
assertEquals(1, allBy.size());
}
示例3: testPing
import org.databene.contiperf.Required; //导入依赖的package包/类
@Test
@PerfTest(invocations = 30000, threads = 300)
@Required(max = 10000, average = 600)
public void testPing() throws Exception {
String url = "http://localhost:9999/cmd/ping";
String rs = HttpClientUtil.executeGet(url);
if (rs.length()>3) {
int c = validCount.incrementAndGet();
System.out.println(c+" \n");
} else {
System.out.println(rs);
invalidCount.incrementAndGet();
throw new IllegalArgumentException("Bad response!");
}
}
示例4: allPass
import org.databene.contiperf.Required; //导入依赖的package包/类
@Test
@PerfTest(invocations = 10, rampUp = 1)
@Required(max = 20000, average = 10000)
public void allPass()
{
verify(new ExpectedTable());
}
示例5: brokenBalances
import org.databene.contiperf.Required; //导入依赖的package包/类
@Test(expected = AssertionError.class)
@PerfTest(invocations = 10, rampUp = 1)
@Required(max = 20000, average = 10000)
public void brokenBalances()
{
verify(new BrokenBalances());
}
示例6: partialMatch
import org.databene.contiperf.Required; //导入依赖的package包/类
@Test(expected = AssertionError.class)
@PerfTest(invocations = 10, rampUp = 1)
@Required(max = 20000, average = 10000)
public void partialMatch()
{
verify(new PartiallyMatchable());
}
示例7: testParsingOfSearchResultFile
import org.databene.contiperf.Required; //导入依赖的package包/类
@Test
@PerfTest(invocations = 100, threads = 2)
@Required(max = 2300, average = 1590)
public void testParsingOfSearchResultFile () throws IOException, Exception,URISyntaxException {
File jsonFile = new File(TestJsonParser.class.getClassLoader().getSystemResource("TestJsonParser/history.list").toURI());
Path jsonPath = jsonFile.toPath();
LOG.info("The file is going to be read") ;
List<String> searchResultLines = Files.readAllLines(jsonPath, Charset.forName("UTF-8")) ;
int size = searchResultLines.size() ;
LOG.info("The file is read =>" +size +" line(s)") ;
StringBuffer fullText = new StringBuffer();
int current = 0 ;
TweetFromTuple simpleConstructor = new TweetFromTuple();
for (String searchResultLine : searchResultLines ) {
Tweet currentTweet = simpleConstructor.map(searchResultLine);
String post_id = currentTweet.getTwitterName();
String post_text = currentTweet.getTwittText();
String post_geo = currentTweet.getGeo() ;
String post_coordinate = currentTweet.getCoordinate() ;
//System.out.println("original post =>" + searchResultLine);
//System.out.println("post_id =>" + post_id);
Assert.assertNotNull(post_id);
Assert.assertNotNull(post_text);
Assert.assertNotNull(post_geo);
Assert.assertNotNull(post_coordinate);
Assert.assertEquals(post_geo, Tweet.Default_Geo);
Assert.assertEquals(post_coordinate, Tweet.Default_Coordinate);
}
}
示例8: getBallotIdListTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the ballot id list test.
*
* @return the ballot id list test
*/
@Test
@PerfTest(threads = 1, duration = 20000)
@Required(max = 20000,average = 15000,percentile95=18000)
public void getBallotIdListTest() {
List<VoteDataEmbeddedId> ballotIdList = voteDataDAO.getBallotIdList();
assertNotNull(ballotIdList);
assertFalse(ballotIdList.isEmpty());
}
示例9: getIdListTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the id list test.
*
* @return the id list test
*/
@Test
@PerfTest(threads = 1, duration = 20000)
@Required(max = 20000,average = 15000,percentile95=18000)
@Ignore
public void getIdListTest() {
List<VoteDataEmbeddedId> ballotIdList = voteDataDAO.getIdList();
assertNotNull(ballotIdList);
assertFalse(ballotIdList.isEmpty());
}
示例10: getDataDefenceMinistrySuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the data defence ministry success test.
*
* @return the data defence ministry success test
*/
@Test
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 800, percentile95 = 900, throughput = 2)
public void getDataDefenceMinistrySuccessTest() {
final Map<Integer, List<GovernmentBodyAnnualSummary>> governmentBodyAnnualSummaryData = esvApi
.getDataPerMinistry("Försvarsdepartementet");
assertNotNull(governmentBodyAnnualSummaryData);
assertEquals(18, governmentBodyAnnualSummaryData.size());
for (final List<GovernmentBodyAnnualSummary> list : governmentBodyAnnualSummaryData.values()) {
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
}
示例11: getDataFinanceMinistry1900FailureTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the data finance ministry 1900 failure test.
*
* @return the data finance ministry 1900 failure test
*/
@Test
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 800, percentile95 = 900, throughput = 2)
public void getDataFinanceMinistry1900FailureTest() {
final List<GovernmentBodyAnnualSummary> list = esvApi.getDataPerMinistryAndYear("Finansdepartementet", 1900);
assertNotNull(list);
assertEquals(0, list.size());
}
示例12: getDataFinanceMinistry1999SuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the data finance ministry 1999 success test.
*
* @return the data finance ministry 1999 success test
*/
@Test
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 800, percentile95 = 900, throughput = 2)
public void getDataFinanceMinistry1999SuccessTest() {
final List<GovernmentBodyAnnualSummary> list = esvApi.getDataPerMinistryAndYear("Finansdepartementet", 1999);
assertNotNull(list);
assertEquals(42, list.size());
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
示例13: getDataFinanceMinistry2016SuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the data finance ministry 2016 success test.
*
* @return the data finance ministry 2016 success test
*/
@Test
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 800, percentile95 = 900, throughput = 2)
public void getDataFinanceMinistry2016SuccessTest() {
final List<GovernmentBodyAnnualSummary> list = esvApi.getDataPerMinistryAndYear("Finansdepartementet", 2016);
assertNotNull(list);
assertEquals(45, list.size());
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
示例14: getDataFinanceMinistrySuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the data finance ministry success test.
*
* @return the data finance ministry success test
*/
@Test
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 800, percentile95 = 900, throughput = 2)
public void getDataFinanceMinistrySuccessTest() {
final Map<Integer, List<GovernmentBodyAnnualSummary>> governmentBodyAnnualSummaryData = esvApi
.getDataPerMinistry("Finansdepartementet");
assertNotNull(governmentBodyAnnualSummaryData);
assertEquals(18, governmentBodyAnnualSummaryData.size());
for (final List<GovernmentBodyAnnualSummary> list : governmentBodyAnnualSummaryData.values()) {
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
}
示例15: getDataForeignMinistrySuccessTest
import org.databene.contiperf.Required; //导入依赖的package包/类
/**
* Gets the data foreign ministry success test.
*
* @return the data foreign ministry success test
*/
@Test
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 800, percentile95 = 900, throughput = 2)
public void getDataForeignMinistrySuccessTest() {
final Map<Integer, List<GovernmentBodyAnnualSummary>> governmentBodyAnnualSummaryData = esvApi
.getDataPerMinistry("Utrikesdepartementet");
assertNotNull(governmentBodyAnnualSummaryData);
assertEquals(18, governmentBodyAnnualSummaryData.size());
for (final List<GovernmentBodyAnnualSummary> list : governmentBodyAnnualSummaryData.values()) {
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
}