Author: tchemit Date: 2012-03-19 18:07:09 +0100 (Mon, 19 Mar 2012) New Revision: 377 Url: http://forge.codelutin.com/repositories/revision/echobase/377 Log: pass a test in IT Added: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java Removed: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceTest.java Modified: trunk/echobase-services/pom.xml Modified: trunk/echobase-services/pom.xml =================================================================== --- trunk/echobase-services/pom.xml 2012-03-19 16:46:45 UTC (rev 376) +++ trunk/echobase-services/pom.xml 2012-03-19 17:07:09 UTC (rev 377) @@ -226,7 +226,7 @@ </executions> <configuration> <includes> - <include>**/*ImportServiceIT.java</include> + <include>**/*IT.java</include> </includes> </configuration> Copied: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java (from rev 376, trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceTest.java) =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java (rev 0) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java 2012-03-19 17:07:09 UTC (rev 377) @@ -0,0 +1,69 @@ +/* + * #%L + * EchoBase :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.services; + +import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; +import fr.ifremer.echobase.services.importdata.AbstractImportDataServiceIT; +import org.junit.Assert; +import org.junit.Test; +import org.nuiton.util.FileUtil; + +import java.io.File; + +/** + * Test {@link EmbeddedApplicationService}. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class EmbeddedApplicationServiceIT extends EchoBaseTestServiceSupport { + + protected FakeEchoBaseServiceContext initContext() { + return new FakeEchoBaseServiceContext( + AbstractImportDataServiceIT.IMPORT_DATA_ECHOBASE_CATCHES_AND_ACOUSTIC_AND_VOYAGE_RESULT); + } + + @Test + public void testCreateEmbeddedApplication() throws Exception { + EmbeddedApplicationConfiguration conf = new EmbeddedApplicationConfiguration(); + conf.setVoyageIds(getVoyageId()); + + File workingDirectory = new File(getTestDir(), "work-dir"); + FileUtil.createDirectoryIfNecessary(workingDirectory); + conf.setWorkingDirectory(workingDirectory); + File warLocation = new File(workingDirectory, "echobase.war"); + FileUtil.writeString(warLocation, "dummy!"); + conf.setWarLocation(warLocation); + conf.setFileName("echobase"); + EmbeddedApplicationService service = + getService(EmbeddedApplicationService.class); + + File zipFile = service.createEmbeddedApplication(conf); + + Assert.assertTrue(zipFile.exists()); + Assert.assertEquals(100f, conf.getProgression(), 1); + + // TODO Test that embedded db has exactly same number of data than in incoming db + } +} Property changes on: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceTest.java =================================================================== --- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceTest.java 2012-03-19 16:46:45 UTC (rev 376) +++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/EmbeddedApplicationServiceTest.java 2012-03-19 17:07:09 UTC (rev 377) @@ -1,69 +0,0 @@ -/* - * #%L - * EchoBase :: Services - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.services; - -import fr.ifremer.echobase.services.configurations.EmbeddedApplicationConfiguration; -import fr.ifremer.echobase.services.importdata.AbstractImportDataServiceIT; -import org.junit.Assert; -import org.junit.Test; -import org.nuiton.util.FileUtil; - -import java.io.File; - -/** - * Test {@link EmbeddedApplicationService}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.2 - */ -public class EmbeddedApplicationServiceTest extends EchoBaseTestServiceSupport { - - protected FakeEchoBaseServiceContext initContext() { - return new FakeEchoBaseServiceContext( - AbstractImportDataServiceIT.IMPORT_DATA_ECHOBASE_CATCHES_AND_ACOUSTIC_AND_VOYAGE_RESULT); - } - - @Test - public void testCreateEmbeddedApplication() throws Exception { - EmbeddedApplicationConfiguration conf = new EmbeddedApplicationConfiguration(); - conf.setVoyageIds(getVoyageId()); - - File workingDirectory = new File(getTestDir(), "work-dir"); - FileUtil.createDirectoryIfNecessary(workingDirectory); - conf.setWorkingDirectory(workingDirectory); - File warLocation = new File(workingDirectory, "echobase.war"); - FileUtil.writeString(warLocation, "dummy!"); - conf.setWarLocation(warLocation); - conf.setFileName("echobase"); - EmbeddedApplicationService service = - getService(EmbeddedApplicationService.class); - - File zipFile = service.createEmbeddedApplication(conf); - - Assert.assertTrue(zipFile.exists()); - Assert.assertEquals(100f, conf.getProgression(), 1); - - // TODO Test that embedded db has exactly same number of data than in incoming db - } -}