>-----Original Message----- >From: Jasha Joachimsthal [mailto:[email protected]] >Sent: Tuesday, November 22, 2011 2:55 PM >To: [email protected] >Subject: Re: svn commit: r1205127 - in /incubator/rave/trunk: ./ rave-portal/ >rave-portal/src/test/resources/ rave-shindig/ rave- >shindig/src/main/resources/ rave-shindig/src/test/resources/ > >Shouldn't the test db run in memory or be deleted after the last test? >Reusing the db on a filesystem can lead to failing tests when transactions >aren't rolled back or the test data set changes between tests.
+1. It is also much faster than the files system backed DB. > >On 22 November 2011 19:59, <[email protected]> wrote: > >> Author: mpierce >> Date: Tue Nov 22 18:59:02 2011 >> New Revision: 1205127 >> >> URL: http://svn.apache.org/viewvc?rev=1205127&view=rev >> Log: >> (RAVE-353) Revised shindig and portal tests to also use the same file >> database instead of the memory databases; the test db and main db use >> separate files; removed the h2 server that rave-shindig started on port >> 22222. >> >> Modified: >> incubator/rave/trunk/pom.xml >> incubator/rave/trunk/rave-portal/pom.xml >> incubator/rave/trunk/rave-portal/src/test/resources/portal.properties >> incubator/rave/trunk/rave-shindig/pom.xml >> >> incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig- >dataContext.xml >> >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.custom.properties >> >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.properties >> >> Modified: incubator/rave/trunk/pom.xml >> URL: >> >http://svn.apache.org/viewvc/incubator/rave/trunk/pom.xml?rev=1205127& >r1=1205126&r2=1205127&view=diff >> >> >=========================================================== >=================== >> --- incubator/rave/trunk/pom.xml (original) >> +++ incubator/rave/trunk/pom.xml Tue Nov 22 18:59:02 2011 >> @@ -73,6 +73,7 @@ >> >> <!-- The location of Rave's H2 file DB. No trailing / --> >> <rave.database.location>/tmp/rave_db</rave.database.location> >> + >> ><rave.test.database.location>/tmp/rave_test_db</rave.test.database.locatio >n> >> >> <!-- Force maven-filesync-plugin rewrite the Eclipse FileSync >> plugin configuration with >> $mvn filesync:generate -Dmaven.filesync.override=true --> >> >> Modified: incubator/rave/trunk/rave-portal/pom.xml >> URL: >> http://svn.apache.org/viewvc/incubator/rave/trunk/rave- >portal/pom.xml?rev=1205127&r1=1205126&r2=1205127&view=diff >> >> >=========================================================== >=================== >> --- incubator/rave/trunk/rave-portal/pom.xml (original) >> +++ incubator/rave/trunk/rave-portal/pom.xml Tue Nov 22 18:59:02 2011 >> @@ -67,7 +67,7 @@ >> <groupId>org.apache.rave</groupId> >> <artifactId>rave-demo-gadgets</artifactId> >> <type>war</type> >> - <scope>provided</scope> >> + <scope>provided</scope> >> </dependency> >> >> <!-- Default database --> >> @@ -105,7 +105,14 @@ >> </dependencies> >> >> <build> >> - <defaultGoal>install</defaultGoal> >> + <defaultGoal>install</defaultGoal> >> + <testResources> >> + <testResource> >> + <directory>src/test/resources</directory> >> + <filtering>true</filtering> >> + </testResource> >> + </testResources> >> + >> <plugins> >> <plugin> >> <groupId>org.codehaus.cargo</groupId> >> >> Modified: >> incubator/rave/trunk/rave-portal/src/test/resources/portal.properties >> URL: >> http://svn.apache.org/viewvc/incubator/rave/trunk/rave- >portal/src/test/resources/portal.properties?rev=1205127&r1=1205126&r2=12 >05127&view=diff >> >> >=========================================================== >=================== >> --- incubator/rave/trunk/rave-portal/src/test/resources/portal.properties >> (original) >> +++ incubator/rave/trunk/rave-portal/src/test/resources/portal.properties >> Tue Nov 22 18:59:02 2011 >> @@ -34,7 +34,7 @@ portal.opensocial_security.domain=defaul >> portal.page.default_name=Main >> >> #Default Rave Portal database settings with in memory H2 database >> -portal.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1 >> >> >+portal.dataSource.url=jdbc:h2:${rave.test.database.location};AUTO_SERVER >=TRUE >> portal.dataSource.driver=org.h2.Driver >> portal.dataSource.username=sa >> portal.dataSource.password=local >> >> Modified: incubator/rave/trunk/rave-shindig/pom.xml >> URL: >> http://svn.apache.org/viewvc/incubator/rave/trunk/rave- >shindig/pom.xml?rev=1205127&r1=1205126&r2=1205127&view=diff >> >> >=========================================================== >=================== >> --- incubator/rave/trunk/rave-shindig/pom.xml (original) >> +++ incubator/rave/trunk/rave-shindig/pom.xml Tue Nov 22 18:59:02 2011 >> @@ -155,7 +155,12 @@ >> >> <build> >> <defaultGoal>install</defaultGoal> >> - >> + <testResources> >> + <testResource> >> + <directory>src/test/resources</directory> >> + <filtering>true</filtering> >> + </testResource> >> + </testResources> >> <resources> >> <resource> >> <directory>src/main/resources</directory> >> >> Modified: >> incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig- >dataContext.xml >> URL: >> http://svn.apache.org/viewvc/incubator/rave/trunk/rave- >shindig/src/main/resources/rave-shindig- >dataContext.xml?rev=1205127&r1=1205126&r2=1205127&view=diff >> >> >=========================================================== >=================== >> --- >> incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig- >dataContext.xml >> (original) >> +++ >> incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig- >dataContext.xml >> Tue Nov 22 18:59:02 2011 >> @@ -29,13 +29,4 @@ >> </list> >> </property> >> </bean> >> - >> - <!-- provides a H2 console to look into the db if necessary --> >> - <bean id="org.h2.tools.Server-WebServer" class="org.h2.tools.Server" >> - factory-method="createWebServer" depends-on="dataSource" >> - init-method="start" lazy-init="false" destroy-method="stop"> >> - <constructor-arg value="-web,-webPort,22222"/> >> - </bean> >> - >> - >> </beans> >> >> Modified: >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.custom.properties >> URL: >> http://svn.apache.org/viewvc/incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.custom.properties?rev=1205127&r1= >1205126&r2=1205127&view=diff >> >> >=========================================================== >=================== >> --- >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.custom.properties >> (original) >> +++ >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.custom.properties >> Tue Nov 22 18:59:02 2011 >> @@ -27,7 +27,7 @@ shindig.contextroot=customContext >> shindig.spring.base-package=org.apache.rave >> >> # Default Rave Shindig database settings with in memory H2 database >> -rave-shindig.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1 >> >> +rave- >shindig.dataSource.url=jdbc:h2:${rave.test.database.location};AUTO_SERVER >=TRUE >> rave-shindig.dataSource.driver=org.h2.Driver >> rave-shindig.dataSource.username=sa >> rave-shindig.dataSource.password=local >> >> Modified: >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.properties >> URL: >> http://svn.apache.org/viewvc/incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.properties?rev=1205127&r1=1205126 >&r2=1205127&view=diff >> >> >=========================================================== >=================== >> --- >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.properties >> (original) >> +++ >> incubator/rave/trunk/rave- >shindig/src/test/resources/rave.shindig.properties >> Tue Nov 22 18:59:02 2011 >> @@ -28,7 +28,7 @@ shindig.contextroot= >> shindig.spring.base-package=org.apache.rave >> >> # Default Rave Shindig database settings with in memory H2 database >> -rave-shindig.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1 >> >> +rave- >shindig.dataSource.url=jdbc:h2:${rave.test.database.location};AUTO_SERVER >=TRUE >> rave-shindig.dataSource.driver=org.h2.Driver >> rave-shindig.dataSource.username=sa >> rave-shindig.dataSource.password=local >> >> >>
