|
7 | 7 | import java.io.Reader;
|
8 | 8 |
|
9 | 9 | import org.fugerit.java.core.cfg.ConfigException;
|
| 10 | +import org.fugerit.java.core.function.SafeFunction; |
10 | 11 | import org.fugerit.java.core.lang.helpers.ClassHelper;
|
11 | 12 | import org.fugerit.java.doc.base.config.DocConfig;
|
| 13 | +import org.fugerit.java.doc.base.config.DocOutput; |
12 | 14 | import org.fugerit.java.doc.base.process.DocProcessContext;
|
| 15 | +import org.fugerit.java.doc.base.process.DocProcessData; |
13 | 16 | import org.fugerit.java.doc.freemarker.config.FreeMarkerConfigStep;
|
| 17 | +import org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlTypeHandlerUTF8; |
14 | 18 | import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfig;
|
15 | 19 | import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfigFacade;
|
16 | 20 | import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfigValidator;
|
@@ -69,6 +73,7 @@ public void testConfigRead002() {
|
69 | 73 | FreemarkerDocProcessConfigFacade.loadConfigSafe( "cl://fj_doc_test/freemarker-doc-process_alt.xml" );
|
70 | 74 | Assert.assertNotNull( config );
|
71 | 75 | this.templateTesting(config);
|
| 76 | + log.info( "keys : {}", config.getKeys() ); |
72 | 77 | }
|
73 | 78 |
|
74 | 79 | @Test
|
@@ -100,4 +105,24 @@ public void testNewSimpleConfigVersion() {
|
100 | 105 | }
|
101 | 106 | }
|
102 | 107 |
|
| 108 | + @Test |
| 109 | + public void testProcess() { |
| 110 | + SafeFunction.apply( () -> { |
| 111 | + FreemarkerDocProcessConfig config = FreemarkerDocProcessConfigFacade.newSimpleConfig( "simple-config-003", "/fj_doc_test/template/" ); |
| 112 | + // test full process |
| 113 | + try ( ByteArrayOutputStream baos = new ByteArrayOutputStream() ) { |
| 114 | + DocProcessData data = config.fullProcess( "test_02" , |
| 115 | + DocProcessContext.newContext(), FreeMarkerHtmlTypeHandlerUTF8.HANDLER, DocOutput.newOutput(baos) ); |
| 116 | + Assert.assertNotEquals( 0 , data.getCurrentXmlData().length() ); |
| 117 | + } |
| 118 | + // test process 1 |
| 119 | + try ( ByteArrayOutputStream baos = new ByteArrayOutputStream() ) { |
| 120 | + DocProcessData data = new DocProcessData(); |
| 121 | + config.process( "test_02" , DocProcessContext.newContext(), data, FreeMarkerHtmlTypeHandlerUTF8.HANDLER, DocOutput.newOutput(baos) ); |
| 122 | + Assert.assertNotEquals( 0 , data.getCurrentXmlData().length() ); |
| 123 | + } |
| 124 | + } ); |
| 125 | + } |
| 126 | + |
| 127 | + |
103 | 128 | }
|
0 commit comments