01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.config.schema.test;
05:
06: /**
07: * Allows you to build valid config for the system-global config stuff. This class <strong>MUST NOT</strong> invoke the
08: * actual XML beans to do its work; one of its purposes is, in fact, to test that those beans are set up correctly.
09: */
10: public class SystemConfigBuilder extends BaseConfigBuilder {
11:
12: public SystemConfigBuilder() {
13: super (1, ALL_PROPERTIES);
14: }
15:
16: public void setLicenseLocation(String value) {
17: setProperty("location", value);
18: }
19:
20: public static final String LICENSE_TYPE_NONE = "none";
21: public static final String LICENSE_TYPE_TRIAL = "trial";
22: public static final String LICENSE_TYPE_PRODUCTION = "production";
23:
24: public void setLicenseType(String value) {
25: setProperty("type", value);
26: }
27:
28: public static final String CONFIG_MODEL_DEVELOPMENT = "development";
29: public static final String CONFIG_MODEL_PRODUCTION = "production";
30:
31: public void setConfigurationModel(String value) {
32: setProperty("configuration-model", value);
33: }
34:
35: private static final String[] LICENSE = new String[] { "location",
36: "type" };
37: private static final String[] TOP_LEVEL_PROPERTIES = new String[] { "configuration-model" };
38: private static final String[] ALL_PROPERTIES = concat(new Object[] {
39: LICENSE, TOP_LEVEL_PROPERTIES });
40:
41: public String toString() {
42: return elementGroup("license", LICENSE)
43: + elements(TOP_LEVEL_PROPERTIES);
44: }
45:
46: public static SystemConfigBuilder newMinimalInstance() {
47: return new SystemConfigBuilder();
48: }
49:
50: }
|