1 7 package com.inversoft.verge.config.test; 8 9 10 import java.util.Map ; 11 12 import junit.framework.Assert; 13 14 import org.jdom.Document; 15 16 import com.inversoft.config.ConfigBuilder; 17 import com.inversoft.config.ConfigRegistry; 18 import com.inversoft.config.ConfigurationException; 19 20 21 30 public class TestConfigBuilder2 implements ConfigBuilder { 31 32 public static ConfigBuilder INSTANCE = new TestConfigBuilder2(); 33 34 36 public void build(Document document, ConfigRegistry registry) 37 throws ConfigurationException { 38 if (TestConfigFactory2.createRegistry) { 39 Assert.assertTrue("Should be new registry", 40 registry != TestConfigRegistry2.INSTANCE); 41 } else if (TestConfigFactory2.nullRegistry) { 42 Assert.assertTrue("Should be null registry", 43 registry == null); 44 } else { 45 Assert.assertTrue("Should be instance registry", 46 registry == TestConfigRegistry2.INSTANCE); 47 } 48 } 49 50 52 public void rebuild(Document document, ConfigRegistry registry) 53 throws ConfigurationException { 54 if (TestConfigFactory2.createRegistry) { 55 Assert.assertTrue("Should be new registry", 56 registry != TestConfigRegistry2.INSTANCE); 57 } else if (TestConfigFactory2.nullRegistry) { 58 Assert.assertTrue("Should be null registry", 59 registry == null); 60 } else { 61 Assert.assertTrue("Should be instance registry", 62 registry == TestConfigRegistry2.INSTANCE); 63 } 64 } 65 66 68 public void validate(ConfigRegistry registry, Map registries) 69 throws ConfigurationException { 70 if (TestConfigFactory2.createRegistry) { 71 Assert.assertTrue("Should be new registry", 72 registry != TestConfigRegistry2.INSTANCE); 73 } else if (TestConfigFactory2.nullRegistry) { 74 Assert.assertTrue("Should be null registry", registry == null); 75 } else { 76 Assert.assertTrue("Should be instance registry", 77 registry == TestConfigRegistry2.INSTANCE); 78 } 79 } 80 81 83 public void commit(ConfigRegistry registry, Map otherRegistries) { 84 } 85 } | Popular Tags |