KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > jcr > BaseTest


1 package org.exoplatform.services.jcr;
2
3 import javax.jcr.Credentials;
4 import javax.jcr.Repository;
5 import javax.jcr.SimpleCredentials;
6 import javax.jcr.Ticket;
7 import javax.jcr.Workspace;
8
9 import junit.framework.TestCase;
10
11 import org.apache.commons.logging.Log;
12 import org.exoplatform.container.PortalContainer;
13 import org.exoplatform.container.RootContainer;
14 import org.exoplatform.services.log.LogService;
15
16 /**
17  * Created by The eXo Platform SARL .
18  *
19  * @author <a HREF="mailto:geaz@users.sourceforge.net">Gennady Azarenkov</a>
20  * @version $Id: BaseTest.java,v 1.14 2004/07/29 10:52:21 benjmestrallet Exp $
21  */

22 public class BaseTest extends TestCase {
23   protected Log log;
24   protected static String JavaDoc TEMP_PATH = "./temp/fsroot";
25   protected static String JavaDoc WORKSPACE = "ws";
26   protected Ticket ticket;
27   protected Repository repository;
28   protected Credentials credentials;
29   protected PortalContainer manager;
30   protected Workspace workspace;
31   protected RepositoryService repositoryService;
32
33   public void setUp() throws Exception JavaDoc {
34     try {
35       LogService service = (LogService) RootContainer.getInstance().
36           getComponentInstanceOfType(LogService.class);
37       log = service.getLog("org.exoplatform.services.jcr");
38       service.setLogLevel("org.exoplatform.services.jcr", LogService.DEBUG, true);
39       
40       PortalContainer servicesManager = PortalContainer.getInstance();
41                         
42       credentials = new SimpleCredentials("exo", "exo".toCharArray());
43                 
44       repositoryService =
45         (RepositoryService) servicesManager.getComponentInstanceOfType(RepositoryService.class);
46
47     } catch (Exception JavaDoc ex) {
48       ex.printStackTrace();
49     }
50   }
51 }
Popular Tags