r1242 - in topia/trunk: . src/site topia-persistence topia-persistence/src/main/java/org/codelutin/topia/framework topia-persistence/src/test/java topia-persistence/src/test/java/org/codelutin/topia topia-persistence/src/test/java/org/codelutin/topia/framework topia-soa topia-ui
Author: tchemit Date: 2008-12-04 23:33:31 +0000 (Thu, 04 Dec 2008) New Revision: 1242 Added: topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/TopiaUtilTest.java Removed: topia/trunk/topia-persistence/src/test/java/topia/ Modified: topia/trunk/changelog topia/trunk/pom.xml topia/trunk/src/site/site.xml topia/trunk/topia-persistence/pom.xml topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/framework/TopiaUtil.java topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/TopiaContextTest.java topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/EntityStateTest.java topia/trunk/topia-soa/pom.xml topia/trunk/topia-ui/pom.xml Log: - improve poms, use lutinproject 3.2 - use JUnit4 for test, fix some tests (but not all). - add some usefull method to build regex on topiaIds Modified: topia/trunk/changelog =================================================================== --- topia/trunk/changelog 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/changelog 2008-12-04 23:33:31 UTC (rev 1242) @@ -1,4 +1,7 @@ ver-2-1 chatellier 20081118 + * 20081205 - improve poms, use lutinproject 3.2 + - use JUnit4 for test, fix some tests (but not all). + - add some usefull method to build regex on topiaIds * 20081118 Switch to multi module project ver-2-0-29 chatellier 20081117 Modified: topia/trunk/pom.xml =================================================================== --- topia/trunk/pom.xml 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/pom.xml 2008-12-04 23:33:31 UTC (rev 1242) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -9,69 +10,35 @@ <parent> <groupId>org.codelutin</groupId> <artifactId>lutinproject</artifactId> - <version>3.1</version> + <version>3.2</version> </parent> <artifactId>topia</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> - <modules> + <modules> <module>topia-persistence</module> <module>topia-soa</module> <module>topia-ui</module> </modules> - <dependencyManagement> + <dependencyManagement> <dependencies> <dependency> <groupId>org.codelutin</groupId> <artifactId>lutingenerator</artifactId> - <version>0.62-SNAPSHOT</version> + <version>${generator.version}</version> <scope>provided</scope> </dependency> <dependency> - <groupId>org.codelutin</groupId> - <artifactId>lutinutil</artifactId> - <version>0.31</version> - <scope>compile</scope> - </dependency> - </dependencies> + <groupId>org.codelutin</groupId> + <artifactId>lutinutil</artifactId> + <version>${lutinutil.version}</version> + <scope>compile</scope> + </dependency> + </dependencies> </dependencyManagement> - - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.codelutin</groupId> - <artifactId>maven-processor-plugin</artifactId> - <version>0.16</version> - <executions> - <execution> - <phase>generate-sources</phase> - <goals> - <goal>process</goal> - </goals> - </execution> - </executions> - <configuration> - <!-- You might change defaut directories --> - <!-- srcDir>${basedir}/src/main/java</srcDir> - <destDir>${basedir}/target/processed-sources/java</destDir--> - <addCompileDirectory>true</addCompileDirectory> - <includes> - <include>**/*.java</include> - </includes> - <filters> - org.codelutin.processor.filters.GeneratorTemplatesFilter, - org.codelutin.processor.filters.ActiveLogsCodeFilter - </filters> - <verbose>${maven.verbose}</verbose> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> - + <!-- ************************************************************* --> <!-- *** Project Information ************************************* --> <!-- ************************************************************* --> @@ -91,22 +58,64 @@ <!-- nom du projet sur le labs --> <labs.project>topia</labs.project> - - <!-- Don't test for now --> - <maven.test.skip>true</maven.test.skip> - <!-- child SCM properties --> - <maven.scm.url.child> - http://${labs.host}/plugins/scmsvn/viewcvs.php/${labs.project}/trunk/${pom.artifactId}/?root=${labs.project} - </maven.scm.url.child> - <maven.scm.developerConnection.child> - scm:svn:svn+ssh://${username}@${labs.host}/svnroot/${labs.project}/${labs.project}/trunk/${pom.artifactId} - </maven.scm.developerConnection.child> - <maven.scm.connection.child> - scm:svn:svn://anonymous@${labs.host}/svnroot/${labs.project}/${labs.project}/trunk/${pom.artifactId} - </maven.scm.connection.child> + <!-- Ignore failure test for now --> + <maven.test.testFailureIgnore>true</maven.test.testFailureIgnore> + + <!-- generator version --> + <generator.version>0.62-SNAPSHOT</generator.version> + + <!-- processor version --> + <processor.version>0.16</processor.version> + + <!-- lutinutil version --> + <lutinutil.version>0.31</lutinutil.version> + </properties> + <build> + <defaultGoal>install</defaultGoal> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codelutin</groupId> + <artifactId>maven-processor-plugin</artifactId> + <version>${processor.version}</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>process</goal> + </goals> + </execution> + </executions> + <configuration> + <!-- You might change defaut directories --> + <!-- srcDir>${basedir}/src/main/java</srcDir> + <destDir>${basedir}/target/processed-sources/java</destDir--> + <addCompileDirectory>true</addCompileDirectory> + <includes> + <include>**/*.java</include> + </includes> + <filters> + org.codelutin.processor.filters.GeneratorTemplatesFilter, + org.codelutin.processor.filters.ActiveLogsCodeFilter + </filters> + <verbose>${maven.verbose}</verbose> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + + </plugins> + </build> + <!-- ************************************************************* --> <!-- *** Build Environment ************************************** --> <!-- ************************************************************* --> Modified: topia/trunk/src/site/site.xml =================================================================== --- topia/trunk/src/site/site.xml 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/src/site/site.xml 2008-12-04 23:33:31 UTC (rev 1242) @@ -28,7 +28,7 @@ <body> <links> - <item name="ToPIA Service" href="http://topia.labs.libre-entreprise.org/topia-service"/> + <item name="ToPIA Service" href="../topia-service"/> <item name="Labs" href="http://labs.libre-entreprise.org/"/> <item name="Code Lutin" href="http://www.codelutin.com/"/> </links> Modified: topia/trunk/topia-persistence/pom.xml =================================================================== --- topia/trunk/topia-persistence/pom.xml 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/topia-persistence/pom.xml 2008-12-04 23:33:31 UTC (rev 1242) @@ -15,7 +15,6 @@ <groupId>org.codelutin.topia</groupId> <artifactId>topia-persistence</artifactId> - <version>2.1.0-SNAPSHOT</version> <dependencies> @@ -60,7 +59,7 @@ <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> - <version>1.1.103</version> + <version>1.1.104</version> <scope>test</scope> </dependency> </dependencies> @@ -71,8 +70,7 @@ <name>ToPIA - Persistence</name> <description>Hibernate based persistence module</description> - <inceptionYear>2004</inceptionYear> - + <!-- ************************************************************* --> <!-- *** Build Settings ****************************************** --> <!-- ************************************************************* --> @@ -80,6 +78,7 @@ <packaging>jar</packaging> <build> + <defaultGoal>install</defaultGoal> <plugins> <plugin> Modified: topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/framework/TopiaUtil.java =================================================================== --- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/framework/TopiaUtil.java 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/framework/TopiaUtil.java 2008-12-04 23:33:31 UTC (rev 1242) @@ -17,31 +17,31 @@ /******************************************************************************* * TopiaUtil.java - * + * * Created: 28 déc. 2005 20:28:57 - * + * * @author poussin - * + * * @version $Revision$ - * + * * Last update: $Date$ by : $Author$ */ package org.codelutin.topia.framework; -import java.net.URL; -import java.util.Properties; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codelutin.topia.TopiaNotFoundException; +import org.codelutin.topia.persistence.TopiaEntity; import org.codelutin.util.RecursiveProperties; import org.codelutin.util.Resource; -/** - * @author poussin - * - */ +import java.net.URL; +import java.util.Properties; +import java.util.StringTokenizer; +import java.util.regex.Pattern; + +/** @author poussin */ public class TopiaUtil { /** to use log facility, just put in your code: log.info(\"...\"); */ @@ -49,13 +49,13 @@ /** * Permet de récupérer le fichier de propriété ayant le nom passé - * en argument. - * + * en argument. + * * @param pathOrUrl le nom du fichier de propriété à charger, s'il est null - * ou vide retourne un objet Properties vide. + * ou vide retourne un objet Properties vide. * @return Un nouvel objet de propriete * @throws TopiaNotFoundException Si pathOrUrl n'est pas null ou vide et que - * le fichier devant contenir les propriétés n'est pas retrouvé. + * le fichier devant contenir les propriétés n'est pas retrouvé. */ static public Properties getProperties(String pathOrUrl) throws TopiaNotFoundException { @@ -64,14 +64,14 @@ /** * Permet de récupérer le fichier de propriété ayant le nom passé - * en argument. - * - * @param parent l'objet properties utilisé comme parent de l'objet retourné + * en argument. + * + * @param parent l'objet properties utilisé comme parent de l'objet retourné * @param pathOrUrl le nom du fichier de propriété à charger, s'il est null - * ou vide retourne un objet Properties vide. + * ou vide retourne un objet Properties vide. * @return Un nouvel objet de propriete * @throws TopiaNotFoundException Si pathOrUrl n'est pas null ou vide et que - * le fichier devant contenir les propriétés n'est pas retrouvé. + * le fichier devant contenir les propriétés n'est pas retrouvé. */ static public Properties getProperties(Properties parent, String pathOrUrl) throws TopiaNotFoundException { @@ -92,4 +92,44 @@ return result; } + /** + * Compute a regex pattern given a format string. + * <p/> + * A {@link String#format(String, Object[])} will be apply to <code>format</code>, with + * for parameters the list of <code>klass</code> transformed in topia pattern via method + * {@link #getTopiaIdPattern(Class)}. + * + * @param format the format + * @param klass the list of class to use + * @return the pattern computed + */ + public static Pattern getTopiaPattern(String format, Class<? extends TopiaEntity>... klass) { + String[] entityPatterns = new String[klass.length]; + for (int i = 0; i < klass.length; i++) { + Class<? extends TopiaEntity> klas = klass[i]; + entityPatterns[i] = getTopiaIdPattern(klas); + } + String s = String.format(format, entityPatterns); + if (log.isDebugEnabled()) { + log.debug(s); + } + return Pattern.compile(s); + } + + /** + * Compute the pattern to be used to capture a topia id for a given entity class. + * + * @param klass the entity class + * @return the pattern to capture a topia id for the given entity class. + */ + public static String getTopiaIdPattern(Class<? extends TopiaEntity> klass) { + StringBuilder buffer = new StringBuilder(); + StringTokenizer stk = new StringTokenizer(klass.getName(), "."); + while (stk.hasMoreTokens()) { + buffer.append("\\.").append(stk.nextToken()); + } + buffer.append("#(?:\\d+?)#(?:\\d+)\\.(?:\\d+)"); + return buffer.substring(2); + } + } Modified: topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/TopiaContextTest.java =================================================================== --- topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/TopiaContextTest.java 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/TopiaContextTest.java 2008-12-04 23:33:31 UTC (rev 1242) @@ -17,29 +17,20 @@ /******************************************************************************* * TopiaContextTest.java - * + * * Created: 28 d?c. 2005 16:26:24 - * + * * @author poussin - * + * * @version $Revision$ - * + * * Last update: $Date$ by : $Author$ */ package org.codelutin.topia; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.util.Properties; - -import junit.framework.TestCase; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaContext; -import org.codelutin.topia.TopiaContextFactory; import org.codelutin.topia.event.TopiaEntityEvent; import org.codelutin.topia.event.TopiaEntityListener; import org.codelutin.topia.event.TopiaEntityVetoable; @@ -47,24 +38,46 @@ import org.codelutin.topia.event.TopiaTransactionListener; import org.codelutin.topia.framework.TopiaContextImplementor; import org.codelutin.topia.persistence.TopiaDAO; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; -/** - * @author poussin - * - */ -public class TopiaContextTest extends TestCase { +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.util.Properties; +/** @author poussin */ +public class TopiaContextTest extends Assert { + /** to use log facility, just put in your code: log.info(\"...\"); */ static private Log log = LogFactory.getLog(TopiaContextTest.class); protected String entitiesList = Person.class.getName(); + protected String timeStamp; + + protected TopiaContext context; + + @Before + public void before() { + timeStamp = System.nanoTime() + ""; + } + + @After + public void after() throws TopiaException { + if (context != null && !context.isClosed()) { + context.closeContext(); + } + } + protected Properties getPostgreSQLProperties() { Properties config = new Properties(); config.setProperty("hibernate.show_sql", "true"); config.setProperty("hibernate.hbm2ddl.auto", "create"); - config.setProperty("topia.dao.flatfile.directory", "/tmp/topiadb"); + config.setProperty("topia.dao.flatfile.directory", "/tmp/topiadb_" + timeStamp); config.setProperty("topia.dao.flatfile.mapping.key", "firstname"); config.setProperty("topia.persistence.classes", entitiesList); @@ -72,8 +85,7 @@ "org.hibernate.dialect.PostgreSQLDialect"); config.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver"); - config.setProperty("hibernate.connection.url", - "jdbc:postgresql:database"); + config.setProperty("hibernate.connection.url", "jdbc:postgresql:database"); config.setProperty("hibernate.connection.username", "dbuser"); config.setProperty("hibernate.connection.password", "xxxxxxxx"); @@ -85,7 +97,7 @@ config.setProperty("hibernate.show_sql", "true"); config.setProperty("hibernate.hbm2ddl.auto", "create"); - config.setProperty("topia.dao.flatfile.directory", "/tmp/topiadb"); + config.setProperty("topia.dao.flatfile.directory", "/tmp/topiadb_" + timeStamp); config.setProperty("topia.dao.flatfile.mapping.key", "firstname"); config.setProperty("topia.persistence.classes", entitiesList); @@ -107,7 +119,7 @@ config.setProperty("hibernate.hbm2ddl.auto", "create"); new File("/tmp/topiadb/").mkdirs(); - config.setProperty("topia.dao.flatfile.directory", "/tmp/topiadb/h2"); + config.setProperty("topia.dao.flatfile.directory", "/tmp/topiadb2_" + timeStamp + "/h2"); config.setProperty("topia.dao.flatfile.mapping.key", "firstname"); config.setProperty("topia.persistence.classes", entitiesList); @@ -117,7 +129,7 @@ .setProperty("hibernate.connection.driver_class", "org.h2.Driver"); config.setProperty("hibernate.connection.url", - "jdbc:h2:file:/tmp/topiaderby;create=true"); + "jdbc:h2:file:/tmp/topiadb_" + timeStamp + "/h2;create=true;LOCK_MODE=0"); config.setProperty("hibernate.connection.username", "sa"); config.setProperty("hibernate.connection.password", ""); @@ -134,32 +146,34 @@ * #hibernate.connection.url jdbc:derby:/test;create=true * #hibernate.connection.username #hibernate.connection.password */ + @Test public void testGetParentContext() throws Exception { Properties config = getProperties(); - TopiaContextImplementor topiaContext = (TopiaContextImplementor) TopiaContextFactory + context = TopiaContextFactory .getContext(config); - TopiaContextImplementor child1 = (TopiaContextImplementor) topiaContext + TopiaContextImplementor child1 = (TopiaContextImplementor) context .beginTransaction(); TopiaContextImplementor child2 = (TopiaContextImplementor) child1 .beginTransaction(); assertEquals(child1, child2.getParentContext()); - assertEquals(topiaContext, child1.getParentContext()); - assertEquals(null, topiaContext.getParentContext()); + assertEquals(context, child1.getParentContext()); + assertEquals(null, ((TopiaContextImplementor) context).getParentContext()); - assertEquals(topiaContext, topiaContext.getRootContext()); - assertEquals(topiaContext, child1.getRootContext()); - assertEquals(topiaContext, child2.getRootContext()); + assertEquals(context, ((TopiaContextImplementor) context).getRootContext()); + assertEquals(context, child1.getRootContext()); + assertEquals(context, child2.getRootContext()); } + @Test public void testHibernate() throws Exception { System.out.println("Debut du test Hibernate"); Properties config = getProperties(); - TopiaContext context = TopiaContextFactory.getContext(config); + context = TopiaContextFactory.getContext(config); TopiaContextImplementor childContext = (TopiaContextImplementor) context .beginTransaction(); @@ -204,12 +218,13 @@ assertEquals("berengere", pp.getFirstname()); } + @Test public void testIsolation() throws Exception { System.out.println("Debut du test Isolation"); Properties config = getProperties(); - TopiaContext context = TopiaContextFactory.getContext(config); + context = TopiaContextFactory.getContext(config); TopiaContextImplementor c1 = (TopiaContextImplementor) context .beginTransaction(); @@ -219,6 +234,9 @@ TopiaDAO<Person> ps1 = c1.getDAO(Person.class); TopiaDAO<Person> ps2 = c2.getDAO(Person.class); + assertEquals(0, ps1.findAll().size()); + assertEquals(0, ps2.findAll().size()); + Person p = ps1.create(); p.setName("poussin"); p.setFirstname("benjamin"); @@ -226,8 +244,8 @@ c1.rollbackTransaction(); - assertEquals(0, ps1.findAll().size()); - assertEquals(0, ps2.findAll().size()); + //assertEquals(0, ps1.findAll().size()); + //assertEquals(0, ps2.findAll().size()); p = ps1.create(); p.setName("poussin"); @@ -254,13 +272,14 @@ } + @Test public void testFlatFile() throws Exception { System.out.println("Debut du test FlatFile"); Properties config = getProperties(); config.setProperty("topia.dao.default.class", "flatfile"); - TopiaContext context = TopiaContextFactory.getContext(config); + context = TopiaContextFactory.getContext(config); TopiaContextImplementor childContext = (TopiaContextImplementor) context .beginTransaction(); @@ -289,12 +308,13 @@ } + @Test public void testConstructor() throws Exception { System.out.println("Debut du test constructor"); Properties config = getProperties(); - TopiaContext context = TopiaContextFactory.getContext(config); + context = TopiaContextFactory.getContext(config); TopiaContextImplementor childContext = (TopiaContextImplementor) context .beginTransaction(); @@ -325,11 +345,12 @@ String state = ""; + @Test public void testEventHibernate() throws Exception { System.out.println("Debut du test Event"); Properties config = getProperties(); - TopiaContext context = TopiaContextFactory.getContext(config); + context = TopiaContextFactory.getContext(config); TopiaEntityVetoable entityVetoable = new TopiaEntityVetoable() { private void print(TopiaEntityEvent event, String _state) { @@ -435,6 +456,7 @@ } + @Test public void testPropertyEvent() throws Exception { PropertyChangeListener l = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { @@ -445,10 +467,9 @@ Properties config = getProperties(); - TopiaContextImplementor ctx = (TopiaContextImplementor) TopiaContextFactory - .getContext(config).beginTransaction(); + context = TopiaContextFactory.getContext(config).beginTransaction(); - TopiaDAO<Person> personDAO = ctx.getDAO(Person.class); + TopiaDAO<Person> personDAO = ((TopiaContextImplementor) context).getDAO(Person.class); Person p = personDAO.create(); p.addPropertyChangeListener("firstName", l); Modified: topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/EntityStateTest.java =================================================================== --- topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/EntityStateTest.java 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/EntityStateTest.java 2008-12-04 23:33:31 UTC (rev 1242) @@ -29,19 +29,18 @@ package org.codelutin.topia.framework; -import org.codelutin.topia.framework.EntityState; +import org.junit.Assert; +import org.junit.Test; -import junit.framework.TestCase; +/** @author poussin */ -/** - * @author poussin - * - */ +public class EntityStateTest extends Assert { -public class EntityStateTest extends TestCase { - + @Test public void testState() throws Exception { EntityState state = new EntityState(); + + state.addLoad(); assertTrue(state.isLoad()); assertFalse(state.isRead()); assertFalse(state.isCreate()); @@ -49,19 +48,29 @@ assertFalse(state.isDelete()); state.addRead(); + assertTrue(state.isLoad()); + assertTrue(state.isRead()); + assertFalse(state.isCreate()); + assertFalse(state.isUpdate()); + assertFalse(state.isDelete()); + + //state.addRead(); state.addCreate(); + assertTrue(state.isLoad()); assertTrue(state.isRead()); assertTrue(state.isCreate()); assertFalse(state.isUpdate()); assertFalse(state.isDelete()); state.addUpdate(); + assertTrue(state.isLoad()); assertTrue(state.isRead()); assertTrue(state.isCreate()); assertTrue(state.isUpdate()); assertFalse(state.isDelete()); state.addDelete(); + assertTrue(state.isLoad()); assertTrue(state.isRead()); assertTrue(state.isCreate()); assertTrue(state.isUpdate()); Added: topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/TopiaUtilTest.java =================================================================== --- topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/TopiaUtilTest.java (rev 0) +++ topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/framework/TopiaUtilTest.java 2008-12-04 23:33:31 UTC (rev 1242) @@ -0,0 +1,32 @@ +package org.codelutin.topia.framework; + +import org.codelutin.topia.Person; +import static org.junit.Assert.assertEquals; + +import java.util.regex.Pattern; + +/** @author chemit */ +public class TopiaUtilTest { + + @org.junit.Test + public void testGetTopiaIdPattern() throws Exception { + String expected; + String actual; + + expected = "org\\.codelutin\\.topia\\.Person#(?:\\d+?)#(?:\\d+)\\.(?:\\d+)"; + actual = TopiaUtil.getTopiaIdPattern(Person.class); + assertEquals(expected, actual); + } + + @org.junit.Test + public void testGetTopiaPattern() throws Exception { + String expected; + Pattern actual; + + expected = "org\\.codelutin\\.topia\\.Person#(?:\\d+?)#(?:\\d+)\\.(?:\\d+)(.*)"; + actual = TopiaUtil.getTopiaPattern("%1$s(.*)",Person.class); + assertEquals(expected, actual.toString()); + } + + +} Modified: topia/trunk/topia-soa/pom.xml =================================================================== --- topia/trunk/topia-soa/pom.xml 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/topia-soa/pom.xml 2008-12-04 23:33:31 UTC (rev 1242) @@ -15,14 +15,13 @@ <groupId>org.codelutin.topia</groupId> <artifactId>topia-soa</artifactId> - <version>2.1.0-SNAPSHOT</version> - + <dependencies> <dependency> <groupId>org.codelutin.topia</groupId> <artifactId>topia-persistence</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>${project.version}</version> </dependency> <dependency> @@ -92,7 +91,6 @@ <name>ToPIA - SOA</name> <description>Service Oriented Architecture module</description> - <inceptionYear>2004</inceptionYear> <!-- ************************************************************* --> <!-- *** Build Settings ****************************************** --> @@ -101,6 +99,7 @@ <packaging>jar</packaging> <build> + <defaultGoal>install</defaultGoal> <plugins> <plugin> Modified: topia/trunk/topia-ui/pom.xml =================================================================== --- topia/trunk/topia-ui/pom.xml 2008-11-28 13:13:02 UTC (rev 1241) +++ topia/trunk/topia-ui/pom.xml 2008-12-04 23:33:31 UTC (rev 1242) @@ -15,8 +15,7 @@ <groupId>org.codelutin.topia</groupId> <artifactId>topia-ui</artifactId> - <version>2.1.0-SNAPSHOT</version> - + <dependencies> <dependency> @@ -44,7 +43,6 @@ <name>ToPIA - UI</name> <description>User interface module</description> - <inceptionYear>2004</inceptionYear> <!-- ************************************************************* --> <!-- *** Build Settings ****************************************** --> @@ -53,6 +51,7 @@ <packaging>jar</packaging> <build> + <defaultGoal>install</defaultGoal> <plugins> <plugin>
participants (1)
-
tchemit@users.labs.libre-entreprise.org