Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
772 bytes
|
Line | |
---|
1 | package com.framsticks.test; |
---|
2 | |
---|
3 | import org.testng.annotations.AfterClass; |
---|
4 | import org.testng.annotations.BeforeClass; |
---|
5 | import org.testng.annotations.Test; |
---|
6 | |
---|
7 | import com.framsticks.util.dispatching.Joinable; |
---|
8 | import com.framsticks.util.dispatching.Monitor; |
---|
9 | |
---|
10 | @Test |
---|
11 | public abstract class MonitorBasedTest extends TestConfiguration { |
---|
12 | |
---|
13 | protected Monitor monitor; |
---|
14 | protected Joinable subject; |
---|
15 | |
---|
16 | protected abstract Joinable createSubject(); |
---|
17 | |
---|
18 | @BeforeClass(timeOut = 2000) |
---|
19 | public void setUp() { |
---|
20 | subject = createSubject(); |
---|
21 | |
---|
22 | monitor = new Monitor(subject); |
---|
23 | monitor.setTaskExceptionHandler(createExceptionHandler()); |
---|
24 | monitor.use(); |
---|
25 | |
---|
26 | setUpAfterUse(); |
---|
27 | } |
---|
28 | |
---|
29 | protected void setUpAfterUse() { |
---|
30 | } |
---|
31 | |
---|
32 | @AfterClass(timeOut = 30000) |
---|
33 | public void tearDown() { |
---|
34 | monitor.drop().join(); |
---|
35 | } |
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.