[opencms-dev] Unit Testing

HernĂ¡n Leoni hernan.leoni at globant.com
Mon Mar 3 20:14:29 CET 2008


Hi, you can connect to the instance using CmsShell,


// tomcat folder, (or servlet container folder)
    String tomcatDir = properties.getProperty("tomcat.dir");		 
// web app name, opencms by default
    String webAppName = properties.getProperty("tomcat.app.name");

    new CmsShell(tomcatDir + "/webapps/" + webAppName + "/WEB-INF/", null,
                null, "${user}@${project}>", null);
    cms = OpenCms.initCmsObject("Guest");
    cms.loginUser("Admin", "admin");

so, you yave a CmsObject to use with your opencms instance

Regards,

Hernan

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Bozidar Ilievski
Sent: Lunes, 03 de Marzo de 2008 05:03 p.m.
To: The OpenCms mailing list
Subject: [opencms-dev] Unit Testing

Hi.

I'm trying to write some unit test for an OpenCms Module that I'm 
developing.
These test should be run independently from the webapp, in another JVM.
But the problem is how to connect to the running instance of OpenCms and 
read/write to its VFS.

Simple example: how can I read some resource from the VFS, and print it 
to standard output.

Regards,
Bobi.

-- 
Bozidar Ilievski | bozidar.ilievski at netcetera.com.mk
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list