r2666 - in isis-fish/trunk/src: main/assembly test/java/fr/ifremer/isisfish
Author: chatellier Date: 2009-10-16 15:18:12 +0000 (Fri, 16 Oct 2009) New Revision: 2666 Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisFishMiscTest.java Modified: isis-fish/trunk/src/main/assembly/go.bat Log: Modify windows script (add test to check that file is crlf encoded) Modified: isis-fish/trunk/src/main/assembly/go.bat =================================================================== --- isis-fish/trunk/src/main/assembly/go.bat 2009-10-15 14:10:56 UTC (rev 2665) +++ isis-fish/trunk/src/main/assembly/go.bat 2009-10-16 15:18:12 UTC (rev 2666) @@ -1 +1,19 @@ -java -Xmx1024M -Djava.library.path=jri -DR.type=jni -jar ${project.build.finalName}.${project.packaging} %1 %2 %3 %4 %5 %6 %7 %8 %9 > debug.txt \ No newline at end of file + at echo off + +if NOT "%R_HOME%"=="" GOTO rfound + +:norfound +echo R_HOME not found > debug.txt +goto startisis + +:rfound +set Path=%Path%;%R_HOME%/bin +goto startisis + +:startisis +echo Isis staring... +echo R_HOME = %R_HOME% > debug.txt +java -Xmx512M -Djava.library.path=jri -DR.type=jni -jar ${project.build.finalName}.${project.packaging} %1 %2 %3 %4 %5 %6 %7 %8 %9 >> debug.txt 2>&1 +goto end + +:end Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisFishMiscTest.java =================================================================== --- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisFishMiscTest.java (rev 0) +++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisFishMiscTest.java 2009-10-16 15:18:12 UTC (rev 2666) @@ -0,0 +1,60 @@ +/* *##% + * Copyright (C) 2009 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package fr.ifremer.isisfish; + +import java.io.File; +import java.io.IOException; + +import junit.framework.Assert; + +import org.apache.commons.io.FileUtils; +import org.junit.Test; + +/** + * Misc test on isis config. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class IsisFishMiscTest { + + /** + * Test that go.bat file in clrf valid for windows. + * + * If this test fail, use unix2dos command on unix. + * + * @throws IOException + */ + @Test + public void testCRLFOnBat() throws IOException { + File batFile = new File("src" + File.separator + "main" + File.separator + "assembly" + File.separator + "go.bat"); + + String content = FileUtils.readFileToString(batFile); + System.out.println(content); + String[] lines = content.split("\n"); + + // -1, last line have no \r + for (int index = 0 ; index < lines.length - 1; ++ index) { + Assert.assertTrue("File is not valide for Windows on line " + index, lines[index].endsWith("\r")); + } + } +} Property changes on: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisFishMiscTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL"
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org