File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2323 * } 
2424 * </pre> 
2525 * <p> 
26-  * The <code>Test</code> annotation supports two optional parameters. 
27-  * The first, <code>expected</code>, declares that a test method should throw 
26+  * The <code>Test</code> annotation supports two optional parameters for 
27+  * exception testing and for limiting test execution time. 
28+  * 
29+  * <h3>Exception Testing</h3> 
30+  * <p> 
31+  * The parameter <code>expected</code> declares that a test method should throw 
2832 * an exception. If it doesn't throw an exception or if it throws a different exception 
2933 * than the one declared, the test fails. For example, the following test succeeds: 
3034 * <pre> 
3640 * {@link org.junit.rules.ExpectedException ExpectedException} rule can be used. Further 
3741 * information about exception testing can be found at the 
3842 * <a href="https://github.com/junit-team/junit4/wiki/Exception-testing">JUnit Wiki</a>. 
43+  * 
44+  * <h3>Timeout</h3> 
3945 * <p> 
40-  * The second optional  parameter,  <code>timeout</code>,  causes a test to fail if it takes 
46+  * The parameter <code>timeout</code> causes a test to fail if it takes 
4147 * longer than a specified amount of clock time (measured in milliseconds). The following test fails: 
4248 * <pre> 
4349 *    @Test(<b>timeout=100</b>) public void infinity() { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments