1 7 package com.inversoft.verge.repository.config.test; 8 9 10 import junit.framework.TestCase; 11 12 import com.inversoft.config.ConfigBuilder; 13 import com.inversoft.config.ConfigRegistry; 14 import com.inversoft.verge.repository.config.RepositoryConfigBuilder; 15 import com.inversoft.verge.repository.config.RepositoryConfigFactory; 16 import com.inversoft.verge.repository.config.RepositoryConfigRegistry; 17 18 19 29 public class RepositoryConfigFactoryTest extends TestCase { 30 31 34 public RepositoryConfigFactoryTest(String name) { 35 super(name); 36 } 37 38 39 42 public void testAll() { 43 44 RepositoryConfigFactory factory = new RepositoryConfigFactory(); 45 ConfigBuilder builder = factory.createBuilder(); 46 47 assertTrue("Should be a repository builder", 48 builder instanceof RepositoryConfigBuilder); 49 assertSame("Should always return same instance", builder, 50 factory.createBuilder()); 51 assertSame("Should be same when calling create method", builder, 52 factory.createBuilder()); 53 54 ConfigRegistry registry = factory.createRegistry(); 55 56 assertTrue("Should be a repository registry", 57 registry instanceof RepositoryConfigRegistry); 58 assertNotSame("Should not return same instance", registry, 59 factory.createRegistry()); 60 } 61 } 62 | Popular Tags |