View Javadoc
1   package org.kuali.ole.docstore.model.xmlpojo.config;
2   
3   import org.junit.Test;
4   import org.kuali.ole.docstore.xstream.BaseTestCase;
5   import org.slf4j.Logger;
6   import org.slf4j.LoggerFactory;
7   
8   /**
9    * Created with IntelliJ IDEA.
10   * User: ?
11   * Date: ?
12   * Time: ?
13   * To change this template use File | Settings | File Templates.
14   */
15  public class ObjectFactory_UT extends BaseTestCase {
16      private static final Logger LOG = LoggerFactory.getLogger(ObjectFactory_UT.class);
17  
18      @Test
19      public void testObjectFactory() throws Exception {
20          ObjectFactory objectFactory = new ObjectFactory();
21          if (objectFactory.createDocumentConfig() != null) {
22              LOG.info(objectFactory.createDocumentConfig().toString());
23          }
24          Mapping mapping = objectFactory.createMapping();
25          DocumentType documentType = objectFactory.createDocumentType();
26          Field field = objectFactory.createField();
27          DocumentCategory documentCategory = objectFactory.createDocumentCategory();
28          DocumentFormat documentFormat = objectFactory.createDocumentFormat();
29          mapping.setExclude("exclude");
30          mapping.setInclude("include");
31          mapping.setType("type");
32          if (mapping.getExclude() != null) {
33              LOG.info(mapping.getExclude());
34          }
35          if (mapping.getInclude() != null) {
36              LOG.info(mapping.getInclude());
37          }
38          if (mapping.getType() != null) {
39              LOG.info(mapping.getType());
40          }
41          field.setMapping(mapping);
42          field.setId("240");
43          field.setName("name");
44          field.setType("type");
45          if (field.getId() != null) {
46              LOG.info(field.getId());
47          }
48          if (field.getName() != null) {
49              LOG.info(field.getName());
50          }
51          if (field.getType() != null) {
52              LOG.info(field.getType());
53          }
54          if (field.getMapping() != null) {
55              LOG.info(field.getMapping().toString());
56          }
57          documentFormat.setName("name");
58          documentFormat.setId("345");
59          documentCategory.setName("name");
60          documentCategory.setId("id");
61          documentType.setId("678");
62          documentType.setName("name");
63          if (documentType.getDocumentFormats() != null) {
64              for (DocumentFormat documentFormat1 : documentType.getDocumentFormats()) {
65                  LOG.info(documentFormat1.toString());
66              }
67  
68          }
69      }
70  
71  }