1
2
3
4
5
6
7
8
9
10 package ch.qos.logback.core;
11
12 import static org.junit.Assert.fail;
13
14 import org.junit.Test;
15
16 public class ContextBaseTest {
17
18 ContextBase context = new ContextBase();
19
20 @Test
21 public void renameDefault() {
22 context.setName(CoreConstants.DEFAULT_CONTEXT_NAME);
23 context.setName("hello");
24 }
25
26
27 @Test
28 public void idempotentNameTest() {
29 context.setName("hello");
30 context.setName("hello");
31 }
32
33 @Test
34 public void renameTest() {
35 context.setName("hello");
36 try {
37 context.setName("x");
38 fail("renaming is not allowed");
39 } catch (IllegalStateException ise) {
40 }
41 }
42
43 }