You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fc...@us...> - 2008-02-19 10:22:34
|
Revision: 620 http://openutils.svn.sourceforge.net/openutils/?rev=620&view=rev Author: fcarone Date: 2008-02-19 02:22:39 -0800 (Tue, 19 Feb 2008) Log Message: ----------- UserManagerTest moved to new tests convention Modified Paths: -------------- trunk/openutils-usermanagement/src/test/java/it/openutils/usermanagement/manager/UserManagerTest.java trunk/openutils-usermanagement/src/test/resources/spring-dao.xml trunk/openutils-usermanagement/src/test/resources/spring-database.xml trunk/openutils-usermanagement/src/test/resources/spring-hibernate.xml trunk/openutils-usermanagement/src/test/resources/spring-managers.xml trunk/openutils-usermanagement/src/test/resources/spring-tests.xml Property Changed: ---------------- trunk/openutils-usermanagement/ Property changes on: trunk/openutils-usermanagement ___________________________________________________________________ Name: svn:ignore - target .classpath .project .settings db *.log .checkstyle + target .classpath .project .settings db *.log .checkstyle test-output Modified: trunk/openutils-usermanagement/src/test/java/it/openutils/usermanagement/manager/UserManagerTest.java =================================================================== --- trunk/openutils-usermanagement/src/test/java/it/openutils/usermanagement/manager/UserManagerTest.java 2008-02-17 09:11:48 UTC (rev 619) +++ trunk/openutils-usermanagement/src/test/java/it/openutils/usermanagement/manager/UserManagerTest.java 2008-02-19 10:22:39 UTC (rev 620) @@ -1,32 +1,62 @@ package it.openutils.usermanagement.manager; -import it.openutils.testing.junit.GenericsDbUnitTestCase; +import it.openutils.testing.DbUnitExecution; +import it.openutils.testing.junit.AbstractDbUnitJunitSpringContextTests; +import org.dbunit.operation.InsertOperation; +import org.junit.Assert; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestExecutionListeners; +import org.springframework.test.context.transaction.TransactionConfiguration; +import org.springframework.test.context.transaction.TransactionalTestExecutionListener; +import org.springframework.transaction.annotation.Transactional; + /** * @author fgiust * @version $Id$ */ -public class UserManagerTest extends GenericsDbUnitTestCase<UserManager> +@ContextConfiguration(locations = {"/spring-tests.xml" }) +@DbUnitExecution(datasets = {"/UserManagerTest-load.xml" }, dataSource = "dataSource", // + insertOperation = InsertOperation.class) +@TestExecutionListeners({TransactionalTestExecutionListener.class }) +@Transactional +@TransactionConfiguration(transactionManager = "transactionManager") +public class UserManagerTest extends AbstractDbUnitJunitSpringContextTests { + @Autowired + private UserManager instance; + /** * test for changePassword() */ + @Test public void testChangePassword() { String newPwd = "2345"; Boolean result = instance.changePassword("UserUno", "password", newPwd); - assertTrue(result); - + Assert.assertTrue(result); } + @Test public void testResetPassword() { - String newPwd = instance.resetPassword("UserUno"); - assertNotNull("nothing returned by resetPassword ", newPwd); + Assert.assertNotNull("nothing returned by resetPassword ", newPwd); } + + /** + * Sets the instance. + * @param instance the instance to set + */ + public void setInstance(UserManager instance) + { + this.instance = instance; + } + } Modified: trunk/openutils-usermanagement/src/test/resources/spring-dao.xml =================================================================== --- trunk/openutils-usermanagement/src/test/resources/spring-dao.xml 2008-02-17 09:11:48 UTC (rev 619) +++ trunk/openutils-usermanagement/src/test/resources/spring-dao.xml 2008-02-19 10:22:39 UTC (rev 620) @@ -1,28 +1,26 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" -"http://www.springframework.org/dtd/spring-beans.dtd"> -<beans> - - <bean id="userDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.usermanagement.dao.UserDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - <bean id="groupDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.usermanagement.dao.GroupDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - <bean id="roleDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.usermanagement.dao.RoleDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <bean id="userDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.usermanagement.dao.UserDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> + <bean id="groupDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.usermanagement.dao.GroupDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> + <bean id="roleDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.usermanagement.dao.RoleDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> </beans> \ No newline at end of file Modified: trunk/openutils-usermanagement/src/test/resources/spring-database.xml =================================================================== --- trunk/openutils-usermanagement/src/test/resources/spring-database.xml 2008-02-17 09:11:48 UTC (rev 619) +++ trunk/openutils-usermanagement/src/test/resources/spring-database.xml 2008-02-19 10:22:39 UTC (rev 620) @@ -1,28 +1,29 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> -<!-- +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <!-- # ATTENZIONE: queste proprietà sono utilizzate solo per gli unit tests # i file per la configurazione del db utilizzati dall'applicazione web sono in # src/main/web-app/WEB-INF ---> -<beans> - <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> - <property name="location"> - <value>classpath:database.properties</value> - </property> - </bean> - <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> - <property name="driverClassName"> - <value>${hibernate.connection.driver}</value> - </property> - <property name="url"> - <value>${hibernate.connection.url}</value> - </property> - <property name="username"> - <value>${hibernate.connection.username}</value> - </property> - <property name="password"> - <value>${hibernate.connection.password}</value> - </property> - </bean> + --> + <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> + <property name="location"> + <value>classpath:database.properties</value> + </property> + </bean> + <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> + <property name="driverClassName"> + <value>${hibernate.connection.driver}</value> + </property> + <property name="url"> + <value>${hibernate.connection.url}</value> + </property> + <property name="username"> + <value>${hibernate.connection.username}</value> + </property> + <property name="password"> + <value>${hibernate.connection.password}</value> + </property> + </bean> </beans> Modified: trunk/openutils-usermanagement/src/test/resources/spring-hibernate.xml =================================================================== --- trunk/openutils-usermanagement/src/test/resources/spring-hibernate.xml 2008-02-17 09:11:48 UTC (rev 619) +++ trunk/openutils-usermanagement/src/test/resources/spring-hibernate.xml 2008-02-19 10:22:39 UTC (rev 620) @@ -1,47 +1,46 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" -"http://www.springframework.org/dtd/spring-beans.dtd"> -<beans> - - <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> - <property name="dataSource"> - <ref bean="dataSource" /> - </property> - <property name="configLocation"> - <value>classpath:hibernate.cfg.xml</value> - </property> - <property name="configurationClass"> - <value>org.hibernate.cfg.AnnotationConfiguration</value> - </property> - <property name="hibernateProperties"> - <props> - <prop key="hibernate.dialect">${hibernate.dialect}</prop> - <prop key="hibernate.generate_statistics">false</prop> - <prop key="hibernate.bytecode.use_reflection_optimizer">true</prop> - <prop key="hibernate.show_sql">false</prop> - <prop key="hibernate.use_sql_comments">false</prop> - <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> - </props> - </property> - </bean> - <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> - <property name="sessionFactory"> - <ref local="sessionFactory" /> - </property> - </bean> - <bean id="txProxyTemplate" abstract="true" - class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> - <property name="transactionManager"> - <ref bean="transactionManager" /> - </property> - <property name="transactionAttributes"> - <props> - <prop key="save*">PROPAGATION_REQUIRED</prop> - <prop key="delete*">PROPAGATION_REQUIRED</prop> - <prop key="update*">PROPAGATION_REQUIRED</prop> - <prop key="clean*">PROPAGATION_REQUIRED</prop> - <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> - </props> - </property> - </bean> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> + <property name="dataSource"> + <ref bean="dataSource" /> + </property> + <property name="configLocation"> + <value>classpath:hibernate.cfg.xml</value> + </property> + <property name="configurationClass"> + <value>org.hibernate.cfg.AnnotationConfiguration</value> + </property> + <property name="hibernateProperties"> + <props> + <prop key="hibernate.dialect">${hibernate.dialect}</prop> + <prop key="hibernate.generate_statistics">false</prop> + <prop key="hibernate.bytecode.use_reflection_optimizer">true</prop> + <prop key="hibernate.show_sql">false</prop> + <prop key="hibernate.use_sql_comments">false</prop> + <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> + </props> + </property> + </bean> + <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> + <property name="sessionFactory"> + <ref local="sessionFactory" /> + </property> + </bean> + <bean id="txProxyTemplate" abstract="true" + class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> + <property name="transactionManager"> + <ref bean="transactionManager" /> + </property> + <property name="transactionAttributes"> + <props> + <prop key="save*">PROPAGATION_REQUIRED</prop> + <prop key="delete*">PROPAGATION_REQUIRED</prop> + <prop key="update*">PROPAGATION_REQUIRED</prop> + <prop key="clean*">PROPAGATION_REQUIRED</prop> + <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> + </props> + </property> + </bean> </beans> \ No newline at end of file Modified: trunk/openutils-usermanagement/src/test/resources/spring-managers.xml =================================================================== --- trunk/openutils-usermanagement/src/test/resources/spring-managers.xml 2008-02-17 09:11:48 UTC (rev 619) +++ trunk/openutils-usermanagement/src/test/resources/spring-managers.xml 2008-02-19 10:22:39 UTC (rev 620) @@ -1,21 +1,27 @@ -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> -<beans> - <bean id="userManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" - autowire="byType"> - <property name="transactionManager"> - <ref bean="transactionManager" /> - </property> - <property name="transactionAttributes"> - <props> - <prop key="*">PROPAGATION_REQUIRED</prop> - </props> - </property> - <property name="target"> - <bean class="it.openutils.usermanagement.manager.UserManagerImpl" autowire="byType"></bean> - </property> - </bean> - <bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.ShaPasswordEncoder" /> - <bean id="userDetailsService" class="it.openutils.usermanagement.acegi.HibernateUserDetailsServiceImpl" - autowire="byType"> - </bean> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <bean id="userManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> + <property name="transactionManager"> + <ref bean="transactionManager" /> + </property> + <property name="transactionAttributes"> + <props> + <prop key="*">PROPAGATION_REQUIRED</prop> + </props> + </property> + <property name="target"> + <bean class="it.openutils.usermanagement.manager.UserManagerImpl"> + <property name="passwordEncoder" ref="passwordEncoder" /> + <property name="userDAO" ref="userDAO" /> + </bean> + </property> + </bean> + <bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.ShaPasswordEncoder" /> + <bean id="userDetailsService" class="it.openutils.usermanagement.acegi.HibernateUserDetailsServiceImpl" + autowire="byType"> + <property name="userDao" ref="userDAO" /> + <property name="groupDAO" ref="groupDAO" /> + </bean> </beans> \ No newline at end of file Modified: trunk/openutils-usermanagement/src/test/resources/spring-tests.xml =================================================================== --- trunk/openutils-usermanagement/src/test/resources/spring-tests.xml 2008-02-17 09:11:48 UTC (rev 619) +++ trunk/openutils-usermanagement/src/test/resources/spring-tests.xml 2008-02-19 10:22:39 UTC (rev 620) @@ -1,8 +1,9 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> -<beans> - <import resource="classpath:spring-database.xml" /> - <import resource="classpath:spring-hibernate.xml" /> - <import resource="classpath:spring-dao.xml" /> - <import resource="classpath:spring-managers.xml" /> -</beans> \ No newline at end of file +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <import resource="classpath:spring-database.xml" /> + <import resource="classpath:spring-hibernate.xml" /> + <import resource="classpath:spring-dao.xml" /> + <import resource="classpath:spring-managers.xml" /> +</beans> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-17 09:11:47
|
Revision: 619 http://openutils.svn.sourceforge.net/openutils/?rev=619&view=rev Author: fgiust Date: 2008-02-17 01:11:48 -0800 (Sun, 17 Feb 2008) Log Message: ----------- comparison using strings Modified Paths: -------------- trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-02-17 09:03:04 UTC (rev 618) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-02-17 09:11:48 UTC (rev 619) @@ -69,17 +69,20 @@ { throw new AssertionError("Date is null"); } - if (!date.equals(expected)) + + String expDate; + String actDate; + + synchronized (format) { - synchronized (format) - { - throw new AssertionError("Expected <" - + format.format(expected) - + ">, actual <" - + format.format(date) - + ">"); - } + expDate = format.format(expected); + actDate = format.format(date); } + + if (!expDate.equals(actDate)) + { + throw new AssertionError("Expected <" + expDate + ">, actual <" + actDate + ">"); + } } /** @@ -112,7 +115,6 @@ */ public static void dateTimeEqual(String expectedDateAsString, Date date) throws IllegalArgumentException { - performComparison(expectedDateAsString, date, dtf); } @@ -124,7 +126,7 @@ */ public static void dateTimeEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException { - dateTimeEqual(expectedDateAsString, date.getTime()); + performComparison(expectedDateAsString, date.getTime(), dtf); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-17 09:03:02
|
Revision: 618 http://openutils.svn.sourceforge.net/openutils/?rev=618&view=rev Author: fgiust Date: 2008-02-17 01:03:04 -0800 (Sun, 17 Feb 2008) Log Message: ----------- minor improvements to DateAssert Modified Paths: -------------- trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java trunk/openutils-testing/src/site/changes/changes.xml Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-02-14 16:06:03 UTC (rev 617) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-02-17 09:03:04 UTC (rev 618) @@ -43,18 +43,22 @@ } /** - * Asserts that two dates are equal. - * @param expectedDateAsString date formatted as "YYYYMMDD" - * @param date actual date - * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + * @param expectedDateAsString + * @param date + * @param format + * @throws AssertionError */ - public static void dateEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException + private static void performComparison(String expectedDateAsString, Date date, DateFormat format) + throws AssertionError { Date expected; try { - expected = df.parse(expectedDateAsString); + synchronized (format) + { + expected = format.parse(expectedDateAsString); + } } catch (ParseException e) { @@ -65,40 +69,51 @@ { throw new AssertionError("Date is null"); } - if (!date.getTime().equals(expected)) + if (!date.equals(expected)) { - throw new AssertionError("Expected <" + expected + ">, actual <" + date.getTime() + ">"); + synchronized (format) + { + throw new AssertionError("Expected <" + + format.format(expected) + + ">, actual <" + + format.format(date) + + ">"); + } } } /** * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "YYYYMMDD" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException + { + performComparison(expectedDateAsString, date.getTime(), df); + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "YYYYMMDD" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateEqual(String expectedDateAsString, Date date) throws IllegalArgumentException + { + performComparison(expectedDateAsString, date, df); + } + + /** + * Asserts that two dates are equal. * @param expectedDateAsString date formatted as "yyyyMMdd HH:mm" * @param date actual date * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format */ public static void dateTimeEqual(String expectedDateAsString, Date date) throws IllegalArgumentException { - Date expected; - try - { - expected = dtf.parse(expectedDateAsString); - } - catch (ParseException e) - { - throw new IllegalArgumentException("Unparseable date String: [" + expectedDateAsString + "]"); - } - - if (date == null) - { - throw new AssertionError("Date is null"); - } - - if (date.getTime() != expected.getTime()) - { - throw new AssertionError("Expected <" + expected + ">, actual <" + date + ">"); - } + performComparison(expectedDateAsString, date, dtf); } /** Modified: trunk/openutils-testing/src/site/changes/changes.xml =================================================================== --- trunk/openutils-testing/src/site/changes/changes.xml 2008-02-14 16:06:03 UTC (rev 617) +++ trunk/openutils-testing/src/site/changes/changes.xml 2008-02-17 09:03:04 UTC (rev 618) @@ -8,7 +8,12 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> - <release version="2.0.2" date="in svn" description="2.0.2"> + <release version="2.0.3" date="in svn" description="2.0.2"> + <action type="update" dev="fgiust"> + it.openutils.testing.DateAssert is now thread safe. Failure messages have been improved. + </action> + </release> + <release version="2.0.2" date="2008-01-31" description="2.0.2"> <action type="add" dev="fgiust"> New dbunit operation classes for mssql and mysql (extension of standard dbunit operation, but refactored so that they can be used in annotations). See the javadocs in the it.openutils.testing.dbunit package This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2008-02-14 16:06:37
|
Revision: 617 http://openutils.svn.sourceforge.net/openutils/?rev=617&view=rev Author: fcarone Date: 2008-02-14 08:06:03 -0800 (Thu, 14 Feb 2008) Log Message: ----------- pom update before release. please release projects altogether in the future Modified Paths: -------------- trunk/openutils-configuration-services/pom.xml trunk/openutils-hibernate-security/pom.xml trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java trunk/openutils-testing-junit-dwr/pom.xml trunk/openutils-testing-testng-dwr/pom.xml trunk/openutils-usermanagement/pom.xml trunk/pom.xml Modified: trunk/openutils-configuration-services/pom.xml =================================================================== --- trunk/openutils-configuration-services/pom.xml 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/openutils-configuration-services/pom.xml 2008-02-14 16:06:03 UTC (rev 617) @@ -38,12 +38,12 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-bshd5</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.2-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing-testng</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.3-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/openutils-hibernate-security/pom.xml 2008-02-14 16:06:03 UTC (rev 617) @@ -122,7 +122,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> - <version>3.2.3.ga</version> + <version>3.2.5.ga</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -137,7 +137,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> - <version>3.2.1.ga</version> + <version>3.3.0.ga</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> Modified: trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java =================================================================== --- trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2008-02-14 16:06:03 UTC (rev 617) @@ -80,7 +80,6 @@ 0, new ArrayList<Criterion>()); Assert.assertNotNull(dummyObjects); -// Assert.assertEquals(1, dummyObjects.size()); dummyObjects = securedObject.findFiltered(filter); Assert.assertNotNull(dummyObjects); Modified: trunk/openutils-testing-junit-dwr/pom.xml =================================================================== --- trunk/openutils-testing-junit-dwr/pom.xml 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/openutils-testing-junit-dwr/pom.xml 2008-02-14 16:06:03 UTC (rev 617) @@ -15,7 +15,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.3-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework</groupId> Modified: trunk/openutils-testing-testng-dwr/pom.xml =================================================================== --- trunk/openutils-testing-testng-dwr/pom.xml 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/openutils-testing-testng-dwr/pom.xml 2008-02-14 16:06:03 UTC (rev 617) @@ -15,7 +15,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.3-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework</groupId> Modified: trunk/openutils-usermanagement/pom.xml =================================================================== --- trunk/openutils-usermanagement/pom.xml 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/openutils-usermanagement/pom.xml 2008-02-14 16:06:03 UTC (rev 617) @@ -23,7 +23,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-usermanagement-dataobjects</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-02-14 16:02:44 UTC (rev 616) +++ trunk/pom.xml 2008-02-14 16:06:03 UTC (rev 617) @@ -218,7 +218,10 @@ <module>openutils-configuration-dataobjects</module> <module>openutils-configuration-services</module> <module>openutils-hibernate-security</module> + <!-- temporarily disabled for missing dependencies --> + <!-- <module>openutils-mgnlspring</module> + --> <module>openutils-mgnlstripes</module> <module>openutils-spring-rmibernate</module> </modules> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2008-02-14 16:02:40
|
Revision: 616 http://openutils.svn.sourceforge.net/openutils/?rev=616&view=rev Author: fcarone Date: 2008-02-14 08:02:44 -0800 (Thu, 14 Feb 2008) Log Message: ----------- missing override added Modified Paths: -------------- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-12 16:57:54 UTC (rev 615) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-14 16:02:44 UTC (rev 616) @@ -69,6 +69,7 @@ /** * {@inheritDoc} */ + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2008-02-12 16:57:50
|
Revision: 615 http://openutils.svn.sourceforge.net/openutils/?rev=615&view=rev Author: fcarone Date: 2008-02-12 08:57:54 -0800 (Tue, 12 Feb 2008) Log Message: ----------- pom.xml update to make openutils modules consistent Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml trunk/openutils-usermanagement/pom.xml trunk/openutils-usermanagement-dataobjects/pom.xml Property Changed: ---------------- trunk/openutils-spring-rmibernate/ Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2008-02-11 20:51:03 UTC (rev 614) +++ trunk/openutils-hibernate-security/pom.xml 2008-02-12 16:57:54 UTC (rev 615) @@ -101,17 +101,17 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-usermanagement-dataobjects</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-bshd5</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.2-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing-junit</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.3-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> Property changes on: trunk/openutils-spring-rmibernate ___________________________________________________________________ Name: svn:ignore - .project .classpath .checkstyle target .settings + .project .classpath .checkstyle target .settings pom.xml.releaseBackup release.properties Modified: trunk/openutils-usermanagement/pom.xml =================================================================== --- trunk/openutils-usermanagement/pom.xml 2008-02-11 20:51:03 UTC (rev 614) +++ trunk/openutils-usermanagement/pom.xml 2008-02-12 16:57:54 UTC (rev 615) @@ -28,12 +28,12 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-bshd5</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.2-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing-junit</artifactId> - <version>2.0-SNAPSHOT</version> + <version>2.0.3-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> Modified: trunk/openutils-usermanagement-dataobjects/pom.xml =================================================================== --- trunk/openutils-usermanagement-dataobjects/pom.xml 2008-02-11 20:51:03 UTC (rev 614) +++ trunk/openutils-usermanagement-dataobjects/pom.xml 2008-02-12 16:57:54 UTC (rev 615) @@ -10,7 +10,7 @@ <artifactId>openutils-usermanagement-dataobjects</artifactId> <packaging>jar</packaging> <name>openutils usermanagement dataobjects</name> - <version>2.1-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> <description>Usermanagement dataobjects</description> <dependencies> <dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:53:13
|
Revision: 614 http://openutils.svn.sourceforge.net/openutils/?rev=614&view=rev Author: fgiust Date: 2008-02-11 12:51:03 -0800 (Mon, 11 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-11 20:50:50 UTC (rev 613) +++ trunk/openutils-dbmigration/pom.xml 2008-02-11 20:51:03 UTC (rev 614) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> - <version>2.0.2</version> + <version>2.0.3-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -93,10 +93,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.2</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.2</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:53:13
|
Revision: 612 http://openutils.svn.sourceforge.net/openutils/?rev=612&view=rev Author: fgiust Date: 2008-02-11 12:50:23 -0800 (Mon, 11 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-dbmigration-2.0.2 Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-11 20:47:48 UTC (rev 611) +++ trunk/openutils-dbmigration/pom.xml 2008-02-11 20:50:23 UTC (rev 612) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> - <version>2.0.2-SNAPSHOT</version> + <version>2.0.2</version> <description /> <dependencies> <dependency> @@ -93,4 +93,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.2</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:53:12
|
Revision: 613 http://openutils.svn.sourceforge.net/openutils/?rev=613&view=rev Author: fgiust Date: 2008-02-11 12:50:50 -0800 (Mon, 11 Feb 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-dbmigration-2.0.2 Added Paths: ----------- tags/openutils-dbmigration-2.0.2/ tags/openutils-dbmigration-2.0.2/pom.xml tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/oracle/ tags/openutils-dbmigration-2.0.2/src/site/changes/ Removed Paths: ------------- tags/openutils-dbmigration-2.0.2/pom.xml tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java Copied: tags/openutils-dbmigration-2.0.2 (from rev 605, trunk/openutils-dbmigration) Deleted: tags/openutils-dbmigration-2.0.2/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 22:50:06 UTC (rev 605) +++ tags/openutils-dbmigration-2.0.2/pom.xml 2008-02-11 20:50:50 UTC (rev 613) @@ -1,96 +0,0 @@ -<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> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-dbmigration</artifactId> - <name>openutils db migration</name> - <version>2.0.2-SNAPSHOT</version> - <description /> - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.apache.poi</groupId> - <artifactId>poi</artifactId> - <version>3.0-FINAL</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-dbmigration-2.0.2/pom.xml (from rev 612, trunk/openutils-dbmigration/pom.xml) =================================================================== --- tags/openutils-dbmigration-2.0.2/pom.xml (rev 0) +++ tags/openutils-dbmigration-2.0.2/pom.xml 2008-02-11 20:50:50 UTC (rev 613) @@ -0,0 +1,102 @@ +<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> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-dbmigration</artifactId> + <name>openutils db migration</name> + <version>2.0.2</version> + <description /> + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + <version>3.0-FINAL</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.2</url> + </scm> +</project> \ No newline at end of file Deleted: tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-03 22:50:06 UTC (rev 605) +++ tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-11 20:50:50 UTC (rev 613) @@ -1,63 +0,0 @@ -package it.openutils.migration.generic; - -import it.openutils.migration.task.setup.BaseConditionalTask; - -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.apache.commons.lang.StringUtils; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class JdbcIfColumnExistsConditionalTask extends BaseConditionalTask -{ - - private String column; - - /** - * Sets the column. - * @param column the column to set - */ - public void setColumn(String column) - { - this.column = column; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) - { - final String catalog = null; - final String schema = null; - - String columnTrim = StringUtils.trim(column); - - final String tableName = StringUtils.substringBefore(columnTrim, "."); - final String columnName = StringUtils.substringAfter(columnTrim, "."); - return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() - { - - public Object doInConnection(Connection con) throws SQLException, DataAccessException - { - - DatabaseMetaData dbMetadata = con.getMetaData(); - ResultSet rs = dbMetadata.getColumns(catalog, schema, tableName, columnName); - boolean tableExists = rs.next(); - rs.close(); - - return !tableExists; - } - }); - } - -} Copied: tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java (from rev 611, trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java) =================================================================== --- tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java (rev 0) +++ tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-11 20:50:50 UTC (rev 613) @@ -0,0 +1,83 @@ +package it.openutils.migration.generic; + +import it.openutils.migration.task.setup.BaseConditionalTask; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; + +import org.apache.commons.lang.StringUtils; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ConnectionCallback; +import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class JdbcIfColumnExistsConditionalTask extends BaseConditionalTask +{ + + private String column; + + protected String catalog; + + protected String schema; + + /** + * Sets the catalog. + * @param catalog the catalog to set + */ + public void setCatalog(String catalog) + { + this.catalog = catalog; + } + + /** + * Sets the schema. + * @param schema the schema to set + */ + public void setSchema(String schema) + { + this.schema = schema; + } + + /** + * Sets the column. + * @param column the column to set + */ + public void setColumn(String column) + { + this.column = column; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean check(SimpleJdbcTemplate jdbcTemplate) + { + + String columnTrim = StringUtils.trim(column); + + final String tableName = StringUtils.substringBefore(columnTrim, "."); + final String columnName = StringUtils.substringAfter(columnTrim, "."); + return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + { + + public Object doInConnection(Connection con) throws SQLException, DataAccessException + { + + DatabaseMetaData dbMetadata = con.getMetaData(); + ResultSet rs = dbMetadata.getColumns(catalog, schema, tableName, columnName); + boolean tableExists = rs.next(); + rs.close(); + + return !tableExists; + } + }); + } + +} Deleted: tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-03 22:50:06 UTC (rev 605) +++ tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-11 20:50:50 UTC (rev 613) @@ -1,137 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.migration.generic; - -import it.openutils.migration.task.setup.GenericConditionalTask; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.SQLException; - -import javax.sql.DataSource; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.springframework.core.io.Resource; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; - - -/** - * @author fgiust - * @version $Id:SqlServerObjCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ - */ -public abstract class JdbcObjectCreationTask extends GenericConditionalTask -{ - - protected String catalog; - - abstract String getObjectType(); - - /** - * {@inheritDoc} - */ - @Override - public void execute(DataSource dataSource) - { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); - - for (Resource script : scripts) - { - - if (script == null || !script.exists()) - { - log.error("Unable to execute db task \"{}\", script \"{}\" not found.", getDescription(), script); - return; - } - - String fqTableName = this.objectNameFromFileName(script); - String tmptableName = null; - String tmpschema = null; - - if (StringUtils.contains(fqTableName, ".")) - { - String[] tokens = StringUtils.split(fqTableName, "."); - tmptableName = tokens[1]; - tmpschema = tokens[0]; - } - else - { - tmptableName = fqTableName; - } - - final String tableName = tmptableName; - final String schema = tmpschema; - - boolean result = (Boolean) new JdbcTemplate(dataSource).execute(new ConnectionCallback() - { - - public Object doInConnection(Connection con) throws SQLException, DataAccessException - { - - DatabaseMetaData dbMetadata = con.getMetaData(); - ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType() }); - boolean tableExists = rs.next(); - rs.close(); - - return tableExists; - } - }); - - if (!result) - { - String scriptContent; - InputStream is = null; - - try - { - is = script.getInputStream(); - scriptContent = IOUtils.toString(is, "UTF8"); - } - catch (IOException e) - { - log.error( - "Unable to execute db task \"{}\", script \"{}\" can't be read.", - getDescription(), - script); - return; - } - finally - { - IOUtils.closeQuietly(is); - } - - String[] ddls = StringUtils.split(scriptContent, ";"); - - log.info("Creating new {} {}", getObjectType(), tableName); - - for (String ddl : ddls) - { - if (StringUtils.isNotBlank(ddl)) - { - log.debug("Executing:\n{}", ddl); - jdbcTemplate.update(ddl); - } - } - } - } - } -} \ No newline at end of file Copied: tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java (from rev 611, trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java) =================================================================== --- tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java (rev 0) +++ tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-11 20:50:50 UTC (rev 613) @@ -0,0 +1,162 @@ +// temporary patch until a new openutils-dbmigration release is outF +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.migration.generic; + +import it.openutils.migration.task.setup.GenericConditionalTask; + +import java.io.IOException; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.springframework.core.io.Resource; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ConnectionCallback; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; + + +/** + * @author fgiust + * @version $Id:SqlServerObjCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ + */ +public abstract class JdbcObjectCreationTask extends GenericConditionalTask +{ + + protected String catalog; + + protected String schema; + + abstract String getObjectType(); + + /** + * Sets the catalog. + * @param catalog the catalog to set + */ + public void setCatalog(String catalog) + { + this.catalog = catalog; + } + + /** + * Sets the schema. + * @param schema the schema to set + */ + public void setSchema(String schema) + { + this.schema = schema; + } + + /** + * {@inheritDoc} + */ + @Override + public void execute(DataSource dataSource) + { + SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + + for (Resource script : scripts) + { + + if (script == null || !script.exists()) + { + log.error("Unable to execute db task \"{}\", script \"{}\" not found.", getDescription(), script); + return; + } + + String fqTableName = this.objectNameFromFileName(script); + String tmptableName = null; + String tmpschema = schema; + + if (StringUtils.contains(fqTableName, ".")) + { + String[] tokens = StringUtils.split(fqTableName, "."); + tmptableName = tokens[1]; + tmpschema = tokens[0]; + } + else + { + tmptableName = fqTableName; + } + + final String tableName = tmptableName; + final String schema = tmpschema; + + boolean result = (Boolean) new JdbcTemplate(dataSource).execute(new ConnectionCallback() + { + + public Object doInConnection(Connection con) throws SQLException, DataAccessException + { + + DatabaseMetaData dbMetadata = con.getMetaData(); + ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType()}); + boolean tableExists = rs.next(); + rs.close(); + + return tableExists; + } + }); + + if (!result) + { + String scriptContent; + InputStream is = null; + + try + { + is = script.getInputStream(); + scriptContent = IOUtils.toString(is, "UTF8"); + } + catch (IOException e) + { + log.error( + "Unable to execute db task \"{}\", script \"{}\" can't be read.", + getDescription(), + script); + return; + } + finally + { + IOUtils.closeQuietly(is); + } + + String[] ddls = StringUtils.split(scriptContent, ";"); + + log.info("Creating new {} {}", getObjectType(), tableName); + + for (String ddl : ddls) + { + if (StringUtils.isNotBlank(ddl)) + { + log.debug("Executing:\n{}", ddl); + jdbcTemplate.update(ddl); + } + } + } + else + { + log.debug("{} {} already existing", getObjectType(), tableName); + } + } + } +} \ No newline at end of file Copied: tags/openutils-dbmigration-2.0.2/src/main/java/it/openutils/migration/oracle (from rev 611, trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle) Copied: tags/openutils-dbmigration-2.0.2/src/site/changes (from rev 611, trunk/openutils-dbmigration/src/site/changes) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:47:50
|
Revision: 611 http://openutils.svn.sourceforge.net/openutils/?rev=611&view=rev Author: fgiust Date: 2008-02-11 12:47:48 -0800 (Mon, 11 Feb 2008) Log Message: ----------- ready for 2.0.2 Modified Paths: -------------- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java Added Paths: ----------- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java trunk/openutils-dbmigration/src/site/changes/ trunk/openutils-dbmigration/src/site/changes/changes.xml Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-11 20:42:17 UTC (rev 610) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-11 20:47:48 UTC (rev 611) @@ -22,7 +22,29 @@ private String column; + protected String catalog; + + protected String schema; + /** + * Sets the catalog. + * @param catalog the catalog to set + */ + public void setCatalog(String catalog) + { + this.catalog = catalog; + } + + /** + * Sets the schema. + * @param schema the schema to set + */ + public void setSchema(String schema) + { + this.schema = schema; + } + + /** * Sets the column. * @param column the column to set */ @@ -37,8 +59,6 @@ @Override public boolean check(SimpleJdbcTemplate jdbcTemplate) { - final String catalog = null; - final String schema = null; String columnTrim = StringUtils.trim(column); Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-11 20:42:17 UTC (rev 610) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-11 20:47:48 UTC (rev 611) @@ -1,3 +1,4 @@ +// temporary patch until a new openutils-dbmigration release is outF /* * Copyright Openmind http://www.openmindonline.it * @@ -44,9 +45,29 @@ protected String catalog; + protected String schema; + abstract String getObjectType(); /** + * Sets the catalog. + * @param catalog the catalog to set + */ + public void setCatalog(String catalog) + { + this.catalog = catalog; + } + + /** + * Sets the schema. + * @param schema the schema to set + */ + public void setSchema(String schema) + { + this.schema = schema; + } + + /** * {@inheritDoc} */ @Override @@ -65,7 +86,7 @@ String fqTableName = this.objectNameFromFileName(script); String tmptableName = null; - String tmpschema = null; + String tmpschema = schema; if (StringUtils.contains(fqTableName, ".")) { @@ -88,7 +109,7 @@ { DatabaseMetaData dbMetadata = con.getMetaData(); - ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType() }); + ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType()}); boolean tableExists = rs.next(); rs.close(); @@ -132,6 +153,10 @@ } } } + else + { + log.debug("{} {} already existing", getObjectType(), tableName); + } } } } \ No newline at end of file Added: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java (rev 0) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java 2008-02-11 20:47:48 UTC (rev 611) @@ -0,0 +1,134 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.migration.oracle; + +import it.openutils.migration.task.setup.DbTask; + +import java.text.MessageFormat; +import java.util.List; + +import javax.sql.DataSource; + +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; + + +/** + * Db tasks that handles the initial setup of sequences. + * @author fgiust + * @version $Id$ + */ +public class OracleSequenceCreationTask implements DbTask +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(OracleSequenceCreationTask.class); + + private List<String> sequences; + + private String creationQuery; + + private String selectUserSequences; + + private String selectAllSequences; + + private int startsWith; + + /** + * Sets the sequences. + * @param sequences the sequences to set + */ + public void setSequences(List<String> sequences) + { + this.sequences = sequences; + } + + /** + * Sets the creationQuery. + * @param creationQuery the creationQuery to set + */ + public void setCreationQuery(String creationQuery) + { + this.creationQuery = creationQuery; + } + + /** + * Sets the selectAllSequences. + * @param selectAllSequences the selectAllSequences to set + */ + public void setSelectAllSequences(String selectAllSequences) + { + this.selectAllSequences = selectAllSequences; + } + + /** + * Sets the startsWith. + * @param startsWith the startsWith to set + */ + public void setStartsWith(int startsWith) + { + this.startsWith = startsWith; + } + + /** + * Sets the selectUserSequences. + * @param selectUserSequences the selectUserSequences to set + */ + public void setSelectUserSequences(String selectUserSequences) + { + this.selectUserSequences = selectUserSequences; + } + + /** + * {@inheritDoc} + */ + public String getDescription() + { + return "Checking Sequences"; + } + + /** + * {@inheritDoc} + */ + public void execute(DataSource dataSource) + { + SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + for (String sequenceName : sequences) + { + int result = 0; + + if (StringUtils.contains(sequenceName, ".")) + { + String[] tokens = StringUtils.split(sequenceName, "."); + result = jdbcTemplate.queryForInt(selectAllSequences, new Object[]{tokens[1], tokens[0]}); + } + else + { + result = jdbcTemplate.queryForInt(selectUserSequences, sequenceName); + } + + if (result <= 0) + { + log.info("Creating new {}", sequenceName); + jdbcTemplate.update(MessageFormat.format(creationQuery, new Object[]{sequenceName, startsWith})); + } + } + } +} \ No newline at end of file Property changes on: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-dbmigration/src/site/changes/changes.xml =================================================================== --- trunk/openutils-dbmigration/src/site/changes/changes.xml (rev 0) +++ trunk/openutils-dbmigration/src/site/changes/changes.xml 2008-02-11 20:47:48 UTC (rev 611) @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="2.0.2" date="2008-02-11" description="2.0.2"> + <action type="add" dev="fgiust">New it.openutils.migration.oracle.OracleSequenceCreationTask</action> + <action type="update" dev="fgiust"> + Added ability to set a schema name in it.openutils.migration.generic.JdbcObjectCreationTask and + it.openutils.migration.generic.JdbcIfColumnExistsConditionalTask + </action> + </release> + </body> +</document> \ No newline at end of file Property changes on: trunk/openutils-dbmigration/src/site/changes/changes.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:42:31
|
Revision: 610 http://openutils.svn.sourceforge.net/openutils/?rev=610&view=rev Author: fgiust Date: 2008-02-11 12:42:17 -0800 (Mon, 11 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-deployment/pom.xml Modified: trunk/openutils-deployment/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-02-11 20:42:07 UTC (rev 609) +++ trunk/openutils-deployment/pom.xml 2008-02-11 20:42:17 UTC (rev 610) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-deployment</artifactId> <name>openutils deployment tools</name> - <version>2.0.1</version> + <version>2.0.2-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -67,10 +67,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-2.0.1</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:42:21
|
Revision: 609 http://openutils.svn.sourceforge.net/openutils/?rev=609&view=rev Author: fgiust Date: 2008-02-11 12:42:07 -0800 (Mon, 11 Feb 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-deployment-2.0.1 Added Paths: ----------- tags/openutils-deployment-2.0.1/ tags/openutils-deployment-2.0.1/pom.xml tags/openutils-deployment-2.0.1/src/site/changes/ Removed Paths: ------------- tags/openutils-deployment-2.0.1/pom.xml Copied: tags/openutils-deployment-2.0.1 (from rev 606, trunk/openutils-deployment) Deleted: tags/openutils-deployment-2.0.1/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-02-11 20:36:23 UTC (rev 606) +++ tags/openutils-deployment-2.0.1/pom.xml 2008-02-11 20:42:07 UTC (rev 609) @@ -1,70 +0,0 @@ -<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> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-deployment</artifactId> - <name>openutils deployment tools</name> - <version>2.0.1-SNAPSHOT</version> - <description /> - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - <optional>true</optional> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.0</version> - <scope>test</scope> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-deployment-2.0.1/pom.xml (from rev 608, trunk/openutils-deployment/pom.xml) =================================================================== --- tags/openutils-deployment-2.0.1/pom.xml (rev 0) +++ tags/openutils-deployment-2.0.1/pom.xml 2008-02-11 20:42:07 UTC (rev 609) @@ -0,0 +1,76 @@ +<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> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-deployment</artifactId> + <name>openutils deployment tools</name> + <version>2.0.1</version> + <description /> + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.0</version> + <scope>test</scope> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-2.0.1</url> + </scm> +</project> \ No newline at end of file Copied: tags/openutils-deployment-2.0.1/src/site/changes (from rev 607, trunk/openutils-deployment/src/site/changes) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:41:51
|
Revision: 608 http://openutils.svn.sourceforge.net/openutils/?rev=608&view=rev Author: fgiust Date: 2008-02-11 12:41:53 -0800 (Mon, 11 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-deployment-2.0.1 Modified Paths: -------------- trunk/openutils-deployment/pom.xml Modified: trunk/openutils-deployment/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-02-11 20:41:27 UTC (rev 607) +++ trunk/openutils-deployment/pom.xml 2008-02-11 20:41:53 UTC (rev 608) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-deployment</artifactId> <name>openutils deployment tools</name> - <version>2.0.1-SNAPSHOT</version> + <version>2.0.1</version> <description /> <dependencies> <dependency> @@ -67,4 +67,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-2.0.1</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:41:26
|
Revision: 607 http://openutils.svn.sourceforge.net/openutils/?rev=607&view=rev Author: fgiust Date: 2008-02-11 12:41:27 -0800 (Mon, 11 Feb 2008) Log Message: ----------- changes Added Paths: ----------- trunk/openutils-deployment/src/site/changes/ trunk/openutils-deployment/src/site/changes/changes.xml Added: trunk/openutils-deployment/src/site/changes/changes.xml =================================================================== --- trunk/openutils-deployment/src/site/changes/changes.xml (rev 0) +++ trunk/openutils-deployment/src/site/changes/changes.xml 2008-02-11 20:41:27 UTC (rev 607) @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="2.0.1" date="2008-02-11" description="2.0.1"> + <action type="fix" dev="fgiust"> + Better handling of classpath resources in it.openutils.deployment.spring.EnvironmentPropertyConfigurer + (resources with "classpath:" prefix were not loaded properly in a web application). + </action> + </release> + </body> +</document> \ No newline at end of file Property changes on: trunk/openutils-deployment/src/site/changes/changes.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-11 20:38:31
|
Revision: 606 http://openutils.svn.sourceforge.net/openutils/?rev=606&view=rev Author: fgiust Date: 2008-02-11 12:36:23 -0800 (Mon, 11 Feb 2008) Log Message: ----------- better handling of classpath resources Modified Paths: -------------- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 22:50:06 UTC (rev 605) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-11 20:36:23 UTC (rev 606) @@ -230,7 +230,7 @@ { URL url = null; - if (servletContext != null) + if (servletContext != null && !StringUtils.contains(resource, "classpath:")) { try { @@ -262,7 +262,7 @@ url = null; } } - else + if (url == null) { try { @@ -323,6 +323,7 @@ */ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + // don't implement ServletContextAware or it will fail if javax.servlet dependency is not available try { if (applicationContext instanceof WebApplicationContext) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 22:50:04
|
Revision: 605 http://openutils.svn.sourceforge.net/openutils/?rev=605&view=rev Author: fgiust Date: 2008-02-03 14:50:06 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 22:49:59 UTC (rev 604) +++ trunk/openutils-dbmigration/pom.xml 2008-02-03 22:50:06 UTC (rev 605) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> - <version>2.0.1</version> + <version>2.0.2-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -93,10 +93,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.1</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 22:49:56
|
Revision: 604 http://openutils.svn.sourceforge.net/openutils/?rev=604&view=rev Author: fgiust Date: 2008-02-03 14:49:59 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-dbmigration-2.0.1 Added Paths: ----------- tags/openutils-dbmigration-2.0.1/ tags/openutils-dbmigration-2.0.1/pom.xml tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java Removed Paths: ------------- tags/openutils-dbmigration-2.0.1/pom.xml tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java Copied: tags/openutils-dbmigration-2.0.1 (from rev 594, trunk/openutils-dbmigration) Deleted: tags/openutils-dbmigration-2.0.1/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-dbmigration-2.0.1/pom.xml 2008-02-03 22:49:59 UTC (rev 604) @@ -1,97 +0,0 @@ -<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> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-dbmigration</artifactId> - <name>openutils db migration</name> - <version>2.0-SNAPSHOT</version> - <description /> - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.apache.poi</groupId> - <artifactId>poi</artifactId> - <version>3.0-FINAL</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-dbmigration-2.0.1/pom.xml (from rev 603, trunk/openutils-dbmigration/pom.xml) =================================================================== --- tags/openutils-dbmigration-2.0.1/pom.xml (rev 0) +++ tags/openutils-dbmigration-2.0.1/pom.xml 2008-02-03 22:49:59 UTC (rev 604) @@ -0,0 +1,102 @@ +<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> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-dbmigration</artifactId> + <name>openutils db migration</name> + <version>2.0.1</version> + <description /> + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + <version>3.0-FINAL</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.1</url> + </scm> +</project> \ No newline at end of file Deleted: tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-03 22:49:59 UTC (rev 604) @@ -1,63 +0,0 @@ -package it.openutils.migration.generic; - -import it.openutils.migration.task.setup.BaseConditionalTask; - -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.apache.commons.lang.StringUtils; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class JdbcIfColumnExistsConditionalTask extends BaseConditionalTask -{ - - private String column; - - /** - * Sets the column. - * @param column the column to set - */ - public void setColumn(String column) - { - this.column = column; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) - { - final String catalog = null; - final String schema = null; - - String columnTrim = StringUtils.trim(column); - - final String tableName = StringUtils.substringBefore(columnTrim, "."); - final String columnName = StringUtils.substringAfter(columnTrim, "."); - return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() - { - - public Object doInConnection(Connection con) throws SQLException, DataAccessException - { - - DatabaseMetaData dbMetadata = con.getMetaData(); - ResultSet rs = dbMetadata.getColumns(catalog, schema, tableName, columnName); - boolean tableExists = rs.first(); - rs.close(); - - return !tableExists; - } - }); - } - -} Copied: tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java (from rev 602, trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java) =================================================================== --- tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java (rev 0) +++ tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-03 22:49:59 UTC (rev 604) @@ -0,0 +1,63 @@ +package it.openutils.migration.generic; + +import it.openutils.migration.task.setup.BaseConditionalTask; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; + +import org.apache.commons.lang.StringUtils; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ConnectionCallback; +import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class JdbcIfColumnExistsConditionalTask extends BaseConditionalTask +{ + + private String column; + + /** + * Sets the column. + * @param column the column to set + */ + public void setColumn(String column) + { + this.column = column; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean check(SimpleJdbcTemplate jdbcTemplate) + { + final String catalog = null; + final String schema = null; + + String columnTrim = StringUtils.trim(column); + + final String tableName = StringUtils.substringBefore(columnTrim, "."); + final String columnName = StringUtils.substringAfter(columnTrim, "."); + return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + { + + public Object doInConnection(Connection con) throws SQLException, DataAccessException + { + + DatabaseMetaData dbMetadata = con.getMetaData(); + ResultSet rs = dbMetadata.getColumns(catalog, schema, tableName, columnName); + boolean tableExists = rs.next(); + rs.close(); + + return !tableExists; + } + }); + } + +} Deleted: tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-03 22:49:59 UTC (rev 604) @@ -1,137 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.migration.generic; - -import it.openutils.migration.task.setup.GenericConditionalTask; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.SQLException; - -import javax.sql.DataSource; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.springframework.core.io.Resource; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; - - -/** - * @author fgiust - * @version $Id:SqlServerObjCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ - */ -public abstract class JdbcObjectCreationTask extends GenericConditionalTask -{ - - protected String catalog; - - abstract String getObjectType(); - - /** - * {@inheritDoc} - */ - @Override - public void execute(DataSource dataSource) - { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); - - for (Resource script : scripts) - { - - if (script == null || !script.exists()) - { - log.error("Unable to execute db task \"{}\", script \"{}\" not found.", getDescription(), script); - return; - } - - String fqTableName = this.objectNameFromFileName(script); - String tmptableName = null; - String tmpschema = null; - - if (StringUtils.contains(fqTableName, ".")) - { - String[] tokens = StringUtils.split(fqTableName, "."); - tmptableName = tokens[1]; - tmpschema = tokens[0]; - } - else - { - tmptableName = fqTableName; - } - - final String tableName = tmptableName; - final String schema = tmpschema; - - boolean result = (Boolean) new JdbcTemplate(dataSource).execute(new ConnectionCallback() - { - - public Object doInConnection(Connection con) throws SQLException, DataAccessException - { - - DatabaseMetaData dbMetadata = con.getMetaData(); - ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType() }); - boolean tableExists = rs.first(); - rs.close(); - - return tableExists; - } - }); - - if (!result) - { - String scriptContent; - InputStream is = null; - - try - { - is = script.getInputStream(); - scriptContent = IOUtils.toString(is, "UTF8"); - } - catch (IOException e) - { - log.error( - "Unable to execute db task \"{}\", script \"{}\" can't be read.", - getDescription(), - script); - return; - } - finally - { - IOUtils.closeQuietly(is); - } - - String[] ddls = StringUtils.split(scriptContent, ";"); - - log.info("Creating new {} {}", getObjectType(), tableName); - - for (String ddl : ddls) - { - if (StringUtils.isNotBlank(ddl)) - { - log.debug("Executing:\n{}", ddl); - jdbcTemplate.update(ddl); - } - } - } - } - } -} \ No newline at end of file Copied: tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java (from rev 602, trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java) =================================================================== --- tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java (rev 0) +++ tags/openutils-dbmigration-2.0.1/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-03 22:49:59 UTC (rev 604) @@ -0,0 +1,137 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.migration.generic; + +import it.openutils.migration.task.setup.GenericConditionalTask; + +import java.io.IOException; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.springframework.core.io.Resource; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ConnectionCallback; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; + + +/** + * @author fgiust + * @version $Id:SqlServerObjCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ + */ +public abstract class JdbcObjectCreationTask extends GenericConditionalTask +{ + + protected String catalog; + + abstract String getObjectType(); + + /** + * {@inheritDoc} + */ + @Override + public void execute(DataSource dataSource) + { + SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + + for (Resource script : scripts) + { + + if (script == null || !script.exists()) + { + log.error("Unable to execute db task \"{}\", script \"{}\" not found.", getDescription(), script); + return; + } + + String fqTableName = this.objectNameFromFileName(script); + String tmptableName = null; + String tmpschema = null; + + if (StringUtils.contains(fqTableName, ".")) + { + String[] tokens = StringUtils.split(fqTableName, "."); + tmptableName = tokens[1]; + tmpschema = tokens[0]; + } + else + { + tmptableName = fqTableName; + } + + final String tableName = tmptableName; + final String schema = tmpschema; + + boolean result = (Boolean) new JdbcTemplate(dataSource).execute(new ConnectionCallback() + { + + public Object doInConnection(Connection con) throws SQLException, DataAccessException + { + + DatabaseMetaData dbMetadata = con.getMetaData(); + ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType() }); + boolean tableExists = rs.next(); + rs.close(); + + return tableExists; + } + }); + + if (!result) + { + String scriptContent; + InputStream is = null; + + try + { + is = script.getInputStream(); + scriptContent = IOUtils.toString(is, "UTF8"); + } + catch (IOException e) + { + log.error( + "Unable to execute db task \"{}\", script \"{}\" can't be read.", + getDescription(), + script); + return; + } + finally + { + IOUtils.closeQuietly(is); + } + + String[] ddls = StringUtils.split(scriptContent, ";"); + + log.info("Creating new {} {}", getObjectType(), tableName); + + for (String ddl : ddls) + { + if (StringUtils.isNotBlank(ddl)) + { + log.debug("Executing:\n{}", ddl); + jdbcTemplate.update(ddl); + } + } + } + } + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 22:49:45
|
Revision: 603 http://openutils.svn.sourceforge.net/openutils/?rev=603&view=rev Author: fgiust Date: 2008-02-03 14:49:49 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-dbmigration-2.0.1 Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 22:46:41 UTC (rev 602) +++ trunk/openutils-dbmigration/pom.xml 2008-02-03 22:49:49 UTC (rev 603) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> - <version>2.0.1-SNAPSHOT</version> + <version>2.0.1</version> <description /> <dependencies> <dependency> @@ -93,4 +93,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.1</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 22:46:36
|
Revision: 602 http://openutils.svn.sourceforge.net/openutils/?rev=602&view=rev Author: fgiust Date: 2008-02-03 14:46:41 -0800 (Sun, 03 Feb 2008) Log Message: ----------- rs.next() instead of rs.first() Modified Paths: -------------- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-03 21:20:15 UTC (rev 601) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2008-02-03 22:46:41 UTC (rev 602) @@ -52,7 +52,7 @@ DatabaseMetaData dbMetadata = con.getMetaData(); ResultSet rs = dbMetadata.getColumns(catalog, schema, tableName, columnName); - boolean tableExists = rs.first(); + boolean tableExists = rs.next(); rs.close(); return !tableExists; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-03 21:20:15 UTC (rev 601) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2008-02-03 22:46:41 UTC (rev 602) @@ -89,7 +89,7 @@ DatabaseMetaData dbMetadata = con.getMetaData(); ResultSet rs = dbMetadata.getTables(catalog, schema, tableName, new String[]{getObjectType() }); - boolean tableExists = rs.first(); + boolean tableExists = rs.next(); rs.close(); return tableExists; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:20:11
|
Revision: 601 http://openutils.svn.sourceforge.net/openutils/?rev=601&view=rev Author: fgiust Date: 2008-02-03 13:20:15 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-deployment/pom.xml Modified: trunk/openutils-deployment/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-02-03 21:20:09 UTC (rev 600) +++ trunk/openutils-deployment/pom.xml 2008-02-03 21:20:15 UTC (rev 601) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-deployment</artifactId> <name>openutils deployment tools</name> - <version>2.0</version> + <version>2.0.1-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -67,10 +67,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-2.0</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:20:03
|
Revision: 600 http://openutils.svn.sourceforge.net/openutils/?rev=600&view=rev Author: fgiust Date: 2008-02-03 13:20:09 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-deployment-2.0 Added Paths: ----------- tags/openutils-deployment-2.0/ tags/openutils-deployment-2.0/pom.xml tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java tags/openutils-deployment-2.0/src/site/apt/index.apt Removed Paths: ------------- tags/openutils-deployment-2.0/pom.xml tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java tags/openutils-deployment-2.0/src/site/apt/index.apt Copied: tags/openutils-deployment-2.0 (from rev 594, trunk/openutils-deployment) Deleted: tags/openutils-deployment-2.0/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-deployment-2.0/pom.xml 2008-02-03 21:20:09 UTC (rev 600) @@ -1,71 +0,0 @@ -<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> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-deployment</artifactId> - <name>openutils deployment tools</name> - <version>2.0-SNAPSHOT</version> - <description /> - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - <optional>true</optional> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.0</version> - <scope>test</scope> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-deployment-2.0/pom.xml (from rev 599, trunk/openutils-deployment/pom.xml) =================================================================== --- tags/openutils-deployment-2.0/pom.xml (rev 0) +++ tags/openutils-deployment-2.0/pom.xml 2008-02-03 21:20:09 UTC (rev 600) @@ -0,0 +1,76 @@ +<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> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-deployment</artifactId> + <name>openutils deployment tools</name> + <version>2.0</version> + <description /> + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.0</version> + <scope>test</scope> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-2.0</url> + </scm> +</project> \ No newline at end of file Deleted: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-02-03 21:20:09 UTC (rev 600) @@ -1,80 +0,0 @@ -package it.openutils.deployment.log4j; - -import java.io.File; -import java.io.FileNotFoundException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.text.MessageFormat; - -import javax.servlet.ServletContext; - -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.StringUtils; - - -/** - * @author fgiust - * @version $Id$ - */ -public class DeploymentResolver -{ - - public static File resolveServerRelativeLocation(ServletContext context, String commaSeparatedListOfPaths) - throws FileNotFoundException - { - String[] propertiesLocation = StringUtils.split(commaSeparatedListOfPaths, ','); - - String servername = resolveServerName(); - - String rootPath = StringUtils.replace(context.getRealPath("/"), "\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ - String webapp = StringUtils.substringAfterLast(rootPath, "/"); //$NON-NLS-1$ - - for (int j = 0; j < propertiesLocation.length; j++) - { - String location = StringUtils.trim(propertiesLocation[j]); - location = StringUtils.replace(location, "${servername}", servername); //$NON-NLS-1$ - location = StringUtils.replace(location, "${webapp}", webapp); //$NON-NLS-1$ - - File initFile = new File(rootPath, location); - - if (!initFile.exists() || initFile.isDirectory()) - { - continue; - } - - return initFile; - - } - - throw new FileNotFoundException( - MessageFormat - .format( - "No configuration found using location list {0}. [servername] is [{1}], [webapp] is [{2}] and base path is [{3}]", //$NON-NLS-1$ - new Object[]{ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath })); - - } - - /** - * Resolve the current server name. - * @return server name, all lowercase, without domain - */ - public static String resolveServerName() - { - String servername = null; - - try - { - servername = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName()); - if (StringUtils.contains(servername, ".")) - { - servername = StringUtils.substringBefore(servername, "."); - } - - } - catch (UnknownHostException e) - { - System.err.println(e.getMessage()); - } - return servername; - } -} Copied: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java (from rev 598, trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java) =================================================================== --- tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java (rev 0) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-02-03 21:20:09 UTC (rev 600) @@ -0,0 +1,95 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.deployment.log4j; + +import java.io.File; +import java.io.FileNotFoundException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.text.MessageFormat; + +import javax.servlet.ServletContext; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; + + +/** + * @author fgiust + * @version $Id$ + */ +public class DeploymentResolver +{ + + public static File resolveServerRelativeLocation(ServletContext context, String commaSeparatedListOfPaths) + throws FileNotFoundException + { + String[] propertiesLocation = StringUtils.split(commaSeparatedListOfPaths, ','); + + String servername = resolveServerName(); + + String rootPath = StringUtils.replace(context.getRealPath("/"), "\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ + String webapp = StringUtils.substringAfterLast(rootPath, "/"); //$NON-NLS-1$ + + for (int j = 0; j < propertiesLocation.length; j++) + { + String location = StringUtils.trim(propertiesLocation[j]); + location = StringUtils.replace(location, "${servername}", servername); //$NON-NLS-1$ + location = StringUtils.replace(location, "${webapp}", webapp); //$NON-NLS-1$ + + File initFile = new File(rootPath, location); + + if (!initFile.exists() || initFile.isDirectory()) + { + continue; + } + + return initFile; + + } + + throw new FileNotFoundException( + MessageFormat + .format( + "No configuration found using location list {0}. [servername] is [{1}], [webapp] is [{2}] and base path is [{3}]", //$NON-NLS-1$ + new Object[]{ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath})); + + } + + /** + * Resolve the current server name. + * @return server name, all lowercase, without domain + */ + public static String resolveServerName() + { + String servername = null; + + try + { + servername = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName()); + if (StringUtils.contains(servername, ".")) + { + servername = StringUtils.substringBefore(servername, "."); + } + + } + catch (UnknownHostException e) + { + System.err.println(e.getMessage()); + } + return servername; + } +} Deleted: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java 2008-02-03 21:20:09 UTC (rev 600) @@ -1,108 +0,0 @@ -package it.openutils.deployment.log4j; - -import java.io.FileNotFoundException; - -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; - -import org.springframework.util.Log4jConfigurer; -import org.springframework.web.util.Log4jConfigListener; -import org.springframework.web.util.WebUtils; - - -/** - * @author Fabrizio Giustina - * @version $Id$ - */ -public class EnvironmentLog4jConfigListener extends Log4jConfigListener -{ - - /** - * Default value for the DEFAULT_INITIALIZATION_PARAMETER parameter. - */ - public static final String DEFAULT_INITIALIZATION_PARAMETER = // - "WEB-INF/config/${servername}/${webapp}/log4j.xml," //$NON-NLS-1$ - + "WEB-INF/config/${servername}/log4j.xml," //$NON-NLS-1$ - + "WEB-INF/config/${webapp}/log4j.xml," //$NON-NLS-1$ - + "WEB-INF/config/default/log4j.xml," //$NON-NLS-1$ - + "WEB-INF/config/log4j.xml"; //$NON-NLS-1$ - - /** - * {@inheritDoc} - */ - @Override - public void contextInitialized(ServletContextEvent event) - { - initLogging(event.getServletContext()); - } - - public static void initLogging(ServletContext servletContext) - { - if (exposeWebAppRoot(servletContext)) - { - WebUtils.setWebAppRootSystemProperty(servletContext); - - String servername = DeploymentResolver.resolveServerName(); - if (servername != null) - { - System.setProperty("server.name", servername); - System.setProperty("server", servername); - } - } - - String locationList = servletContext.getInitParameter("log4jConfigLocation"); - - if (locationList == null) - { - locationList = DEFAULT_INITIALIZATION_PARAMETER; - } - - String location; - - try - { - location = DeploymentResolver.resolveServerRelativeLocation(servletContext, locationList).getAbsolutePath(); - } - catch (FileNotFoundException ex) - { - throw new IllegalArgumentException("Invalid 'log4jConfigLocation' parameter: " + ex.getMessage()); - } - if (location != null) - { - servletContext.log("Initializing Log4J from [" + location + "]"); - try - { - - String intervalString = servletContext.getInitParameter("log4jRefreshInterval"); - if (intervalString != null) - { - try - { - long refreshInterval = Long.parseLong(intervalString); - Log4jConfigurer.initLogging(location, refreshInterval); - } - catch (NumberFormatException ex) - { - throw new IllegalArgumentException("Invalid 'log4jRefreshInterval' parameter: " - + ex.getMessage()); - } - } - else - { - Log4jConfigurer.initLogging(location); - } - } - catch (FileNotFoundException ex) - { - throw new IllegalArgumentException("Invalid 'log4jConfigLocation' parameter: " + ex.getMessage()); - } - } - } - - private static boolean exposeWebAppRoot(ServletContext servletContext) - { - String exposeWebAppRootParam = servletContext.getInitParameter("log4jExposeWebAppRoot"); - return exposeWebAppRootParam == null || Boolean.valueOf(exposeWebAppRootParam).booleanValue(); - } - -} Copied: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java (from rev 598, trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java) =================================================================== --- tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java (rev 0) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java 2008-02-03 21:20:09 UTC (rev 600) @@ -0,0 +1,123 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.deployment.log4j; + +import java.io.FileNotFoundException; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; + +import org.springframework.util.Log4jConfigurer; +import org.springframework.web.util.Log4jConfigListener; +import org.springframework.web.util.WebUtils; + + +/** + * @author Fabrizio Giustina + * @version $Id$ + */ +public class EnvironmentLog4jConfigListener extends Log4jConfigListener +{ + + /** + * Default value for the DEFAULT_INITIALIZATION_PARAMETER parameter. + */ + public static final String DEFAULT_INITIALIZATION_PARAMETER = // + "WEB-INF/config/${servername}/${webapp}/log4j.xml," //$NON-NLS-1$ + + "WEB-INF/config/${servername}/log4j.xml," //$NON-NLS-1$ + + "WEB-INF/config/${webapp}/log4j.xml," //$NON-NLS-1$ + + "WEB-INF/config/default/log4j.xml," //$NON-NLS-1$ + + "WEB-INF/config/log4j.xml"; //$NON-NLS-1$ + + /** + * {@inheritDoc} + */ + @Override + public void contextInitialized(ServletContextEvent event) + { + initLogging(event.getServletContext()); + } + + public static void initLogging(ServletContext servletContext) + { + if (exposeWebAppRoot(servletContext)) + { + WebUtils.setWebAppRootSystemProperty(servletContext); + + String servername = DeploymentResolver.resolveServerName(); + if (servername != null) + { + System.setProperty("server.name", servername); + System.setProperty("server", servername); + } + } + + String locationList = servletContext.getInitParameter("log4jConfigLocation"); + + if (locationList == null) + { + locationList = DEFAULT_INITIALIZATION_PARAMETER; + } + + String location; + + try + { + location = DeploymentResolver.resolveServerRelativeLocation(servletContext, locationList).getAbsolutePath(); + } + catch (FileNotFoundException ex) + { + throw new IllegalArgumentException("Invalid 'log4jConfigLocation' parameter: " + ex.getMessage()); + } + if (location != null) + { + servletContext.log("Initializing Log4J from [" + location + "]"); + try + { + + String intervalString = servletContext.getInitParameter("log4jRefreshInterval"); + if (intervalString != null) + { + try + { + long refreshInterval = Long.parseLong(intervalString); + Log4jConfigurer.initLogging(location, refreshInterval); + } + catch (NumberFormatException ex) + { + throw new IllegalArgumentException("Invalid 'log4jRefreshInterval' parameter: " + + ex.getMessage()); + } + } + else + { + Log4jConfigurer.initLogging(location); + } + } + catch (FileNotFoundException ex) + { + throw new IllegalArgumentException("Invalid 'log4jConfigLocation' parameter: " + ex.getMessage()); + } + } + } + + private static boolean exposeWebAppRoot(ServletContext servletContext) + { + String exposeWebAppRootParam = servletContext.getInitParameter("log4jExposeWebAppRoot"); + return exposeWebAppRootParam == null || Boolean.valueOf(exposeWebAppRootParam).booleanValue(); + } + +} Deleted: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-03 21:20:09 UTC (rev 600) @@ -1,175 +0,0 @@ -package it.openutils.deployment.spring; - -import java.io.IOException; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; - -import javax.sql.DataSource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.BeanInitializationException; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.context.ApplicationEvent; -import org.springframework.context.ApplicationListener; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowCallbackHandler; - - -/** - * @author fgiust - * @version $Id$ - */ -public class DatabaseEnvironmentPropertyConfigurer extends EnvironmentPropertyConfigurer - implements - ApplicationContextAware, - ApplicationListener -{ - - private static Logger log = LoggerFactory.getLogger(DatabaseEnvironmentPropertyConfigurer.class); - - private String sqlQuery; - - private String dataSourceName; - - private DataSource dataSource; - - private ApplicationContext applicationContext; - - public void setSqlQuery(String sqlQuery) - { - this.sqlQuery = sqlQuery; - } - - public void setDataSourceName(String dataSourceName) - { - this.dataSourceName = dataSourceName; - } - - /** - * {@inheritDoc} - */ - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException - { - this.applicationContext = applicationContext; - } - - /** - * Get Spring Context proprieties. - * @return A properties object containing all spring properties. - */ - @Override - public Properties getProperties() - { - // loadAndRefresh(); @todo is this needed anymore? - return properties; - } - - /** - * @throws IOException - */ - private void loadAndRefresh() throws IOException - { - properties = mergeProperties(); - refresh(); - } - - /** - * used to reload configuration code from db - */ - public void refresh() - { - manuallyLoadDatasource(); - - /** - * inner utility class to create properties from rows extracted by the query - * @author diego - * @version $Id$ - */ - class RowHandler implements RowCallbackHandler - { - - /** - * {@inheritDoc} - */ - public void processRow(final ResultSet rs) throws SQLException - { - String parmName = rs.getString(1); - String parmValue = rs.getString(2); - - log.debug("Configuring property {}={}", parmName, parmValue); - properties.put(parmName, parmValue); - - } - } - - JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); - try - { - jdbcTemplate.query(sqlQuery, new RowHandler()); - } - catch (DataAccessException e) - { - log.error(e.getMessage()); - } - } - - /** - * {@inheritDoc} - */ - public void onApplicationEvent(ApplicationEvent event) - { - manuallyLoadDatasource(); - } - - /** - * - */ - private void manuallyLoadDatasource() - { - if (dataSource == null) - { - dataSource = (DataSource) applicationContext.getBean(dataSourceName); - try - { - properties = mergeProperties(); - } - catch (IOException e) - { - log.debug("Exception while loading environment properties from file."); - } - } - } - - /** - * {@inheritDoc} - */ - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException - { - - super.postProcessBeanFactory(beanFactory); - - try - { - loadAndRefresh(); - Properties mergedProps = properties; - - // Convert the merged properties, if necessary. - convertProperties(mergedProps); - - // Let the subclass process the properties. - processProperties(beanFactory, mergedProps); - } - catch (IOException ex) - { - throw new BeanInitializationException("Could not load properties", ex); - } - - } -} Copied: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java (from rev 598, trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java) =================================================================== --- tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java (rev 0) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-03 21:20:09 UTC (rev 600) @@ -0,0 +1,190 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.deployment.spring; + +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; + +import javax.sql.DataSource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanInitializationException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowCallbackHandler; + + +/** + * @author fgiust + * @version $Id$ + */ +public class DatabaseEnvironmentPropertyConfigurer extends EnvironmentPropertyConfigurer + implements + ApplicationContextAware, + ApplicationListener +{ + + private static Logger log = LoggerFactory.getLogger(DatabaseEnvironmentPropertyConfigurer.class); + + private String sqlQuery; + + private String dataSourceName; + + private DataSource dataSource; + + private ApplicationContext applicationContext; + + public void setSqlQuery(String sqlQuery) + { + this.sqlQuery = sqlQuery; + } + + public void setDataSourceName(String dataSourceName) + { + this.dataSourceName = dataSourceName; + } + + /** + * {@inheritDoc} + */ + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + { + this.applicationContext = applicationContext; + } + + /** + * Get Spring Context proprieties. + * @return A properties object containing all spring properties. + */ + @Override + public Properties getProperties() + { + // loadAndRefresh(); @todo is this needed anymore? + return properties; + } + + /** + * @throws IOException + */ + private void loadAndRefresh() throws IOException + { + properties = mergeProperties(); + refresh(); + } + + /** + * used to reload configuration code from db + */ + public void refresh() + { + manuallyLoadDatasource(); + + /** + * inner utility class to create properties from rows extracted by the query + * @author diego + * @version $Id$ + */ + class RowHandler implements RowCallbackHandler + { + + /** + * {@inheritDoc} + */ + public void processRow(final ResultSet rs) throws SQLException + { + String parmName = rs.getString(1); + String parmValue = rs.getString(2); + + log.debug("Configuring property {}={}", parmName, parmValue); + properties.put(parmName, parmValue); + + } + } + + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); + try + { + jdbcTemplate.query(sqlQuery, new RowHandler()); + } + catch (DataAccessException e) + { + log.error(e.getMessage()); + } + } + + /** + * {@inheritDoc} + */ + public void onApplicationEvent(ApplicationEvent event) + { + manuallyLoadDatasource(); + } + + /** + * + */ + private void manuallyLoadDatasource() + { + if (dataSource == null) + { + dataSource = (DataSource) applicationContext.getBean(dataSourceName); + try + { + properties = mergeProperties(); + } + catch (IOException e) + { + log.debug("Exception while loading environment properties from file."); + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + { + + super.postProcessBeanFactory(beanFactory); + + try + { + loadAndRefresh(); + Properties mergedProps = properties; + + // Convert the merged properties, if necessary. + convertProperties(mergedProps); + + // Let the subclass process the properties. + processProperties(beanFactory, mergedProps); + } + catch (IOException ex) + { + throw new BeanInitializationException("Could not load properties", ex); + } + + } +} Deleted: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 21:20:09 UTC (rev 600) @@ -1,323 +0,0 @@ -package it.openutils.deployment.spring; - -import java.io.IOException; -import java.io.InputStream; -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.UnknownHostException; -import java.util.Properties; - -import javax.servlet.ServletContext; - -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.core.io.Resource; -import org.springframework.core.io.UrlResource; -import org.springframework.util.ResourceUtils; -import org.springframework.web.context.WebApplicationContext; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ApplicationContextAware -{ - - /** - * Application name (webapp name) variable. - */ - private static final String PROPERTY_APPL = "${appl}"; - - /** - * Environment (server name) variable. - */ - private static final String PROPERTY_ENV = "${env}"; - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(EnvironmentPropertyConfigurer.class); - - /** - * @deprecated use defaultLocation - */ - @Deprecated - private String defaultEnvironment; - - private ServletContext servletContext; - - private String fileLocation; - - /** - * Cached properties (super field is private). - */ - protected Properties properties; - - /** - * Are properties inherited from default configuration? default is true, - */ - private boolean inherit = true; - - /** - * Setter for <code>fileLocation</code>. - * @param fileLocation The fileLocation to set. - */ - public void setFileLocation(String fileLocation) - { - this.fileLocation = fileLocation; - } - - /** - * Sets the inherit. - * @param inherit the inherit to set - */ - public void setInherit(boolean inherit) - { - this.inherit = inherit; - } - - /** - * Setter for <code>defaultEnvironment</code>. - * @param defaultEnvironment The defaultEnvironment to set. - * @deprecated use defaultLocation - */ - @Deprecated - public void setDefaultEnvironment(String defaultEnvironment) - { - this.defaultEnvironment = defaultEnvironment; - } - - /** - * {@inheritDoc} - */ - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException - { - if (fileLocation != null) - { - - String hostname = null; - try - { - hostname = StringUtils.substringBefore( - StringUtils.lowerCase(InetAddress.getLocalHost().getHostName()), - "."); - } - catch (UnknownHostException e) - { - log.error(e.getMessage()); // should not happen - } - - if (hostname != null) - { - System.setProperty("env", hostname); - } - - String applName = getApplicationName(); - if (applName != null) - { - System.setProperty("appl", applName); - } - - URL propertyUrl = null; - - String fileLocationFull = fileLocation; - - if (defaultEnvironment != null) - { - log.warn("Usage of \"defaultEnvironment\" is deprecated, please specify the fallback location " - + "as the last comma separated value in \"fileLocation\""); - fileLocationFull = fileLocationFull - + "," - + StringUtils.replace(fileLocationFull, PROPERTY_ENV, this.defaultEnvironment); - } - - String replacedLocations = StringUtils.replace(fileLocationFull, PROPERTY_ENV, hostname); - replacedLocations = StringUtils.replace(replacedLocations, PROPERTY_APPL, applName); - - String[] locations = StringUtils.split(replacedLocations, ","); - - if (inherit) - { - ArrayUtils.reverse(locations); - } - - Properties props = new Properties(); - boolean found = false; - - for (String loc : locations) - { - propertyUrl = getResource(StringUtils.strip(loc)); - if (propertyUrl != null) - { - found = true; - log.debug("Loading property file at {}", loc); - - Resource resource = new UrlResource(propertyUrl); - InputStream is = null; - - try - { - is = resource.getInputStream(); - props.load(is); - } - catch (IOException e) - { - log.error("Error loading " + propertyUrl.toString(), e); - } - finally - { - if (is != null) - { - try - { - is.close(); - } - catch (IOException e) - { - // ignore - } - } - } - - if (!inherit) - { - break; - } - } - log.debug("Property file not found at {}", loc); - - } - - if (!found) - { - log.error("No properties found at {}", replacedLocations); - } - - this.properties = props; - super.setProperties(props); - - } - - super.postProcessBeanFactory(beanFactory); - } - - private URL getResource(String resource) - { - URL url = null; - - if (servletContext != null) - { - try - { - if (resource != null && !resource.startsWith("/")) - { - url = servletContext.getResource("/" + resource); - } - else - { - url = servletContext.getResource(resource); - } - - if (url != null) - { - // check needed for servletUnit - // we need to check for a connection because getResource always returns a URL, also if the resource - // doesn't exists - url.openConnection().connect(); - } - - } - catch (MalformedURLException e) - { - log.error(e.getMessage(), e); - } - catch (IOException e) - { - // ignore, URL is not a valid resource - url = null; - } - } - else - { - try - { - url = ResourceUtils.getURL(resource); - url.openStream().close(); // test if the resource actually exists - } - catch (IOException e) - { - // ignore, can be normal - url = null; - } - } - return url; - } - - private String getApplicationName() - { - if (servletContext != null) - { - String url = servletContext.getRealPath("/"); - url = StringUtils.replace(url, "\\", "/"); - if (url.endsWith("/")) - { - url = StringUtils.substringBeforeLast(url, "/"); - } - - return StringUtils.substringAfterLast(url, "/"); - } - return StringUtils.EMPTY; - } - - /** - * Returns the Properties loaded by this configurer. - * @return Properties - */ - public Properties getProperties() - { - return properties; - } - - /** - * Returns a single property. - * @param key Property key - * @return property value or <code>null</code> if not found. - */ - public String getProperty(String key) - { - // better be safe, it doesn't hurt - if (properties == null) - { - return null; - } - return properties.getProperty(key); - } - - /** - * {@inheritDoc} - */ - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException - { - try - { - if (applicationContext instanceof WebApplicationContext) - { - this.servletContext = ((WebApplicationContext) applicationContext).getServletContext(); - } - } - catch (NoClassDefFoundError e) - { - // ignore, we are not in a web project or spring web is not available - } - } -} Copied: tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java (from rev 598, trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java) =================================================================== --- tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java (rev 0) +++ tags/openutils-deployment-2.0/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 21:20:09 UTC (rev 600) @@ -0,0 +1,338 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.deployment.spring; + +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.UnknownHostException; +import java.util.Properties; + +import javax.servlet.ServletContext; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.core.io.Resource; +import org.springframework.core.io.UrlResource; +import org.springframework.util.ResourceUtils; +import org.springframework.web.context.WebApplicationContext; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ApplicationContextAware +{ + + /** + * Application name (webapp name) variable. + */ + private static final String PROPERTY_APPL = "${appl}"; + + /** + * Environment (server name) variable. + */ + private static final String PROPERTY_ENV = "${env}"; + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(EnvironmentPropertyConfigurer.class); + + /** + * @deprecated use defaultLocation + */ + @Deprecated + private String defaultEnvironment; + + private ServletContext servletContext; + + private String fileLocation; + + /** + * Cached properties (super field is private). + */ + protected Properties properties; + + /** + * Are properties inherited from default configuration? default is true, + */ + private boolean inherit = true; + + /** + * Setter for <code>fileLocation</code>. + * @param fileLocation The fileLocation to set. + */ + public void setFileLocation(String fileLocation) + { + this.fileLocation = fileLocation; + } + + /** + * Sets the inherit. + * @param inherit the inherit to set + */ + public void setInherit(boolean inherit) + { + this.inherit = inherit; + } + + /** + * Setter for <code>defaultEnvironment</code>. + * @param defaultEnvironment The defaultEnvironment to set. + * @deprecated use defaultLocation + */ + @Deprecated + public void setDefaultEnvironment(String defaultEnvironment) + { + this.defaultEnvironment = defaultEnvironment; + } + + /** + * {@inheritDoc} + */ + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + { + if (fileLocation != null) + { + + String hostname = null; + try + { + hostname = StringUtils.substringBefore( + StringUtils.lowerCase(InetAddress.getLocalHost().getHostName()), + "."); + } + catch (UnknownHostException e) + { + log.error(e.getMessage()); // should not happen + } + + if (hostname != null) + { + System.setProperty("env", hostname); + } + + String applName = getApplicationName(); + if (applName != null) + { + System.setProperty("appl", applName); + } + + URL propertyUrl = null; + + String fileLocationFull = fileLocation; + + if (defaultEnvironment != null) + { + log.warn("Usage of \"defaultEnvironment\" is deprecated, please specify the fallback location " + + "as the last comma separated value in \"fileLocation\""); + fileLocationFull = fileLocationFull + + "," + + StringUtils.replace(fileLocationFull, PROPERTY_ENV, this.defaultEnvironment); + } + + String replacedLocations = StringUtils.replace(fileLocationFull, PROPERTY_ENV, hostname); + replacedLocations = StringUtils.replace(replacedLocations, PROPERTY_APPL, applName); + + String[] locations = StringUtils.split(replacedLocations, ","); + + if (inherit) + { + ArrayUtils.reverse(locations); + } + + Properties props = new Properties(); + boolean found = false; + + for (String loc : locations) + { + propertyUrl = getResource(StringUtils.strip(loc)); + if (propertyUrl != null) + { + found = true; + log.debug("Loading property file at {}", loc); + + Resource resource = new UrlResource(propertyUrl); + InputStream is = null; + + try + { + is = resource.getInputStream(); + props.load(is); + } + catch (IOException e) + { + log.error("Error loading " + propertyUrl.toString(), e); + } + finally + { + if (is != null) + { + try + { + is.close(); + } + catch (IOException e) + { + // ignore + } + } + } + + if (!inherit) + { + break; + } + } + log.debug("Property file not found at {}", loc); + + } + + if (!found) + { + log.error("No properties found at {}", replacedLocations); + } + + this.properties = props; + super.setProperties(props); + + } + + super.postProcessBeanFactory(beanFactory); + } + + private URL getResource(String resource) + { + URL url = null; + + if (servletContext != null) + { + try + { + if (resource != null && !resource.startsWith("/")) + { + url = servletContext.getResource("/" + resource); + } + else + { + url = servletContext.getResource(resource); + } + + if (url != null) + { + // check needed for servletUnit + // we need to check for a connection because getResource always returns a URL, also if the resource + // doesn't exists + url.openConnection().connect(); + } + + } + catch (MalformedURLException e) + { + log.error(e.getMessage(), e); + } + catch (IOException e) + { + // ignore, URL is not a valid resource + url = null; + } + } + else + { + try + { + url = ResourceUtils.getURL(resource); + url.openStream().close(); // test if the resource actually exists + } + catch (IOException e) + { + // ignore, can be normal + url = null; + } + } + return url; + } + + private String getApplicationName() + { + if (servletContext != null) + { + String url = servletContext.getRealPath("/"); + url = StringUtils.replace(url, "\\", "/"); + if (url.endsWith("/")) + { + url = StringUtils.substringBeforeLast(url, "/"); + } + + return StringUtils.substringAfterLast(url, "/"); + } + return StringUtils.EMPTY; + } + + /** + * Returns the Properties loaded by this configurer. + * @return Properties + */ + public Properties getProperties() + { + return properties; + } + + /** + * Returns a single property. + * @param key Property key + * @return property value or <code>null</code> if not found. + */ + public String getProperty(String key) + { + // better be safe, it doesn't hurt + if (properties == null) + { + return null; + } + return properties.getProperty(key); + } + + /** + * {@inheritDoc} + */ + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + { + try + { + if (applicationContext instanceof WebApplicationContext) + { + this.servletContext = ((WebApplicationContext) applicationContext).getServletContext(); + } + } + catch (NoClassDefFoundError e) + { + // ignore, we are not in a web project or spring web is not available + } + } +} Deleted: tags/openutils-deployment-2.0/src/site/apt/index.apt =================================================================== --- trunk/openutils-deployment/src/site/apt/index.apt 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-deployment-2.0/src/site/apt/index.apt 2008-02-03 21:20:09 UTC (rev 600) @@ -1,15 +0,0 @@ - -------------------------- - O p e n u t i l s - -------------------------- - Fabrizio Giustina - -------------------------- - -openutils-deployment - - - - -Released versions - - Check it at {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-deployment}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-deployment}} - Copied: tags/openutils-deployment-2.0/src/site/apt/index.apt (from rev 598, trunk/openutils-deployment/src/site/apt/index.apt) =================================================================== --- tags/openutils-deployment-2.0/src/site/apt/index.apt (rev 0) +++ tags/openutils-deployment-2.0/src/site/apt/index.apt 2008-02-03 21:20:09 UTC (rev 600) @@ -0,0 +1,42 @@ + -------------------------- + O p e n u t i l s + -------------------------- + Fabrizio Giustina + -------------------------- + +openutils-deployment + + Openutils-deployment contains a few utility classes that allow switching between different configurations in an application. + + Openutils-deployment works by embedding configurations for different environments in the final application, and by + choosing the correct configuration at runtime dependending on: + + * the server name + + * the webapp name (for web projects) + + [] + + You can find a spring propertyconfigurer and a log4j servlet listener that follow this pattern. + + The following example is a configuration snippet for <<<it.openutils.deployment.spring.EnvironmentPropertyConfigurer>>>: + The ${env} variable will be replaced at runtime with the name of the current server and any existing configuration file + wil be loaded. + + ++--------------------------------------------+ + <bean id="environmentProperties" class="it.openutils.deployment.spring.EnvironmentPropertyConfigurer"> + <property name="fileLocation" + value="WEB-INF/config/${env}/environment.properties, + WEB-INF/config/default/environment.properties, + classpath:environment-${env}.properties, + classpath:environment.properties" /> + </bean> ++--------------------------------------------+ + + + +Released versions + + Check it at {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-deployment}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-deployment}} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:19:45
|
Revision: 599 http://openutils.svn.sourceforge.net/openutils/?rev=599&view=rev Author: fgiust Date: 2008-02-03 13:19:50 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-deployment-2.0 Modified Paths: -------------- trunk/openutils-deployment/pom.xml Modified: trunk/openutils-deployment/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-02-03 21:19:10 UTC (rev 598) +++ trunk/openutils-deployment/pom.xml 2008-02-03 21:19:50 UTC (rev 599) @@ -1,5 +1,4 @@ -<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> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -9,7 +8,7 @@ </parent> <artifactId>openutils-deployment</artifactId> <name>openutils deployment tools</name> - <version>2.0-SNAPSHOT</version> + <version>2.0</version> <description /> <dependencies> <dependency> @@ -68,4 +67,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-2.0</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-2.0</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:19:05
|
Revision: 598 http://openutils.svn.sourceforge.net/openutils/?rev=598&view=rev Author: fgiust Date: 2008-02-03 13:19:10 -0800 (Sun, 03 Feb 2008) Log Message: ----------- docs Modified Paths: -------------- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java trunk/openutils-deployment/src/site/apt/index.apt Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-02-03 21:07:58 UTC (rev 597) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-02-03 21:19:10 UTC (rev 598) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.deployment.log4j; import java.io.File; @@ -50,7 +65,7 @@ MessageFormat .format( "No configuration found using location list {0}. [servername] is [{1}], [webapp] is [{2}] and base path is [{3}]", //$NON-NLS-1$ - new Object[]{ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath })); + new Object[]{ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath})); } Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java 2008-02-03 21:07:58 UTC (rev 597) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/EnvironmentLog4jConfigListener.java 2008-02-03 21:19:10 UTC (rev 598) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.deployment.log4j; import java.io.FileNotFoundException; Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-03 21:07:58 UTC (rev 597) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/DatabaseEnvironmentPropertyConfigurer.java 2008-02-03 21:19:10 UTC (rev 598) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.deployment.spring; import java.io.IOException; Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 21:07:58 UTC (rev 597) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 21:19:10 UTC (rev 598) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.deployment.spring; import java.io.IOException; Modified: trunk/openutils-deployment/src/site/apt/index.apt =================================================================== --- trunk/openutils-deployment/src/site/apt/index.apt 2008-02-03 21:07:58 UTC (rev 597) +++ trunk/openutils-deployment/src/site/apt/index.apt 2008-02-03 21:19:10 UTC (rev 598) @@ -6,9 +6,36 @@ openutils-deployment + Openutils-deployment contains a few utility classes that allow switching between different configurations in an application. + Openutils-deployment works by embedding configurations for different environments in the final application, and by + choosing the correct configuration at runtime dependending on: + * the server name + * the webapp name (for web projects) + + [] + + You can find a spring propertyconfigurer and a log4j servlet listener that follow this pattern. + + The following example is a configuration snippet for <<<it.openutils.deployment.spring.EnvironmentPropertyConfigurer>>>: + The ${env} variable will be replaced at runtime with the name of the current server and any existing configuration file + wil be loaded. + + ++--------------------------------------------+ + <bean id="environmentProperties" class="it.openutils.deployment.spring.EnvironmentPropertyConfigurer"> + <property name="fileLocation" + value="WEB-INF/config/${env}/environment.properties, + WEB-INF/config/default/environment.properties, + classpath:environment-${env}.properties, + classpath:environment.properties" /> + </bean> ++--------------------------------------------+ + + + Released versions Check it at {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-deployment}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-deployment}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:07:58
|
Revision: 597 http://openutils.svn.sourceforge.net/openutils/?rev=597&view=rev Author: fgiust Date: 2008-02-03 13:07:58 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 21:07:50 UTC (rev 596) +++ trunk/openutils-dbmigration/pom.xml 2008-02-03 21:07:58 UTC (rev 597) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> - <version>2.0</version> + <version>2.0.1-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -93,10 +93,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:07:46
|
Revision: 596 http://openutils.svn.sourceforge.net/openutils/?rev=596&view=rev Author: fgiust Date: 2008-02-03 13:07:50 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-dbmigration-2.0 Added Paths: ----------- tags/openutils-dbmigration-2.0/ tags/openutils-dbmigration-2.0/pom.xml Removed Paths: ------------- tags/openutils-dbmigration-2.0/pom.xml Copied: tags/openutils-dbmigration-2.0 (from rev 594, trunk/openutils-dbmigration) Deleted: tags/openutils-dbmigration-2.0/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 21:02:50 UTC (rev 594) +++ tags/openutils-dbmigration-2.0/pom.xml 2008-02-03 21:07:50 UTC (rev 596) @@ -1,97 +0,0 @@ -<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> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-dbmigration</artifactId> - <name>openutils db migration</name> - <version>2.0-SNAPSHOT</version> - <description /> - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.apache.poi</groupId> - <artifactId>poi</artifactId> - <version>3.0-FINAL</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-dbmigration-2.0/pom.xml (from rev 595, trunk/openutils-dbmigration/pom.xml) =================================================================== --- tags/openutils-dbmigration-2.0/pom.xml (rev 0) +++ tags/openutils-dbmigration-2.0/pom.xml 2008-02-03 21:07:50 UTC (rev 596) @@ -0,0 +1,102 @@ +<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> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-dbmigration</artifactId> + <name>openutils db migration</name> + <version>2.0</version> + <description /> + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + <version>3.0-FINAL</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0</url> + </scm> +</project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |