1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.core.net.server;
15
16 import org.junit.jupiter.api.BeforeEach;
17 import org.junit.jupiter.api.Test;
18
19 import ch.qos.logback.core.net.mock.MockContext;
20 import ch.qos.logback.core.spi.PreSerializationTransformer;
21 import ch.qos.logback.core.util.ExecutorServiceUtil;
22
23 import static org.junit.jupiter.api.Assertions.assertNotNull;
24
25
26
27
28
29
30 public class SSLServerSocketAppenderBaseTest {
31
32 private MockContext context = new MockContext(ExecutorServiceUtil.newThreadPoolExecutor());
33
34 @SuppressWarnings("rawtypes")
35 private SSLServerSocketAppenderBase appender = new InstrumentedSSLServerSocketAppenderBase();
36
37 @BeforeEach
38 public void setUp() throws Exception {
39 appender.setContext(context);
40 }
41
42 @Test
43 public void testUsingDefaultConfig() throws Exception {
44
45 appender.start();
46 assertNotNull(appender.getServerSocketFactory());
47 appender.stop();
48 }
49
50 private static class InstrumentedSSLServerSocketAppenderBase extends SSLServerSocketAppenderBase<Object> {
51
52 @Override
53 protected void postProcessEvent(Object event) {
54 throw new UnsupportedOperationException();
55 }
56
57 @Override
58 protected PreSerializationTransformer<Object> getPST() {
59 throw new UnsupportedOperationException();
60 }
61
62 }
63
64 }