[opencms-dev] Running Unit test cases (was: [PATCH] PostgreSQL Support for OpenCms 6.x (CVS))

Alexander Kandzior alex at opencms.org
Mon Dec 6 12:36:27 CET 2004


Antonio,

It took me a couple of days, but I actually "repaired" the "unittests"
target in the build.xml file. Turns out there was a library missing. 

Let's assume you are able to run "ant war" and generate the OpenCms war
file. 

Try running "ant unittests". This will run all the Junit tests and write the
output to a file. The location of the file is ant specific and may depend on
your setup. Also, the optional "junit" target support for ant is required,
this usually comes in a "ant-junit.jar". Please check the ant homepage on
how to configure these since.

OpenCms configuration for unit tests:

The unit tests run with a pre-configured database configuration. The file
"/test/test.properties" contains the main test settings. Basically you must
configure the database you want to test here, as well as the local path
configuration where the data is located. 

Each database must come with it's own set of pre-configured
"opencms.properties". In the folder "/test/data/WEB-INF" you will find one
config.xxx folder for each supported database. These files are copied
automatically to "/test/data/WEB-INF/config" during test setup. 

For example, mySQL is configured by default in "test.propeties" with the
"db.product=mysql" setting. So the mySQL secific settings are taken form the
folder  "/test/data/WEB-INF/config.mysql". So in the mySQL example, it's
assumed that there is a local mysql installation, the user name is "root"
and the user has no password. All of this is located in
"opencms.properties". In case the test cases can't connect to the database,
you must modify these parameters.

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com

 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Antonio Core
> Sent: Thursday, December 02, 2004 2:56 PM
> To: The OpenCms mailing list
> Subject: RE: [opencms-dev] [PATCH] PostgreSQL Support for 
> OpenCms 6.x (CVS)
> 
> Alex,
> 
> Normally, I use jEdit as my development tool.
> 
> Anyway, I've already installed Eclipse (ver 3.1M3) and I'm 
> trying it. ;)
> 
> May you send me more informations about how proceed to setup 
> and perform JUnit tests with Eclipse?
> 
> Best Regards,
> 
> Antonio
> 
> 
> 
> On Thu, 2004-12-02 at 10:36, Alexander Kandzior wrote:
> > Are you using Eclipse for development?
> > If so, I can yout tell how we do it, since we are using Eclipse.
> > If not, there's also an ant task, but this may currently be broken.
> > 
> > Best Regards,
> > Alex.
> > 
> > Alexander Kandzior
> > Alkacon Software - The OpenCms Experts http://www.alkacon.com
> > 
> >  
> > 
> > > -----Original Message-----
> > > From: opencms-dev-bounces at opencms.org 
> > > [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Antonio Core
> > > Sent: Thursday, December 02, 2004 10:19 AM
> > > To: The OpenCms mailing list
> > > Subject: RE: [opencms-dev] [PATCH] PostgreSQL Support for OpenCms 
> > > 6.x (CVS)
> > > 
> > > Alex,
> > > 
> > > No, i didn't, sorry.
> > > 
> > > I think that it will be necessary too.
> > > 
> > > Thank you very much if you support me with that.
> > > 
> > > Best Regards,
> > > 
> > > Antonio
> > > 
> > > 
> > > On Thu, 2004-12-02 at 09:51, Alexander Kandzior wrote:
> > > > I applied these fixes to the CVS version.
> > > > 
> > > > Antonio, did you run the Junit tests for Postgessql? These
> > > are really
> > > > helpful since they have quite a broad range of daabase 
> operation 
> > > > covered already. If not I can support you in getting these
> > > up and running.
> > > > 
> > > > Best Regards,
> > > > Alex.
> > > > 
> > > > Alexander Kandzior
> > > > Alkacon Software - The OpenCms Experts http://www.alkacon.com
> > > > 
> > > >  
> > > > 
> > > > > -----Original Message-----
> > > > > From: opencms-dev-bounces at opencms.org 
> > > > > [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Antonio 
> > > > > Core
> > > > > Sent: Wednesday, December 01, 2004 10:14 PM
> > > > > To: OpenCms
> > > > > Subject: [opencms-dev] [PATCH] PostgreSQL Support for OpenCms 
> > > > > 6.x
> > > > > (CVS)
> > > > > 
> > > > > Dear all,
> > > > > 
> > > > > here is a patch for postgreSQL database support.
> > > > > 
> > > > > The files changed:
> > > > > 
> > > > > opencms/src/org/opencms/db/postgresql/CmsBackupDriver.java 
> > > > >         (specialized method deleteBackups of class   
> > > > >          opencms.src.org.opencms.db.generic.CmsBackupDriver)
> > > > > 
> > > > > opencms/src/org/opencms/db/postgresql/query.properties
> > > > >         (added queries:
> > > > >                 C_POSTGRESQL_BACKUP_DELETE_CONTENT
> > > > >                 C_POSTGRESQL_BACKUP_DELETE_RESOURCES
> > > > >                 C_POSTGRESQL_BACKUP_DELETE_STRUCTURE
> > > > >          removed query:
> > > > >                 C_BACKUP_DELETE_RESOURCE
> > > > >         )
> > > > > 
> > > > > 
> > > > > Having a CVS checkout of the opencms source, go into 
> the opencms 
> > > > > directory and launch the following command:
> > > > > 
> > > > > patch -p0 < ....path.../opencms_postgresql_01.patch
> > > > > 
> > > > > 
> > > > > Best Regards,
> > > > > 
> > > > > Antonio
> > > > > 
> > > > 
> > > > 
> > > > 
> > > > _______________________________________________
> > > > This mail is send to you from the opencms-dev mailing list
> > > To change
> > > > your list options, or to unsubscribe from the list, 
> please visit 
> > > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > This mail is send to you from the opencms-dev mailing 
> list To change 
> > > your list options, or to unsubscribe from the list, please visit 
> > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > > 
> > > 
> > 
> > 
> > 
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list 
> To change 
> > your list options, or to unsubscribe from the list, please visit 
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list To 
> change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 




More information about the opencms-dev mailing list