Author: tchemit Date: 2008-12-05 16:03:26 +0000 (Fri, 05 Dec 2008) New Revision: 1247 Added: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java Removed: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestService.java topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceImpl.java topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceServer.java topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceTestCase.java Modified: topia/trunk/topia-soa/changelog topia/trunk/topia-soa/pom.xml topia/trunk/topia-soa/src/test/resources/TopiaApplicationServices.properties Log: do not name with Test classes which are not tests... test migrate in JUnit4, but not working... require a jetty instance for test ? Modified: topia/trunk/topia-soa/changelog =================================================================== --- topia/trunk/topia-soa/changelog 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/changelog 2008-12-05 16:03:26 UTC (rev 1247) @@ -1,2 +1,2 @@ 2.1.0 ?? 200812?? -* 20081205 [chemit] - improve poms, use lutinproject 3.2 \ No newline at end of file +* 20081205 [chemit] - improve poms, use lutinproject 3.2, tests in JUnit4 but ignore because must be redone! \ No newline at end of file Modified: topia/trunk/topia-soa/pom.xml =================================================================== --- topia/trunk/topia-soa/pom.xml 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/pom.xml 2008-12-05 16:03:26 UTC (rev 1247) @@ -74,6 +74,7 @@ <groupId>jetty</groupId> <artifactId>jetty</artifactId> <version>5.1.10</version> + <scope>test</scope> </dependency> <!-- Dependencies for class generation --> Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java (from rev 1240, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestService.java) =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java (rev 0) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -0,0 +1,41 @@ +/* *##% ToPIA - Tools for Portable and Independent Architecture + * Copyright (C) 2004 - 2008 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.codelutin.topia.service; + +import org.codelutin.topia.TopiaException; + +/** + * TestService.java + * <p/> + * Genere par Topia ! + * + * @author chatellier + * @version $Revision$ + * <p/> + * Last update : $Date$ By : $Author$ + */ +public interface TaistService extends TopiaApplicationService { + + /** + * Declaration d'un service + * + * @param name le nom + * @return hello + */ + public String sayHello(String name) throws TopiaException; +} Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java (from rev 1240, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceImpl.java) =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java (rev 0) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -0,0 +1,61 @@ +/* *##% ToPIA - Tools for Portable and Independent Architecture + * Copyright (C) 2004 - 2008 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.codelutin.topia.service; + +import org.codelutin.topia.service.TopiaApplicationServiceAbstract; + +/** + * TestServiceImpl.java + * + * Developpe par le programmeur ! + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ By : $Author$ + */ +public class TaistServiceImpl extends TopiaApplicationServiceAbstract implements + TaistService { + + private String prefix; + + private static int nb = 0; + + public TaistServiceImpl() { + this.prefix = "Salut"; + nb = nb + 1; + } + + /** + * + * @param prefix + */ + public TaistServiceImpl(String prefix) { + this(); + this.prefix = prefix; + } + + /* + * (non-Javadoc) + * + * @see service.TaistService#sayHello(java.lang.String) + */ + public String sayHello(String name) { + return prefix + " " + name + " (instance " + nb + ")"; + } +} Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java (from rev 1240, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceServer.java) =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java (rev 0) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -0,0 +1,57 @@ +/* *##% ToPIA - Tools for Portable and Independent Architecture + * Copyright (C) 2004 - 2008 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.codelutin.topia.service; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * TopiaServiceServer.java + * <p/> + * Class main chargee de lire le fichier de configuration et de lancer les + * serveurs, pour les protocoles definit. + * + * @author chatellier + * @version $Revision$ + * <p/> + * Last update : $Date$ By : $Author$ + */ +public class TaistServiceServer { + + /** Logger (common logging) */ + private static final Log logger = LogFactory + .getLog(TaistServiceServer.class); + + /** + * Main. Demarre les serveurs. + * + * @param args arguments + */ + public static void main(String... args) { + + // TaistService ts = new TaistServiceImpl("Bonjour"); + // TopiaServiceFactory.addService(TaistService.class, ts , + // Protocole.XML_RPC); + //TopiaServiceFactory.addService(TaistService.class, + // TaistServiceImpl.class, Protocole.XML_RPC); + TopiaApplicationServiceFactory.addService(TaistService.class, + TaistServiceImpl.class, Protocol.SOAP); + + logger.info("Service TaistService added..."); + } +} Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java (from rev 1240, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceTestCase.java) =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java (rev 0) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -0,0 +1,77 @@ +/* *##% ToPIA - Tools for Portable and Independent Architecture + * Copyright (C) 2004 - 2008 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.codelutin.topia.service; + +import org.codelutin.topia.TopiaException; +import org.codelutin.topia.TopiaNotFoundException; +import org.junit.Assert; +import org.junit.Test; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * TestServiceTestCase.java + * <p/> + * Test junit du service. + * <p/> + * Il faut lancer les serveurs avant ce test + * + * @author chatellier + * @version $Revision$ + * <p/> + * Last update : $Date$ By : $Author$ + * @see TaistServiceServer + */ +public class TaistServiceTest extends Assert { + + @BeforeClass + public static void beforeClass() { + //one dayit will works :) + //TaistServiceServer.main(); + } + + /** Test de la methode say hello */ + @Ignore + //@Test + public void testSayHello() { + + String reponse = null; + + TaistService testService; + try { + testService = TopiaApplicationServiceFactory + .getService(TaistService.class); + + String myName = "eric"; + + reponse = testService.sayHello(myName); + + System.out.println("TaistService says : " + reponse); + } catch (TopiaNotFoundException e) { + System.err + .println("TopiaNotFoundException: erreur du fichier de configuration"); + } catch (TopiaException e) { + System.err + .println("TopiaException: impossible d'instancier le service"); + } + + assertNotNull(reponse); + } +} Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestService.java =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestService.java 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestService.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -1,42 +0,0 @@ -/* *##% ToPIA - Tools for Portable and Independent Architecture - * Copyright (C) 2004 - 2008 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.codelutin.topia.service; - -import org.codelutin.topia.TopiaException; -import org.codelutin.topia.service.TopiaApplicationService; - -/** - * TestService.java - * - * Genere par Topia ! - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ By : $Author$ - */ -public interface TestService extends TopiaApplicationService { - - /** - * Declaration d'un service - * - * @param name - * le nom - */ - public String sayHello(String name) throws TopiaException; -} Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceImpl.java =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceImpl.java 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceImpl.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -1,65 +0,0 @@ -/* *##% ToPIA - Tools for Portable and Independent Architecture - * Copyright (C) 2004 - 2008 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.codelutin.topia.service; - -import org.codelutin.topia.service.TopiaApplicationServiceAbstract; - -/** - * TestServiceImpl.java - * - * Developpe par le programmeur ! - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ By : $Author$ - */ -public class TestServiceImpl extends TopiaApplicationServiceAbstract implements - TestService { - - private String prefix; - - private static int nb = 0; - - /** - * - * @param prefix - */ - public TestServiceImpl() { - this.prefix = "Salut"; - nb = nb + 1; - } - - /** - * - * @param prefix - */ - public TestServiceImpl(String prefix) { - this(); - this.prefix = prefix; - } - - /* - * (non-Javadoc) - * - * @see service.TestService#sayHello(java.lang.String) - */ - public String sayHello(String name) { - return prefix + " " + name + " (instance " + nb + ")"; - } -} Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceServer.java =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceServer.java 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceServer.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -1,60 +0,0 @@ -/* *##% ToPIA - Tools for Portable and Independent Architecture - * Copyright (C) 2004 - 2008 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.codelutin.topia.service; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.service.Protocol; -import org.codelutin.topia.service.TopiaApplicationServiceFactory; - -/** - * TopiaServiceServer.java - * - * Class main chargee de lire le fichier de configuration et de lancer les - * serveurs, pour les protocoles d�finit. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ By : $Author$ - */ -public class TestServiceServer { - - /** Logger (common logging) */ - private static final Log logger = LogFactory - .getLog(TestServiceServer.class); - - /** - * Main. Demarre les serveurs. - * - * @param args - * arguments - */ - public static void main(String args[]) { - - // TestService ts = new TestServiceImpl("Bonjour"); - // TopiaServiceFactory.addService(TestService.class, ts , - // Protocole.XML_RPC); - //TopiaServiceFactory.addService(TestService.class, - // TestServiceImpl.class, Protocole.XML_RPC); - TopiaApplicationServiceFactory.addService(TestService.class, - TestServiceImpl.class, Protocol.SOAP); - - logger.info("Service TestService added..."); - } -} Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceTestCase.java =================================================================== --- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceTestCase.java 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TestServiceTestCase.java 2008-12-05 16:03:26 UTC (rev 1247) @@ -1,68 +0,0 @@ -/* *##% ToPIA - Tools for Portable and Independent Architecture - * Copyright (C) 2004 - 2008 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.codelutin.topia.service; - -import junit.framework.TestCase; - -import org.codelutin.topia.TopiaException; -import org.codelutin.topia.TopiaNotFoundException; -import org.codelutin.topia.service.TopiaApplicationServiceFactory; - -/** - * TestServiceTestCase.java - * - * Test junit du service. - * - * Il faut lancer les serveurs avant ce test - * @see org.codelutin.topia.service.TestServiceServer - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ By : $Author$ - */ -public class TestServiceTestCase extends TestCase { - - /** - * Test de la methode say hello - */ - public void testSayHello() { - - String reponse = null; - - TestService testService; - try { - testService = TopiaApplicationServiceFactory - .getService(TestService.class); - - String myName = "eric"; - - reponse = testService.sayHello(myName); - - System.out.println("TestService says : " + reponse); - } catch (TopiaNotFoundException e) { - System.err - .println("TopiaNotFoundException: erreur du fichier de configuration"); - } catch (TopiaException e) { - System.err - .println("TopiaException: impossible d'instancier le service"); - } - - assertNotNull(reponse); - } -} Modified: topia/trunk/topia-soa/src/test/resources/TopiaApplicationServices.properties =================================================================== --- topia/trunk/topia-soa/src/test/resources/TopiaApplicationServices.properties 2008-12-05 16:02:29 UTC (rev 1246) +++ topia/trunk/topia-soa/src/test/resources/TopiaApplicationServices.properties 2008-12-05 16:03:26 UTC (rev 1247) @@ -1,6 +1,6 @@ # test du fichier de definition des services -#topia.application.service.org.codelutin.topia.service.TestService=local://org.codelutin.topia.service.TestServiceImpl/#new -#topia.application.service.org.codelutin.topia.service.TestService=rmi://localhost:1099 -#topia.application.service.org.codelutin.topia.service.TestService=xml-rpc://localhost:9090 -#topia.application.service.org.codelutin.topia.service.TestService=rmi://localhost:1099 -topia.application.service.org.codelutin.topia.service.TestService=soap://localhost:8888 \ No newline at end of file +#topia.application.service.org.codelutin.topia.service.TaistServicee=local://org.codelutin.topia.service.TaistServiceImpll/#new +#topia.application.service.org.codelutin.topia.service.TaistServicee=rmi://localhost:1099 +#topia.application.service.org.codelutin.topia.service.TaistServicee=xml-rpc://localhost:9090 +#topia.application.service.org.codelutin.topia.service.TaistServicee=rmi://localhost:1099 +topia.application.service.org.codelutin.topia.service.TaistService=soap://localhost:8888 \ No newline at end of file