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 22 public class BaseTest extends TestCase { 23 protected Log log; 24 protected static String TEMP_PATH = "./temp/fsroot"; 25 protected static String 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 { 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 ex) { 48 ex.printStackTrace(); 49 } 50 } 51 } | Popular Tags |