()
| 122 | } |
| 123 | |
| 124 | @Test |
| 125 | public void rootCanBeAttached() { |
| 126 | Context fork = Context.ROOT.fork(); |
| 127 | Context toRestore1 = fork.attach(); |
| 128 | Context toRestore2 = Context.ROOT.attach(); |
| 129 | assertTrue(Context.ROOT.isCurrent()); |
| 130 | |
| 131 | Context toRestore3 = fork.attach(); |
| 132 | assertTrue(fork.isCurrent()); |
| 133 | |
| 134 | fork.detach(toRestore3); |
| 135 | Context.ROOT.detach(toRestore2); |
| 136 | fork.detach(toRestore1); |
| 137 | } |
| 138 | |
| 139 | @Test |
| 140 | public void rootCanNeverHaveAListener() { |