Author: tchemit Date: 2009-09-27 22:12:45 +0200 (Sun, 27 Sep 2009) New Revision: 1652 Removed: trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java trunk/src/test/resources/LicenseProcessorTest.java2 trunk/src/test/resources/LicenseProcessorTest_1.java2 Modified: trunk/pom.xml Log: - move LicenseProcessorTest to nuiton-processor lib - use javadoc plugin 2.6 Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-09-27 19:05:50 UTC (rev 1651) +++ trunk/pom.xml 2009-09-27 20:12:45 UTC (rev 1652) @@ -261,7 +261,7 @@ <properties> <processor.version>1.0.1-SNAPSHOT</processor.version> - + <javadoc.version>2.6</javadoc.version> </properties> <build> Deleted: trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java =================================================================== --- trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java 2009-09-27 19:05:50 UTC (rev 1651) +++ trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java 2009-09-27 20:12:45 UTC (rev 1652) @@ -1,108 +0,0 @@ -/* - * *##% - * Maven License Plugin - * Copyright (C) 2008 - 2009 CodeLutin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * ##%* - */ -package org.nuiton.license.header; - -import org.nuiton.processor.LicenseProcessor; -import java.io.File; -import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.Before; -import org.junit.BeforeClass; - -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.nuiton.plugin.TestHelper; -import org.nuiton.util.PluginHelper; - -/** - * - * @author chemit - * @since 1.0.1 - */ -public class LicenseProcessorTest { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private final Log log = LogFactory.getLog(LicenseProcessorTest.class); - static File basedir; - static File testdir; - - @BeforeClass - public static void initClass() throws Exception { - basedir = TestHelper.getBasedir(); - testdir = TestHelper.getFile(basedir, "target", "tests", LicenseProcessorTest.class.getSimpleName()); - testdir.mkdirs(); - } - - @AfterClass - public static void afterClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - } - - @Test - public void testProcessor() throws IOException { - - File in = TestHelper.getFile(basedir, "src", "test", "resources", "LicenseProcessorTest.java2"); - File out = TestHelper.getFile(testdir, in.getName()); - LicenseProcessor processor = new LicenseProcessor("my license"); - processor.process(in, out); - String content = PluginHelper.readAsString(out, "utf-8"); - if (log.isDebugEnabled()) { - log.debug("output : " + out); - log.debug(content); - } - checkPattern("// MUST BE THERE!", true, out); - checkPattern("my license", false, out); - } - - @Test - public void testProcessor2() throws IOException { - - File in = TestHelper.getFile(basedir, "src", "test", "resources", "LicenseProcessorTest_1.java2"); - File out = new File(testdir, in.getName()); - LicenseProcessor processor = new LicenseProcessor("my license"); - processor.process(in, out); - String content = PluginHelper.readAsString(out, "utf-8"); - if (log.isDebugEnabled()) { - log.debug("output : " + out); - log.debug(content); - } - checkPattern("// MUST BE THERE!", true, out); - checkPattern("my license", true, out); - } - - protected void checkPattern(String pattern, boolean required, File f) throws IOException { - - if (log.isDebugEnabled()) { - log.debug("check generated file " + f); - } - - Assert.assertTrue("generated file " + f + " was not found...", f.exists()); - String content = PluginHelper.readAsString(f, "utf-8"); - - String errorMessage = required ? "could not find the pattern : " : "should not have found pattern :"; - Assert.assertEquals(errorMessage + pattern + " in file " + f, required, content.contains(pattern)); - } -} Deleted: trunk/src/test/resources/LicenseProcessorTest.java2 =================================================================== --- trunk/src/test/resources/LicenseProcessorTest.java2 2009-09-27 19:05:50 UTC (rev 1651) +++ trunk/src/test/resources/LicenseProcessorTest.java2 2009-09-27 20:12:45 UTC (rev 1652) @@ -1,10 +0,0 @@ -/** - * *##% YO - * ##% yy - */ - -public class LicenceProcessorTest { - - -// MUST BE THERE! -} \ No newline at end of file Deleted: trunk/src/test/resources/LicenseProcessorTest_1.java2 =================================================================== --- trunk/src/test/resources/LicenseProcessorTest_1.java2 2009-09-27 19:05:50 UTC (rev 1651) +++ trunk/src/test/resources/LicenseProcessorTest_1.java2 2009-09-27 20:12:45 UTC (rev 1652) @@ -1,10 +0,0 @@ -/** - * *##% YO - * ##%* yy - */ - -public class LicenceProcessorTest { - - -// MUST BE THERE! -} \ No newline at end of file