Project

General

Profile

Download (1.61 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.print.out.pdf;
11

    
12
import static org.junit.Assert.assertEquals;
13
import static org.junit.Assert.assertNotNull;
14
import static org.junit.Assert.assertTrue;
15
import org.junit.Ignore;
16
import java.io.File;
17
import java.io.IOException;
18
import java.io.InputStream;
19
import java.net.URISyntaxException;
20
import java.net.URL;
21
import java.util.List;
22

    
23
import org.junit.Test;
24

    
25
import eu.etaxonomy.cdm.print.out.PublishOutputModuleBase;
26

    
27

    
28
/**
29
 * @author n.hoffmann
30
 * @since Jan 11, 2011
31
 * @version 1.0
32
 */
33
 @Ignore
34
public class PdfOutputModuleTest {
35

    
36

    
37
	/**
38
	 * @throws IOException
39
	 *
40
	 */
41
	@Test
42
	public void testGetXslt() throws IOException {
43
		PdfOutputModule outputModule = new PdfOutputModule();
44

    
45
		InputStream xslt = outputModule.getXsltInputStream();
46

    
47
		assertNotNull(xslt);
48
		assertTrue(xslt.available() > 0);
49
	}
50

    
51
	@Test
52
	public void testGetStylesheetByLocation() throws IOException, URISyntaxException{
53
		PdfOutputModule outputModule = new PdfOutputModule();
54

    
55
		URL shippedStylesheetsResource = PublishOutputModuleBase.class.getResource("/stylesheets/pdf/");
56
		File shippedStylesheetsDir = new File(shippedStylesheetsResource.toURI());
57

    
58
		List<File> stylesheets = outputModule.getStylesheetsByLocation(shippedStylesheetsDir);
59

    
60
		assertNotNull("There should be stylesheets", stylesheets);
61
		assertEquals("There should be two stylesheets", 2, stylesheets.size());
62
	}
63

    
64

    
65
}
    (1-1/1)