1 /* 2 * Copyright 2010-2013 smartics, Kronseder & Reiner GmbH 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package de.smartics.testdoc.maven.export.sink; 17 18 import java.io.IOException; 19 import java.util.List; 20 21 import de.smartics.maven.util.report.MessageHelper; 22 import de.smartics.testdoc.maven.export.AbstractOutputManager; 23 import de.smartics.testdoc.core.doc.UnitTestDoc; 24 import de.smartics.testdoc.report.index.ExportIndex; 25 26 /** 27 * Export {@link UnitTestDoc} information to a sink. 28 * 29 * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a> 30 * @version $Revision:591 $ 31 */ 32 public class SinkOutputManager extends AbstractOutputManager 33 { 34 // ********************************* Fields ********************************* 35 36 // --- constants ------------------------------------------------------------ 37 38 // --- members -------------------------------------------------------------- 39 40 // ****************************** Initializer ******************************* 41 42 // ****************************** Constructors ****************************** 43 44 /** 45 * Default constructor. 46 * 47 * @param messages the resource bundles with messages to display as labels in 48 * the generated report. 49 * @param exporter the exporter that knows the format of the file to be 50 * written. 51 */ 52 public SinkOutputManager(final String reportName, 53 final MessageHelper messages, final SinkExporter exporter, 54 final List<ExportIndex> exportIndices) 55 { 56 super(reportName, messages, exporter, exportIndices); 57 } 58 59 // ****************************** Inner Classes ***************************** 60 61 // ********************************* Methods ******************************** 62 63 // --- init ----------------------------------------------------------------- 64 65 // --- get&set -------------------------------------------------------------- 66 67 // --- business ------------------------------------------------------------- 68 69 /** 70 * {@inheritDoc} 71 * 72 * @see de.smartics.testdoc.report.doc.OutputManager#finish() 73 */ 74 @Override 75 public void finish() throws IOException 76 { 77 final TestDocPageRenderer renderer = 78 new TestDocPageRenderer(reportName, messages, (SinkExporter) exporter); 79 renderer.renderPage(index, testDocs); 80 } 81 82 // --- object basics -------------------------------------------------------- 83 84 }