1 4 package org.openedit.repository; 5 6 import org.openedit.repository.filesystem.BaseRepositoryTest; 7 import org.openedit.repository.filesystem.FileItem; 8 import org.openedit.repository.filesystem.FileRepository; 9 10 import com.openedit.BaseTestCase; 11 12 13 16 public class CompoundRepositoryTest extends BaseTestCase 17 { 18 public CompoundRepositoryTest( String inName ) 19 { 20 super( inName ); 21 } 22 23 protected Repository createRepository() throws Exception 24 { 25 CompoundRepository repository = new CompoundRepository(); 26 BaseRepositoryTest test = new BaseRepositoryTest( "blah"); 27 test.makeIndexFile(); 28 repository.setDefaultRepository( test.getRepository() ); 29 repository.addRepository( "/openedit/test/*", new FileRepository(getRoot()) ); 30 return repository; 31 } 32 33 public void testGet() throws Exception 34 { 35 Repository repository = createRepository(); 36 ContentItem index = repository.get( "/index.html" ); 37 assertTrue(index instanceof FileItem ); 38 } 39 } 40 | Popular Tags |