문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:junit:contiperf [2015/04/17 14:20] kwon37xi 만듦 |
java:junit:contiperf [2015/11/26 19:55] kwon37xi |
||
---|---|---|---|
줄 3: | 줄 3: | ||
* [[http:// | * [[http:// | ||
+ | ===== Test Code ===== | ||
+ | <code java> | ||
+ | public class UserSerializerTest { | ||
+ | |||
+ | @Rule | ||
+ | public ContiPerfRule i = new ContiPerfRule(); | ||
+ | |||
+ | @Test | ||
+ | @PerfTest(invocations = 200, threads = 2) // 2개 쓰레드에서 200번(각 100번)호출 | ||
+ | @Required(max = 1200, average = 250) // 테스트 통과조건 | ||
+ | public void shouldSerializeRandomUser() throws JAXBException { | ||
+ | |||
+ | // ... | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== @PerfTest 옵션들 ===== | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ===== 임시 작동 중단 ===== | ||
+ | * 시스템 프라퍼티 '' | ||
+ | * Maven <code sh> | ||
+ | mvn test -DargLine=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== 테스트 코드 작동구조 ===== | ||
+ | > First the @Before method is called. Then the test method is invoked 1,000 times subsequently and finally the @After method(s). ContiPerf 2 supports this behaviour for all JUnit 4 versions since version 4.7. | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | 예를들어 테스트 메소드가 '' | ||
+ | < | ||
+ | constructor() | ||
+ | before() | ||
+ | test1() * 1000 회 수행 | ||
+ | after() | ||
+ | |||
+ | constructor() | ||
+ | before() | ||
+ | test2() * 1000 회 수행 | ||
+ | after() | ||
+ | </ |