Author: tchemit Date: 2009-08-29 17:56:30 +0200 (Sat, 29 Aug 2009) New Revision: 1634 Modified: trunk/src/main/java/org/nuiton/license/header/generator/AbstractLicenseHeaderGenerator.java trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java Log: improve format Modified: trunk/src/main/java/org/nuiton/license/header/generator/AbstractLicenseHeaderGenerator.java =================================================================== --- trunk/src/main/java/org/nuiton/license/header/generator/AbstractLicenseHeaderGenerator.java 2009-08-29 15:29:58 UTC (rev 1633) +++ trunk/src/main/java/org/nuiton/license/header/generator/AbstractLicenseHeaderGenerator.java 2009-08-29 15:56:30 UTC (rev 1634) @@ -27,7 +27,7 @@ @Override public String getHeader(String licenseHeaderContent) { - return openTag + "\n" + linePrefix + " " + openProcessTag + " " + licenseHeaderContent + " " + closeProcessTag + "\n" + linePrefix + " " + closeTag + "\n"; + return openTag + "\n" + linePrefix + " " + openProcessTag + " " + licenseHeaderContent + " " + closeProcessTag + "\n " + closeTag + "\n"; } @Override Modified: trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java =================================================================== --- trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-08-29 15:29:58 UTC (rev 1633) +++ trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-08-29 15:56:30 UTC (rev 1634) @@ -330,9 +330,8 @@ processFile.renameTo(file); } catch (Exception e) { - getLog().error("could not process file " + file + " for reason " + e.getMessage(), e); + getLog().warn("skip file " + file + " (could not process for reason : " + e.getMessage() + ")"); processFile.delete(); - throw new MojoExecutionException("could not treate source file " + file + " for reason : " + e.getMessage(), e); } finally { // toujours cleaner les états du filtre du processeur p.getLicenceFilter().reset(); Modified: trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java =================================================================== --- trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java 2009-08-29 15:29:58 UTC (rev 1633) +++ trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java 2009-08-29 15:56:30 UTC (rev 1634) @@ -1,26 +1,5 @@ package org.nuiton.license.header.plugin; -/** - * *##% Plugin maven de changement de license - * 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>. ##%* - */ - - -import org.nuiton.license.header.plugin.UpdateHeaderPlugin; import java.io.File; import java.io.IOException; import java.util.Map.Entry; @@ -31,12 +10,16 @@ import org.junit.Test; import org.junit.AfterClass; +import org.nuiton.processor.filters.LicenseFilter; import org.nuiton.util.BasePluginTestCase; import org.nuiton.util.PluginHelper; /** @author chemit */ public class UpdateHeaderPluginTest extends BasePluginTestCase { + public static final String _LICENSE_TO_CHANGE_ = LicenseFilter.HEADER + " license to change " + LicenseFilter.FOOTER; + public static final String _MUST_BE_THERE = "// MUST BE THERE!"; + UpdateHeaderPlugin plugin; @BeforeClass @@ -63,7 +46,7 @@ @PluginConfig(pomName = "bug_28.xml", goalName = "update-header") public void testBug_28() throws Exception { - testPom(new String[]{"// MUST BE THERE!"}, new String[]{}); + testPom(new String[]{_MUST_BE_THERE}, new String[]{}); } @@ -71,7 +54,7 @@ @PluginConfig(pomName = "java.xml", goalName = "update-header") public void testJava() throws Exception { - testPom(new String[]{"// MUST BE THERE!"}, new String[]{"*##% license to change ##%*"}); + testPom(new String[]{_MUST_BE_THERE}, new String[]{_LICENSE_TO_CHANGE_}); } @@ -79,7 +62,7 @@ @PluginConfig(pomName = "xml.xml", goalName = "update-header") public void testXml() throws Exception { - testPom(new String[]{"// MUST BE THERE!"}, new String[]{"*##% license to change ##%*"}); + testPom(new String[]{_MUST_BE_THERE}, new String[]{_LICENSE_TO_CHANGE_}); } @@ -87,7 +70,7 @@ @PluginConfig(pomName = "properties.xml", goalName = "update-header") public void testProperties() throws Exception { - testPom(new String[]{"// MUST BE THERE!"}, new String[]{"*##% license to change ##%*"}); + testPom(new String[]{_MUST_BE_THERE}, new String[]{_LICENSE_TO_CHANGE_}); }