PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/sigmah/src/test/java/org/sigmah/server/report/renderer/html/PivotTableHtmlRendererTest.java

http://sigma-h.googlecode.com/
Java | 65 lines | 22 code | 15 blank | 28 comment | 0 complexity | b393e0a70b2278f0b8aa2a62a5ca199b MD5 | raw file
 1/*
 2 * All Sigmah code is released under the GNU General Public License v3
 3 * See COPYRIGHT.txt and LICENSE.txt.
 4 */
 5
 6package org.sigmah.server.report.renderer.html;
 7
 8import org.junit.Test;
 9import org.sigmah.server.report.DummyPivotTableData;
10import org.sigmah.server.report.util.HtmlWriter;
11import org.sigmah.shared.report.model.PivotTableElement;
12import org.xml.sax.SAXException;
13
14import javax.xml.parsers.ParserConfigurationException;
15import java.io.IOException;
16
17import static org.easymock.EasyMock.createMock;
18import static org.easymock.EasyMock.replay;
19
20/**
21 * @author Alex Bertram (akbertram@gmail.com)
22 */
23public class PivotTableHtmlRendererTest {
24
25    @Test
26    public void test() throws IOException, SAXException, ParserConfigurationException {
27
28        // input
29        DummyPivotTableData testData = new DummyPivotTableData();
30        PivotTableElement element = testData.Foobar1612Element();
31
32        // collaborator: ImageStorageProvider
33        ImageStorageProvider isp = createMock(ImageStorageProvider.class);
34        replay(isp); // no calls expected
35
36        // output stream  (we need well-formed html for the test)
37        HtmlWriter writer = new HtmlWriter();
38
39        // CLASS under TEST
40        HtmlPivotTableRenderer renderer = new HtmlPivotTableRenderer();
41        renderer.render(writer, isp, element);
42
43        // VALIDATE
44        // TODO
45//        Document document;
46//		DocumentBuilderFactory factory =
47//			        DocumentBuilderFactory.newInstance();
48//
49//
50//        DocumentBuilder builder = factory.newDocumentBuilder();
51//        builder.setEntityResolver(new EntityResolver() {
52//            @Override
53//            public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
54//                return new InputSource(new StringReader(""));
55//            }
56//        });
57//
58//        document = builder.parse(new InputSource(new StringReader(writer.toString())));
59//
60        
61    }
62
63
64
65}