1 /*
2 * #%L
3 * IsisFish
4 *
5 * $Id: JavadocHelperTest.java 4156 2014-12-09 11:27:18Z echatellier $
6 * $HeadURL: https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.2/src/test/java/fr/ifremer/isisfish/util/JavadocHelperTest.java $
7 * %%
8 * Copyright (C) 2009 - 2012 Ifremer, Code Lutin, Chatellier Eric
9 * %%
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation, either version 3 of the
13 * License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public
21 * License along with this program. If not, see
22 * <http://www.gnu.org/licenses/gpl-3.0.html>.
23 * #L%
24 */
25
26 package fr.ifremer.isisfish.util;
27
28 import java.io.File;
29 import java.io.IOException;
30 import java.io.PrintWriter;
31
32 import org.junit.Assert;
33 import org.junit.Test;
34
35 import fr.ifremer.isisfish.AbstractIsisFishTest;
36 import fr.ifremer.isisfish.IsisFish;
37 import fr.ifremer.isisfish.datastore.SimulationPlanStorage;
38
39 /**
40 * CompileHelperTest.
41 *
42 * Created: 12 janv. 2006 16:20:33
43 *
44 * @author poussin
45 *
46 * @version $Revision: 4156 $
47 *
48 * Last update: $Date: 2014-12-09 12:27:18 +0100 (Tue, 09 Dec 2014) $
49 * by : $Author: echatellier $
50 */
51 public class JavadocHelperTest extends AbstractIsisFishTest {
52
53 /**
54 * Try to generate javadoc on current isis-fish-data directory.
55 * (single java file case)
56 *
57 * @throws IOException
58 * @throws ClassNotFoundException
59 */
60 @Test
61 public void testIsisFishDataJavadoc() throws IOException, ClassNotFoundException {
62
63 File currentDirectory = IsisFish.config.getDatabaseDirectory();
64 File destinationDirectory = new File(getTestDirectory(), "isis-docs");
65 File testJavaFile = new File(currentDirectory, SimulationPlanStorage.SIMULATION_PLAN_PATH
66 + File.separatorChar + "CalibrationSimplexePasVariable2Capturabilite.java");
67
68 PrintWriter out = new PrintWriter(System.out);
69 int result = JavadocHelper.generateJavadoc(currentDirectory, testJavaFile,
70 destinationDirectory, out);
71
72 // 0 = pas d'erreur
73 Assert.assertEquals(0, result);
74 }
75
76 /**
77 * Try to generate javadoc on current isis-fish-data directory.
78 * (all directory java files)
79 *
80 * @throws IOException
81 * @throws ClassNotFoundException
82 */
83 @Test
84 public void testIsisFishDataJavadocAll() throws IOException, ClassNotFoundException {
85
86 File currentDirectory = getCurrentDatabaseDirectory();
87 File destinationDirectory = new File(getTestDirectory(), "isis-docs-all");
88
89 PrintWriter out = new PrintWriter(System.out);
90 int result = JavadocHelper.generateJavadoc(currentDirectory, destinationDirectory, out);
91
92 // 0 = pas d'erreur
93 Assert.assertEquals(0, result);
94 }
95 }