1 17 package org.alfresco.jcr.test; 18 19 import javax.jcr.Repository; 20 21 import junit.framework.TestCase; 22 23 import org.alfresco.jcr.repository.RepositoryFactory; 24 import org.alfresco.jcr.repository.RepositoryImpl; 25 import org.alfresco.service.cmr.repository.StoreRef; 26 import org.springframework.context.ApplicationContext; 27 import org.springframework.context.support.ClassPathXmlApplicationContext; 28 29 34 public class BaseJCRTest extends TestCase 35 { 36 private RepositoryImpl repositoryImpl; 37 protected Repository repository; 38 protected StoreRef storeRef; 39 40 private static ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:org/alfresco/jcr/test/test-context.xml"); 41 42 protected String getWorkspace() 43 { 44 return storeRef.getIdentifier(); 45 } 46 47 @Override 48 protected void setUp() throws Exception 49 { 50 storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); 51 TestData.generateTestData(applicationContext, storeRef.getIdentifier()); 52 repositoryImpl = (RepositoryImpl)applicationContext.getBean(RepositoryFactory.REPOSITORY_BEAN); 53 repositoryImpl.setDefaultWorkspace(storeRef.getIdentifier()); 54 repository = repositoryImpl; 55 } 56 57 } 58 | Popular Tags |