View Javadoc
1   package ch.qos.logback.classic.model;
2   
3   import ch.qos.logback.core.model.ImportModel;
4   import ch.qos.logback.core.model.Model;
5   import org.junit.jupiter.api.Test;
6   
7   import static org.junit.jupiter.api.Assertions.assertEquals;
8   
9   public class ModelDuplicationTest {
10  
11      @Test
12      public void smoke() {
13          ConfigurationModel cm = new ConfigurationModel();
14          cm.setDebugStr("x");
15          Model copy = Model.duplicate(cm);
16          assertEquals(cm, copy);
17      }
18  
19      @Test
20      public void test() {
21          ConfigurationModel cm = new ConfigurationModel();
22          cm.setDebugStr("x");
23          
24          ImportModel importModel = new ImportModel();
25          importModel.setClassName("a");
26  
27          cm.addSubModel(importModel);
28          
29          Model copy = Model.duplicate(cm);
30          assertEquals(cm, copy);
31      }
32      
33      
34      
35  }