1 package org.apache.maven.surefire.booter;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.surefire.providerapi.AbstractProvider;
23 import org.apache.maven.surefire.providerapi.SurefireProvider;
24 import org.apache.maven.surefire.report.ReporterConfiguration;
25 import org.apache.maven.surefire.report.ReporterException;
26 import org.apache.maven.surefire.suite.RunResult;
27 import org.apache.maven.surefire.testset.TestSetFailedException;
28
29 import java.util.Iterator;
30
31 import junit.framework.TestCase;
32
33
34
35
36 public class ForkTimeoutTest
37 extends TestCase
38 {
39 public void testClose()
40 throws Exception
41 {
42 final Integer forkTimeout1 = new Integer( 100 );
43 SurefireProvider surefireProvider = new TestProvider();
44 ReporterConfiguration reporterConfiguration = new ReporterConfiguration( null, null, null, forkTimeout1 );
45 new ForkTimeout( 100, reporterConfiguration, surefireProvider );
46 try
47 {
48 Thread.sleep( 1500 );
49 }
50 catch ( InterruptedException ignore )
51 {
52
53 }
54 }
55
56 public class TestProvider
57 extends AbstractProvider
58 {
59
60 public TestProvider()
61 {
62 }
63
64 public Iterator getSuites()
65 {
66 return null;
67 }
68
69 public RunResult invoke( Object forkTestSet )
70 throws TestSetFailedException, ReporterException
71 {
72 return new RunResult( 1, 0, 0, 2 );
73 }
74 }
75
76 }